Table of Contents
How to set Hubic as an external storage for owncloud
Motivations
Hubic is an inexpensive sync/storage service (currently 10TB for 10€/month.. not bad!) that however sucks in term of synchronisation features:
- sync is started every X time and not instead driven by a demon that run in the background starting the synchronisation when a file change;
- when a file change ALL the file is sent for synchronisation rather than the portion that changed. Think to a large binary file (a zip, a big image, a movie..) and you'll get the sense of this inefficiency;
- revision history of files are not supported.
OwnCloud is an hosted open-source sync service that instead has great sync capabilities (but, to my knowledge, still syncs the whole files) and has good clients for almost any system. OwnCloud support different external services for providing the actual storage for the files.
In this how-to we will mount a Hubic repository using hubicfuse and we'll tell OwnCloud to use it as local file external storage.
Requirements
Have your own server/VPS with root access
Tested on
An Ubuntu 14.0 LTS VPS hosted at gandi.net
Steps
Install Owncloud
Just follow the documentation, nothing particular here, it's a PHP-based web application. Use the MySql for better performances instead of the default SQLlite.
In Ubuntu you can use the deb package to install OwnCloud to /var/www/owncloud/
.
Open an account at Hubic
Just visit Hubic. At time of writing there are three options: 25GB free, 100GB for 1€/month or 10TB for 10€/month. No bad! That's by far the cheapest storage I could find!
Register a web application at Hubic
Create an application at https://hubic.com/home/browser/developers/ The return URI doesn't really matter, just provide https://example.org/.
Install hubicfuse
Just follow the documentation to install the dependecies, clone, configure, make and make install hubicfuse. In Ubuntu 14.04 I didn't have particular problems.
Mount Hubic
Create a file /root/.cloudfuse with:
username=[Hubic user e-mail] password=[Hubic password] client_id=[Hubic client id for the registered application] client_secret=[Hubic client secret for the registered application] redirect_uri=[Hubic redirect uri as registered for the application] verify_ssl=True
And don't forget to chmod it 600!
Create a directory /mnt/hubic
Add this line to /etc/rc.local
before exit(0)
:
hubicfuse /mnt/hubic -o noauto_cache,sync_read,allow_other,uid=1000,gid=33,umask=0007
where uid is your server user id and gid is those of the www-data group.
Now mount or reboot and check that you got the hubic repository mounted correctly to /mnt/hubic
. In case of troubles you can add the -d
flag to hubicfuse
for debugging.
Add Hubic as a OwnCloud external storage
Create a directory /mnt/hubic/default/owncloud and then for each user you want to manage in OwnCloud (just myself in my case) add a subfolder with its username and the following subfolders:
/mnt/hubic/default/owncloud/[OWNCLOUD_USERNAME]/files /mnt/hubic/default/owncloud/[OWNCLOUD_USERNAME]/files_trashbin /mnt/hubic/default/owncloud/[OWNCLOUD_USERNAME]/files_versions
In the OwnCloud istance you just installed, click to “admin” and add a local external storage pointing to /mnt/hubic/default/owncloud/$user/files
and set it available for all users.
Finally simlink the OwnCloud folders files_trashbin and files_versions (for each user):
cd /var/www/owncloud/data/[OWNCLOUD_USERNAME] ln -s /mnt/hubic/default/owncloud/[OWNCLOUD_USERNAME]/files_trashbin files_trashbin ln -s /mnt/hubic/default/owncloud/[OWNCLOUD_USERNAME]/files_versions files_versions
That's it! Now you should have in OwnCloud a folder for with all the storage (current files, previous versions and removed ones) are inside Hubic without taking other extra space in the server.
For better performances I also recommend to disable the file preview using 'enable_previews' ⇒ false,
in /var/www/owncloud/config/config.php
.
A note on performances
Pretty good actually. OwnCloud interface is very responsive and I have tried to copy large files from the server to the mounted Hubic folder and reverse. In both directions I had a speed of around 40Mb/sec (megabits/second).
Discussion