OwnCloud, as a FreeNAS Plugin

What is OwnCloud ? Its essentially a piece of file hosting software.

Similar in concept to Dropbox . It offers a multitude of ways to connect with other services such Amazon S3, Google Drive, etc. Its currently written in PHP, so it should not be exposed directly on the internet. Place it behind a VPN, or make it internal access only. It also offers desktop and mobile clients that do a moderately decent job of syncing/replicating files between devices.

What is FreeNAS and why is it useful? FreeNAS is a storage appliance that is based on FreeBSD . It offers numerous plugins, including OwnCloud, which provide near-push-button setup of various software pkgs. I use it for many things including OwnCloud, SMB/AFP sharing, NFS, and iSCSI.

Pre-reqs

Have a FreeNAS server installed (for this article, it is assumed you are installing OwnCloud as a FreeNAS plugin). I’m currently using FreeNAS 9.10.

Initial setup

Not much here. Click the ‘install’ button for the plugin. When the plugin is installed, you need to choose a place to store your data. I created a directory called ‘OwnCloud’ and and then mounted it on /media inside the plugin (use the web interface for the plugin jail). Now all your files will be stored outside the plugin (handy if you decided to get rid of the plugin, or if there are software issues down the road and you need to wipe out the plugin and start over).

Things you may need to do

Depending on what you’re doing, you may need to alter the Trust Domains . I added an entry to the array for the fqdn of the host. Then things worked as expected (with out this, connecting by domain name will silently fail).

1/mnt/<zpool>/jails/owncloud_1/usr/pbi/owncloud-amd64/www/owncloud/config/config.php

My config.php ended up looking like this (minus things like secrets, salts, etc):

 1<?php
 2$CONFIG = array (
 3  'memcache.local' => '\\OC\\Memcache\\APCu',
 4  'htaccess.RewriteBase' => '/',
 5  'instanceid' => 'instanceID',
 6  'passwordsalt' => 'nacl',
 7  'secret' => 'secret',
 8  'trusted_domains' =>
 9  array (
10    '198.18.3.242', 'owncloud.cmhome',
11  ),
12  'datadirectory' => '/media',
13  'overwrite.cli.url' => 'https://owncloud.cmhome',
14  'dbtype' => 'sqlite3',
15  'version' => '9.0.3.2',
16  'logtimezone' => 'UTC',
17  'installed' => true,
18);

Client Setup

Point your browser at the download page for OwnCloud . After you run the installer, you should be presented with a window that looks similar to what is below. Follow your way through to setup your sync directories.

Note: If you want to have multiple folder syncs to the same server, you can do so. For example, I sync my Downloads and Documents directories.

Summary

I’m currently using this to sync a total of around 12G between my desktop and laptop. It works over VPN (remember, don’t expose your PHP on the internet) too.

Note: It doesn’t handle links of any kind, so you have to handle those yourself. I haven’t found it to be much of a problem. The one directory I have that uses them, I just did a quick rsync after OwnCloud was done and I’m done.

Footnotes and References

Copyright

Comments