Sunday, August 24, 2014

Integrating ownCloud Into an Existing File Server With a Modicum of Sanity

In addition to our WHS 2011 box at the house, I administer a CentOS server for a client.  It's a bit of a mashup, currently supporting Asterisk and Samba primarily.  Folks at the client had started using Dropbox to share stuff with each other.  Now, this client has some large files, so for the folks who hadn't purchased a phone or tablet that came with a Dropbox storage bump or a paid account, they ran out of their space very quickly.  Never mind the insanity that is the same file being duplicated across a dozen personal computers needlessly.  ownCloud seemed like a good solution.

To make a long story short, what I've ended up with is SSHFS through Fuse for the folks who need to be actually doing things with files, and web access for the folks who just need to upload and download files.  The primary use case for cloud storage, however, is being able to send a web link to their clients to download work files that are far too big to email.  How to do it without duplicating files, though?  No sense in using their immense but utimately limited storage to hold the same thing in two places (RAID aside, of course).

Then I noticed ownCloud can mount external shares.  Prior to getting sshfs up and running we'd been using, as I said above, Samba to create a share all the Windows clients (and the one Mac client) can access.  So I mounted that share through ownCloud's admin page after enabling the External Storage app.  Worked like a charm.  Except that sharing files on a mounted SMB share isn't an option.  Whoops.  That kind of defeats the purpose.  So I googled.  And googled.  And googled.  Apparently I'm the first person to have this problem.

So I did what I wise person does.  I prayed.  The Holy Spirit said "try SFTP."  I said "I've never used SFTP."  He said "but you already know how to use Google."  So I googled it.  Turns out I don't have to do anything, since my users are already set up for SSHFS.  Did I mention I'm a big fan of SSH?  Is there anything it can't do?

Guess what?  SFTP works, and it browses through ownCloud faster than SMB/CIFS, to boot.  It respects my crazy complex group permission setup, too, of course.  The only downside is I have to configure it per user, as opposed to the "SMB/CIFS with OC login" option for SMB.

tldr; use SFTP to connect an external share to ownCloud, not SMB, if you want to be able to share from it.

Here's hoping Google indexes this and someone finds it useful!