diff --git a/nextcloud/README.md b/nextcloud/README.md index d0ec693a1..8db994d73 100644 --- a/nextcloud/README.md +++ b/nextcloud/README.md @@ -37,6 +37,7 @@ PGID/PUID : 1000 #allows setting user. trusted_domains : your-domain.com #allows to select the trusted domains. Domains not in this lis will be removed, except for the first one used in the initial configuration. OCR : false #set to true to install tesseract-ocr capability. OCRLANG : fra,eng #Any language can be set from this page (always three letters) [here](https://tesseract-ocr.github.io/tessdoc/Data-Files#data-files-for-version-400-november-29-2016). +data_directory: path for the main data directory. Defaults to `/share/nextcloud`. use_own_certs : true/false #if true, use the certfile and keyfile specified certfile: fullchain.pem #ssl certificate, must be located in /ssl keyfile: privkey.pem #sslkeyfile, must be located in /ssl diff --git a/nextcloud/config.json b/nextcloud/config.json index 44024f9ec..48b4b6036 100644 --- a/nextcloud/config.json +++ b/nextcloud/config.json @@ -25,6 +25,7 @@ "use_own_certs": false, "certfile": "fullchain.pem", "keyfile": "privkey.pem", + "data_directory": "/share/nextcloud", "trusted_domains": "your-domain, your-domain2", "OCR": false, "OCRLANG": "fra", @@ -38,6 +39,7 @@ "use_own_certs": "bool", "certfile": "str", "keyfile": "str", + "data_directory": "str", "OCR": "bool?", "OCRLANG": "str?", "Full_Text_Search": "bool?", diff --git a/nextcloud/rootfs/defaults/config.php b/nextcloud/rootfs/defaults/config.php index 367cad15d..9a534907c 100644 --- a/nextcloud/rootfs/defaults/config.php +++ b/nextcloud/rootfs/defaults/config.php @@ -1,6 +1,6 @@ '\OC\Memcache\APCu', - 'datadirectory' => '/share/nextcloud', + 'datadirectory' => '%%datadirectory%%', ); diff --git a/nextcloud/rootfs/etc/cont-init.d/60-memcache.sh b/nextcloud/rootfs/etc/cont-init.d/60-memcache.sh index 0307c088d..a2ac0edc2 100644 --- a/nextcloud/rootfs/etc/cont-init.d/60-memcache.sh +++ b/nextcloud/rootfs/etc/cont-init.d/60-memcache.sh @@ -1,5 +1,9 @@ #!/usr/bin/with-contenv bash +# Change data directory +datadirectory=$(bashio::config 'data_directory') +sed -i "s/%%datadirectory%%/${datadirectory}/g" /defaults/config.php + # copy config [[ ! -f /data/config/www/nextcloud/config/config.php ]] && \ cp /defaults/config.php /data/config/www/nextcloud/config/config.php