Post

Cloud Storage Syncing with Rclone

After my adventures with KeePass I found myself frequently annoyed that my mobile app was unbearably slow when trying to unlock the database off of my home network. This is due its primary goal to connect to my Samba server, which takes a long time to timeout, before falling back to the local backup. This would be fine on the occasional times I was completely offline (no cell data and all), but if it happens whenever I’m away from home it becomes problematic. My original plan was to flash my router with some new firmware and set up a VPN that I could remote into my home network from anywhere (which I still want to do, eventually) but the thought of connecting to my VPN each time I need a password felt tedious, not to mention the legwork required to get it working.

Instead, I decided to leverage the fact my mobile app (KeePass2Android) can connect to a cloud storage option, like Google Drive, to push and pull my data from anywhere that I have even a mild internet connection. This would mean, however, that I would need a way to synchronize my Google Drive to my Linux devices. I searched for a few different options before landing on Rclone; a completely free, subscriptionless, headless cloud sync tool. It was available on my apt repositories and has an easy walkthrough setup by simply running rclone config to set up a new remote connection. The initial part of the setup was painless, needing only a few minutes, but Google Drive (can’t speak to any other cloud services) required creating a Client ID and Secret using the Google API Console. While it seemed intimidating at first (it was a very techy, web-designer interface) but luckily the rclone setup provides a link to the exact instructions you need to follow at the exact step you need them!

It took another 30-ish minutes to finish up setting up the Google Drive API hooks that Rclone required to be able to access my drive, and it was ready to go. While it originally felt hacky, and a bit insecure, I realized I was explicitly setting the permissions for the app as well as the token to do it. This flipped the script and made me feel more secure; I knew exactly what the app was able to do, and if I didn’t like it (or a bad actor got access) I could just revoke the token. Though there were a variety of commands to try, a simple rclone sync GoogleDrive: ~/passwords/ brought me a copy down.

I’ll likely be investigating alternatives to Google Drive in the future, ideally a self-hosted solution, but for now this does the job with little complaint.

This post is licensed under CC BY 4.0 by the author.

© Coder. Some rights reserved.

Using the Chirpy theme for Jekyll.

Trending Tags