[ UPDATE: I found another bloke who wrote Create your own Mozilla Weave server that pretty much covers much of what I did below. It's definitely worth a read over! ]
I was reading my feeds as usual, and I came across a nifty idea in a post about Setting up Mozilla Weave on your Server. The article was great, but in my case I was running a slightly different environment. I didn’t have the one-click installation stuff, but the more lovely raw configuration files at my hands.
For background, Weave fulfills syncing of your Firefox information. That is to say bookmarks/cookies/history/tabs & personal data are encrypted and stored on the Mozilla lab servers. Google offered something called Google Browser Sync but they have recently decided to stop development and support of the project, and have since exported it to developers to continue. Weave is definitely picking up where GBS stopped.
Weave uses WebDAV to send information from your browser to their servers for storage. Again the information being sent is encrypted (over HTTPS), and stored encrypted. Weave allows you to effectively have the same Firefox information from a variety of locations where you have a Firefox installation at your disposal. This is where the power of the software comes in. Whether it be on my laptop or desktop, I have the same information in Firefox shared and synchronized.
Where Google Browser Sync sent its information to Google’s servers for safe keeping, Weave is using the Mozilla lab servers. So I got to thinking. With all this crying over privacy of your online stored data why not take a bit of that control in to my own hands? What choices does the average person have when it comes to backing up or securing this type of data ourselves? Google Has All My Data – How Do I Back It Up? has some excellent solutions in the comments. Be warned, much of the solutions are submitted in the comments by users so caveat emptor. Weave is leveraging Open Source technologies. That means power to the people. Or in this case, let’s store our Weave data locally on a machine we run and trust.
I run Apache on my primary machine under a Windows environment. I was using Apache to send files between machines (hint, I was lazy, hence a web server solution) in the house. It took all of 10 minutes to set up WebDAV and Weave. I’ll do my best to write this for “out of the box” Apache under Windows installation defaults.
Under the default httpd.conf file, we need to enable WebDAV. It’s as easy as using LoadModule.
LoadModule dav_module modules/mod_dav.so
LoadModule dav_fs_module modules/mod_dav_fs.so
LoadModule dav_lock_module modules/mod_dav_lock.so
If you are like me, I tend to test things are working, so I did a quick restart of Apache, and watched the error logs. Of course, we just enabled the module to handle WebDAV requests, and everything was running smoothly.
Next up is how we get our WebDAV storage sorted out. The code below is what I put in to my httpd.conf to allow the local directory c:\apache\uploads to work as my WebDAV repository.
DavLockDB "C:/apache/var/DavLock"
Alias /uploads "C:\apache\uploads"
<Directory "C:\apache\uploads">
Dav On
Order Allow,Deny
Allow from all
Options Indexes
AuthType Basic
AuthName "WebDAV Restricted"
AuthUserFile "C:/apache/user.passwd"
require valid-user
# Allow universal read-access, but writes are restricted
# to the admin user.
<LimitExcept GET OPTIONS>
require user weaveuser
</LimitExcept>
</Directory>
A couple points here to remember. weaveuser is the user name I have set, it’s just a generic user name that I made up for this post. This would also require you to make the c:\apache\user.passwd file. You can do it like this:
htpasswd -c c:\apache\user.passwd weaveuser
Note! -C creates a new file! Remember that if you are using an existing password file or you will overwrite the file!
Then I entered in my password twice, and the file was generated.
A quick restart of Apache later, I went in to my Firefox Weave preferences and edited the server location to: http://127.0.0.1:8080/uploads/. I logged in with the user name and password I made, and Weave synced up perfectly! If you have a hosting provider who allows DAV access, you could also use that for your Weave storage.
I am one of the lucky beta testers for Dropbox, but I know there are other ‘online storage drive’ solutions on the web. Dropbox, by the way, is beyond awesome and a bit beyond the scope of this post. At any rate, I thought to myself if Dropbox can be seen as a local directory, why can’t I get Apache to see it in the same way?
Alias /uploads "C:\Documents and Settings\Administrator\My Documents\My Dropbox"
I just changed the reference of c:\apache\uploads to be my Dropbox location on my local file system. A quick restart of Apache and all was well. With Firefox running, I hesitantly clicked on Weave to sync my settings. Success! Dropbox efficiently ran in the background storing all my Weave information there safely, and Apache ran just fine. Even if the connection drops between your machine and Dropbox’s servers, you can always fall back to storing your information on your local machine — perhaps by using a secondary directory as a ‘backup’. I was just using Dropbox as a “because I can” thing. Perhaps other remote storage drive solutions can do the same. The idea itself is quite fascinating.
Granted we’re still in a solution here that “omg who has my data”, but this does give you the option of storing your settings in an online way — and one that you have a bit more control over. For me, I suppose I like how I can use Weave in my own network environment, and still gain full benefit from its syncing abilities.
As the web expands in to more multi-device concepts, combined with the need for syncing your data/thoughts/ideas/bookmarks/whatever, this type of solution really opens up some truly neat opportunities. More importantly, this puts power and control in to your hands without compromising the underlying technologies you want to take advantage of.
Credit where it’s due. Mario for the first post I saw about using Weave in such a way, and Remco for his work with more detailed Apache configurations (including SSL). And of course the guys at Mozilla Labs for keeping Weave going.