Convenient private cloud with Seafile

Slashdot it! Delicious Share on Facebook Tweet! Digg!
© Frank Peters - Fotolia.com

© Frank Peters - Fotolia.com

Cloud Nine

After the Prism and Tempora revelations, the writing's on the wall: Your data stored on public clouds isn't safe from the clutches of security agencies. Help can come only from a self-administered solution – yet Seafile provides a simple and ingenious approach.

Cloud storage is steadily gaining popularity. Data can be stored centrally and synchronized over multiple computers, shared with colleagues and friends, or made fully accessible to anyone. On the tail of the NSA wiretapping scandal, many users are asking themselves whether their cloud data is truly in good hands. Others consider what might happen to their data if a supplier goes bankrupt or is bought up. Others still, especially operators of their own servers, see no reason to pay for storage while they have enough of their own unused space.

The free alternatives ownCloud [1] and Seafile [2] are targeted to the latter group. While ownCloud overwhelms with tons of functionalities, Seafile concentrates only on storing, providing, and synchronizing data on the network.

Seafile was originally developed by the Chinese firm Seafile Ltd. The application is under GPLv3 licensing and is largely implemented in C and Python. The Seafile server is available as source code and binary download for Ubuntu. Together with a network daemon, it provides its own HTTP server and a Django 1.5-based Framework administration interface called Seahub. Seafile clients are available for Linux, Mac OS, X, Windows, Android, and iOS.

The data to synchronize are stored in "libraries," and you can synchronize multiple directories on a computer with the server and keep different directories on multiple machines in the same state across the online hard drive. If a user has the Private and Work libraries, for example, she can use the former to synchronize data entities on her home computer and mobile devices. She can then open up the Work library to her workmates.

Installation

At the moment of writing, the Seafile server is currently in version 1.8.5. To begin, download the current version's tar.gz from the project website and unpack it. You also may need to install some Python packages and their dependencies. Apart from Python 2.6 or 2.7, the developers also reference the python-setuptools, python-webpy, python-simplejson, and python-imaging libraries. You will also need to install sqlite3.

Because the installation process creates several subdirectories, the developers recommend extracting the archive into a separate directory. You then run the setup-seafile.sh file contained in the newly created seafile-server-1.8.5 directory.

The script then requests you to enter some configuration entries, for example, on which port Seafile and its related web interface listens and in which directory it stores user data (Figure 1). After that, you can start the services with the following commands. Because Seafile uses privileged ports, root privileges (sudo) are required.

$ /<seafile_path>/seafile.sh start
$ /<seafile_path>/seahub.sh start
Figure 1: Seafile comes with the clear Seahub web interface created by the data collector's configuration.

The ports specified in the configuration should now open, usually ports 8000, 8082, 10001, and 12001, which provide the Seahub application interface and the Seafile HTTP server via the browser.

Seahub (port 8000) provides a clear interface (Figure 1), although the Seafile HTTP server presents an empty browser window. If an error occurs, use ps to check whether the applications are running or a firewall is blocking the private cloud storage. Listing 1 shows how to unlock the ports in iptables.

Listing 1

Unlocking Ports

#Iptables-Rules for Seafile
iptables -A INPUT -p tcp -m multiport --dports 8000,8082,10001,12001 \
         -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A output -p tcp -m multiport --sports 8000,8082,10001,12001 \
         -m state --state ESTABLISHED -j ACCEPT

Client Installation

To make Seafile useful, you need the corresponding client software. The Seafile project provides the command-line version as a tarball download [4]. The Seafile configuration data needs a separate directory. A separate folder is also recommended for the online hard drive itself, but isn't absolutely necessary. You can add both with the following command:

$ mkdir ~/.seafile-client ~/seafile-sync_dir

To make the client compatible with the configuration folder after unpacking it, you need to initialize it using the following command:

$ /<client_path>/seaf-cli init -d ~/.seafile-client

The init process creates a .ccnet directory with configuration data for keys, the directory to synchronize, and the connectivity structure with server. The client later stores database and configuration data it needs for synchronization in .seafile-client. You then start the Seafile and Ccnet daemon with the following command:

$ /<client_path>/seaf-cli start

The Seaf-cli command-line client currently understands eight commands (Table 1).

Table 1: Seaf-cli Commands

init Creates configuration files for Seafile clients
start Starts the Seafile client as a daemon
stop Stops the Seafile client
list Lists the local libraries
status Shows the synchronization status
download Loads server libraries into a specified target directory
sync Synchronizes server libraries with the target directory's database
desync Quits the server synchronization

Not all worked in my test, and certain libraries couldn't be downloaded or recreated. Also a command to show the library IDs is missing, which often requires logging in to the Seahub web front end. Apart from the subcommands, the command line client requires additional parameters for many actions (see Table 2).

Table 2: Seaf-cli Parameters

-c <config_file Path to the configuration file
-d <folder> Local directory to synchronize
-l <id> Library on the server
-p <pass> Password
-s http[s]://<server>[:<Port>] URL of the Seahub server
-u <user> Username

For example, to fetch the Documents library from the server to the local computer, use the following command structure:

$ seaf-cli download -l <library_ID> -s http[s]://<server> -d <sync_folder>

The library_ID can be read from the Seahub interface, where it appears as a repo_ID in the corresponding library links. To move an existing directory to private online storage, use the following command structure:

$ seaf-cli sync -l <library-ID> -s http[s]://<server> -d <folder>

To do this, you must have previously applied the library through the web interface. The seaf-cli status command shows how synchronization is progressing. The seaf-cli list displays which local directories are synchronized with the online libraries.

Buy this article as PDF

Express-Checkout as PDF

Pages: 6

Price $0.99
(incl. VAT)

Buy Ubuntu User

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

  • Ubuntu One Clients for KDE and Fedora

    Ever since the Ubuntu One cloud service played an important role in Ubuntu 10.04, a new prototype of a KDE client has become available. A port to Fedora is also in the works.

  • Making the most of Ubuntu's personal cloud service

    Ubuntu One is a service from Canonical that lets you access your documents, photos, music, and files everywhere, and it's in every version of Ubuntu. Instead of just "one weird trick" to get the most out of your Ubuntu One account, here's a bunch.

  • Tau Meta Tau Physica: Bringing Open Source to Fashion

    In this exclusive interview, Susan Spencer Conklin tells Linux Pro Magazine how she re-entered the open source world with a project that combines her programming skills with her interest in fashion. Susan explains how her vision for an open source fashion tool has expanded since she first introduced the Tau Meta Tau Physica application at the Libre Graphics Meeting in Brussels last fall.

  • Integrating network storage through the file manager

    Web hosting providers usually give you FTP access when you need to upload data to their online storage. On Linux, a file manager is all you need to access network storage.

  • Performance tuning for web servers

    The continued rapid growth of the Internet is placing ever-increasing demands on web servers. Does the venerable Apache HTTP server have what it takes to keep up?