Following on from my last post about saving Facebook tagged photos to ownCloud, here’s a plugin that addresses my Flickr favourites rule.

This plugin, when set up on IFTTT, will use exactly the same mechanism to save any public photos I tag as a favourite on Flickr to my owncloud folder.

Here’s my flickrfaves.php

For many reasons, not least of which their decision to appoint a surveillance loving war criminal to their board of directors, I’ve been steadily migrating away from Dropbox.

Thankfully, there is a drop-in replacement for much of it, providing you run your own server. So, I’ve got a syncing file store/backup running across my devices, which can be accessed while I’m on the go as well.

However, one of the things I do use dropbox for (which is not terribly important in the grand scheme of things, but which I find quite useful) is, via the use of an IFTTT rule, to take a copy of any photos I’m tagged in on Facebook, so that I can see them (and to break them out of the silo) without actually having to go onto Facebook. This is possible using dropbox, owing to it being a centralised service, but obviously isn’t possible using your own server.

Webhooks to the rescue!

So a little while ago I put together a hack that used IFTTT’s wordpress channel to add a pluggable webhooks interface to IFTTT.

Since this tool supports plugins, I was therefore able to write a simple Facebook adapter which, when triggered would extract the image URL from the push message and then simply download it.

Since my owncloud install was on the same server, all I had to do was output this file to the appropriate owncloud data directory and any files retrieved are automatically synced to your client devices. You can of course opt to write to any directory, and not use owncloud at all, but since I wanted a like for like replacement for IFTTT+Dropbox I went for owncloud server storage!

Here’s the facebookphoto.php plugin code:

Simple, and obviously you could extend this to do other things with it.

Place the code in your plugins directory, and create a new recipe on ifttt triggering your plugin whenever you’re tagged on Facebook, remembering to pass plugin:FacebookPhoto as your category.

» Visit the Ifttt webhook project on github...

Unless you’ve been living under a rock, you’ll know by now that government agencies around the world are watching everything you do online, collecting this data and using it for various undisclosed purposes. Even before then, we knew that various private companies were harvesting data on us, and we could only hope that the worst they wanted to do was sell us things.

To say I wasn’t comfortable with this arrangement was something of an understatement.

So, I used all this as a spur to get my data out of NSA/Big Corporate controlled systems and onto FOSS based platforms that I own and control.

Starting Point

I was somewhat fortunate in regards my starting point. I had never bought into gmail, so my email accounts are hosted by a private mail server, to which I connect over an encrypted link. My main server, which hosts, among other things this website, is run of a private server in Germany.

My main computers at home are Linux based, and I already make extensive use of encryption; I use DNSCrypt to secure my DNS lookups from prying eyes, have HTTPS Everywhere and Adblock Plus installed on every browser, and secure sites with HTTPS (made considerably more affordable by StartSSL’s provision of free SSL certificates), and private code is hosted on my gitolite (nee gitosis) install rather than Github.

However, I still made use of services like Dropbox and Google drive, talked on Google chat, and use Google analytics for tracking.

The low hanging fruit…

The first thing I did was to grab and install a whole bunch of free certificates from StartSSL to remove the browser warnings from a bunch of the non-user facing sites that I run. This was important since the browser warning encouraged people to click through errors, and since the site always generated an error (even thought the site was being encrypted) it would be very vulnerable to MITM attacks.

Once this was accomplished I installed ownCloud, with the client software configured to talk only to the HTTPS endpoints. This was painless, and basically just a matter of downloading and installing the server software on a subdomain for it (the latter isn’t strictly necessary, but I like having things separate like that). The ownCloud client works exactly like the dropbox one, and is available for Linux, OSX, Windows (and a paid for one for iOS – presumably to drum up some money for the project – but it’s only a few pence).

Next, I started moving my sites away from Google Analytics. The open source world has moved a long way since I last looked at this, and Piwik, the best of breed, is very performant. Again, it was just a matter of installing the software on my server and then changing the embed code on the various sites. WordPress has a very functional plugin that integrates nicely with most themes.

The last easy thing I did was to change my browser’s default search engine from google to Startpage. The reason I picked Startpage over DuckDuckGo (which is the other main alternative) is twofold, firstly, the engine piggybacks off of google (but with identifiers removed), and despite while Google profile you for the NSA they still built a damn good search engine. Second, as a US company based in Pensilvania, DDG falls squarely under the sinister shadow of the US Patriot act and FISA, so, regardless of what they do now, they could still be forced to start spying.

Next, the harder stuff…

Update: while at the time of writing the, events in the pressure cooker article, linked above, were believed to be the result of active surveillance on the part of google, it now turns out to have been the result of an employee tipoff. Nevertheless, it seems nightly unlikely that this honeypot of profiling data isn’t being actively monitored, given how much other stuff is, although at the moment we have no evidence. This is one of the things that makes the Snowden revelations so frustrating.