Configuring External Storage for ownCloud

One of the features that I worked on for ownCloud 4 was the mounting of external storage directly into your ownCloud. No longer are you limited by the storage capacity of the server ownCloud is running on. Despite being labeled as an ‘experimental’ feature in the release announcement, many users requested help configuring it. With no user interface available and limited documentation to configure the external storage it seems all users were confused and frustrated. So, I set aside a few days and tasked myself with finally creating a usable user interface to configure external storage. This is the result of that work:

To add an external storage backend to your ownCloud head to Settings -> Admin or Personal. As an admin you can mount external storage for any group or user. Users are also allowed to mount external storage for their selves if this setting is enabled by the admin. The first step is to set the mount point, this is the directory that the storage will be mounted to. Next, select a backend from the list of available backends. ownCloud currently supports: Amazon S3, Dropbox, FTP, Google Drive, OpenStack Swift, SMB, and WebDAV. Local file storage can also be mounted that is outside of your ownCloud’s data directory. Users are restricted from mounting local file storage in the Settings -> Personal page, because this is a security risk.

Once a backend is selected, more configuration fields will appear. The configuration fields requested vary depending on the selected storage backend. For example, the FTP storage backend needs the following configuration details: url, username, password, root (optional), and an option for ftps://. The root option is the directory at the external storage that will be mounted.

This is available in the master branch and will not be included until the ownCloud 5 release. Documentation for manually configuring external storage is available at ownCloud.org. No error checking has been implemented at this time, so make sure all configuration fields are entered correctly.

Support for mounting Google Drive and Dropbox through this user interface will be added later in the week. These require some more work because of the OAuth authentication.

Hi Michael,
seems to be a very helpful interface for a lot of people who want to enhance their oC easily.
Is there any possibility to use your newest development directly? To be hones: I don’t want to wait until the release of oC5

Thanks, but I don’t succeed. I tried both, first the manual configuration in config/mount.php, then with your GUI-config. Both don’t work.

I’m using 4.0.2 from owncloud’s package repository. in the second step, I only rsynced “owncloud/apps/files_external/” to “/var/www/…”, everything else is 4.0.2.

How can I debug?

I tried to add some log into my php code and found, that the config file is read and method “mount” in lib/filesystem.php is called with meaningful parameters.

But still, the mounted pathes don’t appear in “files” and there’s no debug nor error log.

I try to access local media files that are outside of owncloud, especially in “/var/data”. User www-data has read access, but not write access. But I also tried to mount “/var/www/test” that is owned by www-data – nothing happens, nothing works at all.

If I knew this, I didn’t even need a GUI Interface, mount.php is also fine for me, bnow that I found the syntax documentation (you just need to know it, instead of clickediclick, a link to the respective documentation from the OwnCloud UI to the documentation just where you enable the App would help)

I got it working I can upload or edit files from an external storage, but versioning does not work for me. Is it a bug or just not yet implemented?
If you mount your dropbox, versioning is not needed, because dropbox has its own versioning, but if you mount a webdav storage, it would be an important feature for me.

Hi Michael, I installed Wamp server on my local machine and create an app in Dropbox to get the keys as you explain to associate dropox in owncloud. I downloaded the master branch and I got the external storage API. The problem I got is nothing happen when I clicked on “grant access”. I looked in my Firefox java console and I got:
POST http://localhost/owncloud-owncloud/?app=files_external&getfile=ajax/google.php [HTTP/1.1 200 OK 181ms]. It seems the request is sent but no response. Do you have an idea?

@gilberton A dialog should appear if there was an error. I’m a little confused because you said you were trying to configure Dropbox, but it looks like it was trying to configure Google Drive instead. Stop by IRC and I’ll try to help.

Hi Michael, thanks for replying I did some progress last week. I found that my problem was related to the curl library that didn’t load because I use wamp for windows 64 bits, I downgraded to 32 bits and Curl loaded fine. Then after downloading the last master branch you upgraded I am abble to get Google drive working and appearing on the file menu. However I still have a problem with Dropbox that gives me the error message: “fetching request tokens failes. Verify that your Dropbox app key and secret are correct”. I tried several time with fresh created appli and Dropbox but nothing change. I looked in Apache error log and get:[Mon Jul 02 15:01:51 2012] [error] [client 127.0.0.1] client denied by server configuration: C:/wamp/www/owncloud-owncloud/data/htaccesstest.txt. As far as I find on the web htaccesstest.txt is not the problem as it is just for test. Do you have an idea?

Michael, Good plugin but I believe you need to rethink some parts a bit.
1. If I add a storage that should be used by all users, They all need index this External Storage?
2. If it’s a gigantic storage, indexing it thru the webbserver will time out. How about creating a backend crontabbed indexer?
3. If scanFiles() is initiated. Will it then try to rescan the gigantic External Storage?

@Raboo 1: Yes, unfortunately the file cache wasn’t designed for this type of thing and will need some improvements in the future. 2: I think it would be better to continue improving the file scanning instead. 3: Yes, it will.

Michael, well perhaps then it’s better to have the storage and external storage work differently?
Might be better to have external storage more like a filebrowser without indexing. So it justs brows and list files as it goes and no indexing? Cause even if indexing is improved, it will still not be able to work good with bigger storages housing many files.