Skip to content

Instantly share code, notes, and snippets.

@Oceanswave
Created March 10, 2017 21:57
Show Gist options
  • Save Oceanswave/fd1f8e5afb04bf98dfdccf442d66c1c0 to your computer and use it in GitHub Desktop.
Save Oceanswave/fd1f8e5afb04bf98dfdccf442d66c1c0 to your computer and use it in GitHub Desktop.
Using a Raspberry Pi as a local gateway to unlimited encrypted storage via Amazon Cloud Drive
The Pi is Linux, so it can be done with shell scripts easily. Here is a part of a guide I wrote for setting up an encrypted ACD on Linux. I tried to use only the relevant parts, sorry if it seems disjointed.
After that, install the software that we will be using.
sudo apt-get update
sudo apt-get install sshfs
sudo apt-get install encfs
sudo apt-get install python3-pip
pip3 install --upgrade git+https://github.com/yadayada/acd_cli.git
acd_cli init
We will need to add the Amazon authorization key to the .cache/acd_cli/ folder. Instructions can be found at http://acd-cli.readthedocs.io/en/latest/authorization.html
Then to encrypt we will use the command: encfs --reverse ~/ClearText ~/Encrypted
Then it should ask you some questions about setting up the encryption. The important part is the block size should be as small as possible. Also, make sure you use a secure passphrase, yada yada yada.
This will create a config file at /ClearText/.encfs.xml Make sure to download and back it up in multiple locations. You will need it on our home pc to decrypt the files.
Lastly is to mount the ACD unencrypted on our home pc. Of course you should use a shell script to make this easier.
The two folders that we will create on our home pc are: /AmazonCloud to hold everything in the amazon cloud /Decrypted which will perform on the fly decryption.
To mount the amazon drive, use: acd_cli sync acd_cli mount ~/AmazonCloud
Then to decrypt, use the command: ENCFS6_CONFIG=/location/of/.encfs.xml encfs ~/Amazon/Upload ~/Decrypted
Then you are all set. From the decrypted folder you can move files and folder to organize how every you like.
Just a couple of quick notes:
If a file appears to be missing, delete .cache/acd_cli/nodes.db then run acd_cli clear-cache then resync.
I find Kodi to currently be the best for "streaming" large media files. Do not have Kodi scan the folder as that will take a very long time to complete.
Lastly, use as many folder as possible. If possible, use a folder for every file. Browsing a folder that holds 100's of other folders is quick and easy. Browsing a folder with 100's of files will take a minute for the metadata to download.
@dairefagan
Copy link

Will this work with Google Drive?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment