Problem to add local storage to owncloud

Hi all!

Steps to reproduce

  1. fresh owncloud 10.0.10 installation on QNAP NAS TS-877
  2. edit config.php to allow adding local storage as external
  3. add lokal directories as external storage

Expected behaviour

Adding and manipulation of local directories/files saved on server with owncloud.

Actual behaviour

Owncloud is not adding specific local directories as external storage. It’s possible to add / or /home and some other paths as read-only (no rights to add or change files - due to permission restrictions), but specific directories eg. /share/CACHEDEV1_DATA/WORK_Kunden_und_Projekt_Dokumente are not working.

Server configuration

Operating system: QNAP NAS with QTS 4.3.6

**Web server: Apache

**Database: MariaDB 5.5.57

**PHP version: 5.6.38

**ownCloud version: 10.0.0.10

**Updated from an older ownCloud or fresh install: fresh installation

Where did you install ownCloud from: QNAP NAS App store

**Signing status (ownCloud 9.0 and above): 10.0.0.10

The content of config/config.php:
/share/CACHEDEV1_DATA/.qpkg/owncloudv10/config/config.php

<?php
$CONFIG = array (
  'instanceid' => 'oc9ylgi936m2',
  'passwordsalt' => 'ejUfFNoObUSVQqidZuGFt3xIGYjJa3',
  'secret' => 'FeYu9gbQi4aoag3aNCJQHyTZqspkOzCBhqs8ztkStlJv5pB+',
  'trusted_domains' =>
  array (
    0 => '192.168.1.2:4490',
    1 => 'XX.XXXXXX.XXX:4490',
  ),
  'datadirectory' => '/var/www/html/data',
  'overwrite.cli.url' => 'http://192.168.1.2:4490',
  'dbtype' => 'mysql',
  'version' => '10.0.10.4',
  'dbname' => 'owncloudDB',
  'dbhost' => '192.168.1.2',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'oc_admin2',
  'dbpassword' => 'gWSYhwEFBZfzqNNNaD6pv7MugVcmEw',
  'logtimezone' => 'UTC',
  'installed' => true,
  'files_external_allow_create_new_local' => true,
);

**Are you using external storage, if yes which one:
storage which should be added is located under:
/share/CACHEDEV1_DATA/WORK_Kunden_und_Projekt_Dokumente

**Are you using encryption: no

The installation of owncloud 10.0.10 was in general very easy and worked as expected. Struggling a little bit with SSL-installation but this is not important at the moment. After adding the line ‘files_external_allow_create_new_local’ => true to config.php it should be also possible to add local directories as external storage - option appears on admin page as expected. Now I want to add my local directories as external storage. It’s not possible to do this - don’t know why - is it a different path or some issue with permissions? with ssh login and search function, I found my local data under /share/CACHEDEV1_DATA/WORK_Kunden_und_Projekt_Dokumente but this path is not working in owncloud (see picture). I tried some other random paths for example / - this paths can be found and added as readonly and this directory seems to be different compared with the original file structure on the server.
I’m not very experienced with webserver setups and a little bit lost now, maybe somebody can help me.

Many thanks

Regards
Ralf

Access to those local folders are done by using the webserver’s user (usually www-data or apache). Make sure that user have enough permissions in the configured folders inside the local FS to do what you want.

2 Likes

I have the same situation, but the problem is not a webserver user’s access to the folder, but that owncloud runs in a docker image on the QNAP. It thus has its own root filesystem and cannot see folders outside of the docker image’s folder.

However, it is possible to access the files in the docker image from the outside. So while you can specify each folder in the docker root file system as “external local storage”, you can also access this folder from the outside and make an external link to this docker-internal folder from an folder that is also exported by the QNAP for local access.

This seems to work somehow, though I am not sure how “legal” it is to access a docker image from the outside this way. The Owncloud should pick up files added and modified in that folder once its crontab runs. That part doesn’t seem to work well for me. However, adding files through the owncloud interfaces to this folder works well, and then they also show up in the locally exported QNAP folder.

There are probably better and more “official” solutions.

I know this post is old, but for those that are still looking for this solution - see below.

As mentioned, the Owncloud instance is running in a docker container. So even if you force local storage by editing the config file, the underlying directory structure is blocked/unavailable.

To mount local storage though, you can do the following (no need to edit config files).

  1. ENABLE the SSH service, and enable SFTP access
  2. In the OWNCLOUD config, enable EXTERNAL STORAGE
  3. Choose SFTP as the mount type, put in the IP of the server (you CANNOT use Localhost or 127.0.0.1 as you would expect, because that will point back to the container - you MUST use the actual LAN IP of the server)
  4. Set authentication type to USERNAME AND PASSWORD
  5. Put in the mount point “/share/Documents”, and the root user you setup via SSH
  6. ENJOY!
2 Likes