Dropbox was never on my favourite list because I’ve always used Google Drive. But since I didn’t want to use my Google Drive to store some specific files I’ve decided to give Dropbox a try on my CentOS 7 server. Unfortunatelly, for some reason I was not able to make it work (the CLI). After a little bit of researching and googling, it seems that the latest version requires you to have GLIBC >= 2.19 version (by default, on latest CentOS 7.6 the default GLIBC version is 2.17). More, it seems that’s mandatory to have an EXT4 filesystem in order to sync the remote files locally. Apparently, with XFS, the files are never synced.
I was pretty close to just say a well deserved “Fuck you!” then it hitted me. Docker! So why not running Dropbox inside a docker container better? As for the filesystem, which was already XFS and I had no intention to change that, I’ve decided to use VeraCrypt to create an encrypted EXT4 partition on my actual XFS filesystem.
So here’s how I did it:
1) Install Docker (I won’t lose myself in explanations here, the official Docker documentation is pretty easy to understand):
2) Install VeraCrypt:
$ mkdir -p /usr/local/src/veracrypt
$ cd cd /usr/local/src/veracrypt
$ wget "https://launchpadlibrarian.net/388151497/veracrypt-1.23-setup.tar.bz2"
$ tar -xjvf "veracrypt-1.23-setup.tar.bz2"
$ rm veracrypt-1.23-setup.tar.bz2
3) Create an encrypted VeraCrypt partition (I’ve chosen 5G, same as my account):
veracrypt --create /var/veracrypt_partition --size 5G
Then choose: 1) Normal, 1) AES, 1) SHA-512, 5) Linux Ext4
3) Create a system user, and a folder where to store the files and mount the veracrypt volume
useradd -uid 2019 user -d /home/user
chown user:user /user -R
veracrypt -t /var/veracrypt_partition /user
4) Run Dropbox inside a docker container:
First create some useful system aliases for an easier usage experience:
alias dropbox="docker exec -it dropbox dropbox"
alias dropbox-start="docker run -d --restart=always --name=dropbox -v /user/Dropbox:/dbox/Dropbox -v /user/.dropbox:/dbox/.dropbox -e DBOX_UID=2019 -e DBOX_GID=2019 janeczku/dropbox"
Start the docker container:
$ dropbox start
Check what’s the status of docker container:
$ dropbox status
Check the container logs:
$ docker logs dropbox -f
Authorize Dropbox (you’ll see a console message similar with:
<em>Please visit https://www.dropbox.com/cli_link_nonce?nonce=be63e281839916cde2ede5427726e1b1 to link this device.</em>
Once you have visited that link, the sync will start
And that’s pretty much it!