Owncloud with Tahoe-LAFS.
Important update on this tutorial:
After testing it more the last days I ran into some strange issues, when I used 'regular' ftp, and due to 'Zooko' pointing out that there are several issues in regards to using ftp isntead of SFTP
I have now updated this tutorial to use SFTP instead , that works much better,I also updated so that you install from source to get the latest version.
After all the NSA scandals I decided to pull all my files off amazon, google, dropbox etc.
As a alternative I’ve been using one of my servers in my basement, I’ve been using Owncloud as my front-end ,
it works perfectly, the client is crossplatform too, so it works with most OS’es.
The only issue I had was off-site storage, I really wanted a secure way of storing them off-site, so if my house burns down I can still get to my files.
This is where Tahoe-LAFS comes in, is a secure storage system for files. I wanted Owncloud to work with this system,
and it does indeed work, but it takes some work to configure it.
I plowed through the Tahoe-LAFS documentation, and asked the friendly guys at IRC on how to get tahoe to work with SFTP,
when that was set up I pointed my OwnCloud to the Tahoe-LAFS SFTP.
Please note that Owncloud only shows the files that are uploaded through it's webGUI or through the sync client, and not files uploaded to the same directory through SFTP to the Tahoe client, this is because Owncloud has it's database that keeps track of where the files are located etc.
Also if owncloud seems to 'lock up' during setup, then just stop the tahoe client, and reconfigure owncloud's external storage.
It seems to hang if misconfigured, stopping the tahoe client makes the owncloud plugin 'time out' faster so that you can work with it again.
This tutorial will do so that you hook it up to the test grid, that makes it easier for you to follow since you only need a client node,
but please do not put large amount of files there, this is just for testing. Keep in mind that your files cannot be seen by anyone else, even if you use the test-grid.
First you need to install Tahoe-LAFS I assume you are on ubuntu, and that you are running owncloud server on the same machine as Tahoe-LAFS.
Also please note that bugs may happen, so please only do this for research, I take no responsibility for what you do.
Install the dependencies for tahoe:
apt-get install python python-dev python-setuptools build-essential git && easy_install pip && pip install twisted
Start off by getting the latest Tahoe-LAFS source code by entering the command:
git clone https://github.com/tahoe-lafs/tahoe-lafs.git
cd into the tahoe dir:
python setup.py build
to start tahoe from now cd into the 'bin' (inside the thaoe-lafs directory you cloned the source to) and type:./tahoe create-client
this will create our client config etc.
Edit the configuration it created:
Edit the following:
nickname = Another nickname than "None"
introducer.furl = pb://
(this will connect it to the testgrid).
restart tahoe with the new configuration:
open your browser and go to:
this is your tahoe installation webgui.
click the ‘create a directory’ button (just leave everything as default).
click on ‘more info about this directory’
then copy the long line that says:
it’s a long line like this (example has been altered, so do not use it):
We will use this for our SFTP account file,
Create a folder named 'private' inside your home directory:
we then create the keyfiles needed for sftp, do not enter any password, just confirm the defaults, we place them into the 'private' directory:
ssh-keygen -f /home/YOUR_USERNAME/private/ssh_host_rsa_key
Then create the file:
YOUR_USERNAME YOUR_PASSWORD URI:DIR2:lrd3bxx5wm3grihn6srggrc5xq:aeoxmyovm6vpivcqutds2lszrrmaudbkrv6jfyzfqndjv3o4k46q
in a row (Space between username, pass and uri). the URI is the folder we created in our webgui.
We then edit our tahoe config, to enable FTP with the account file we created.
Add the following:
[sftpd] enabled = true port = tcp:8022:interface=127.0.0.1 host_pubkey_file = /home/YOUR_USERNAME/ssh_host_rsa_key.pub host_privkey_file = /home/YOUR_USERNAME/ssh_host_rsa_key accounts.file = /home/YOUR_USERNAME/accounts
You then log in to your owncloud instance, and
1) click on your username (I assume you are admin on that instance)
2) select ‘apps’, enable ‘external storage support’.
click your username again, and select ‘admin’,
add your SFTP to the config:
‘Folder name = tahoestorage’
‘external storage = Sftp’
‘configuration= 127.0.0.1:8022' (8022 is the port the SFTP runs on)
‘username = your username in the accounts file’
‘password = your password in the accounts file’.
assign it to your self or a group in the last 'setting' for the FTP.
then the ‘tahoestorage’ will appear in your root folder on owncloud.
If the icon looks like a folder then you've done it correctly, also a green icon will appear next to where you define the FTP settings if everything is OK.
you can then put files there and it’ll distribute it over tahoe-lafs.
You can check the SFTP by connecting with filezilla to :
ftp://127.0.0.1:8022 with your defined username \ password.
you can also open the port to owncloud webserver so that you can use the owncloud desktop client from wherever you are to your server at home,
then this owncloud instance will automatically distribute all files to the Tahoe grid - awesome, the power of open-source..!