Firefox 5, Cherokee and the (Full) Firefox Sync Server
I lately wrote about setting up your own Firefox Sync / Mozilla Weave server under the Cherokee webserver.
When I recently updated Firefox on my laptop, the first thing I saw was an error from the sync function – the server could not be found. Mozilla must have changed some essential things in the sync functionality, so I almost came to terms with going back to Firefox 4 in order to maintain synced bookmarks. Luckily I did some googling and came across a nice how-to (in german) for updating the minimal FF sync server to make it work with Firefox 5 again.
The article links to the blog of Toby Elliot, who is responsible for the Minimal version of the sync server. However, he states that there will assumingly be no more new versions for the minimal server, as he suggests to use the full version, which is completely rewritten in Python (instead of PHP) and – so he claims – much easier to install. So instead of updating the minimal server I took a chance and tried to install the full version. Here’s how to do it with Cherokee: Read the rest of this entry »
Cherokee & Firefox Sync/Mozilla Weave Server
Today I finished something that has bugged me for quite a long time now. And now that I’m finished, I’m not even sure why at all this was so difficult.
I am talking about setting up your own Firefox Sync (formerly known as Mozilla Weave) server under our favorite web server Cherokee. Firefox Sync is a mechanism for sharing your Firefox browser data (including bookmarks, history, open tabs and passwords) across all your devices, e.g. desktop computer, laptop and smartphone. Firefox Sync is a built-in feature in the latest Firefox version 4 and needs a special kind of server on the internet to sync the data between the devices. While you can use the server provided by Mozilla, I am not very comfortable with storing all my browser data on other people’s machines, even if they are (as in case of Firefox Sync) encrypted. So quite a time ago, I decided to set up my own server.
C#: UploadFileAsync – Catching Exceptions
Ran into an issue with C# shortly: I wanted to upload a file to an FTP-server using .NET’s WebClient-class, more specifically its UploadFileAsync-method. Basically, I had this code snippet:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | // Upload the file to the server: NetworkCredential credentials = new NetworkCredential(this.userName, this.password); WebClient uploader = new WebClient(); uploader.Credentials = credentials; uploader.UploadProgressChanged += UploadProgressCallback; uploader.UploadFileCompleted += UploadCompleteCallback; string uploadDir = "ftp://example.com/test.txt"; try { uploader.UploadFileAsync(new Uri(uploadDir), "C:\testfile.txt"); } catch (Exception ex) { MessageBox.Show(ex.Message); } |
It’s important that UploadFileAsync does not block the calling thread – the uploading takes places in a seperate background thread, and progress and completion of the transfer can be tracked with the associated UploadProgressChanged and UploadFileCompleted callbacks.
The problem is: When a wrong password or user name is passed in the Credentials-object, nothing happens. At least not what I would expect: No exception is thrown by the UploadFileAsync-method in the try-block, and the UploadFileComplete-callback is triggered as if everything went fine.
Textpattern & Cherokee: Setting up permalinks
After my first steps with Textpattern and the blog you’re now reading, my next big goal with this blog was to get away from the “messy” URLs Textpattern generates by default and establish nicer (and apparently more SEO-friendly) permalinks.
For example, the (abbrevated) URL to the article you’re currently reading in the standard “messy” way would be:
http://www.cataclyst.de/index.php?id=3
While with pretty URL-rewriting supported by Textpattern this reads:
http://www.cataclyst.de/textpattern-cherokee-setting-up-permalinks
I really like human-readable permalinks – you can instantly guess only by the look of the URL if it might be what you’re looking for or not (which comes in handy especially in forums etc.).
While Textpattern supports the Apache web server literally out of the box (by delivering a suitable .htacess file which takes care of all the necessary URL-rewriting), it turned out to be way harder to get it working with my Cherokee web server. At least for someone like me with little to no experience with this task.

