diff --git a/root/etc/s6-overlay/s6-rc.d/init-nextcloud-config/run b/root/etc/s6-overlay/s6-rc.d/init-nextcloud-config/run index d478afc..9bdabb9 100755 --- a/root/etc/s6-overlay/s6-rc.d/init-nextcloud-config/run +++ b/root/etc/s6-overlay/s6-rc.d/init-nextcloud-config/run @@ -35,21 +35,9 @@ for dir in config custom_apps themes; do fi done -# setup config +# copy defaults cp -n /defaults/config.php /app/www/public/config/config.php 2> >(grep -v 'cp: not replacing') -if ! occ config:system:get memcache.local; then - occ config:system:set memcache.local --value='\\OC\\Memcache\\APCu' -fi -if ! occ config:system:get memcache.distributed; then - occ config:system:set memcache.distributed --value='\\OC\\Memcache\\Memcached' -fi -if ! occ config:system:get datadirectory; then - occ config:system:set datadirectory --value='/data' -fi -if ! occ config:system:get apps_paths || ! occ config:system:get apps_paths | grep -q 'path: /app/www/public/apps' || ! occ config:system:get apps_paths | grep -q 'path: /app/www/public/custom_apps'; then - occ config:import < <(echo '{"system":{"apps_paths":[{"path":"\/app\/www\/public\/apps","url":"\/apps","writable":false},{"path":"\/app\/www\/public\/custom_apps","url":"\/custom_apps","writable":true}]}}') -fi -datadirectory=$(occ config:system:get datadirectory) +datadirectory=$(php -r "require '/app/www/public/config/config.php'; echo \$CONFIG['datadirectory'];" 2>/dev/null) # symlink data folder if [ "$(readlink /app/www/public/data)" != "${datadirectory}" ]; then @@ -118,6 +106,20 @@ lsiown abc:abc \ /app/www/public \ /data +# setup config +if ! occ config:system:get memcache.local; then + occ config:system:set memcache.local --value='\\OC\\Memcache\\APCu' +fi +if ! occ config:system:get memcache.distributed; then + occ config:system:set memcache.distributed --value='\\OC\\Memcache\\Memcached' +fi +if ! occ config:system:get datadirectory; then + occ config:system:set datadirectory --value='/data' +fi +if ! occ config:system:get apps_paths || ! occ config:system:get apps_paths | grep -q 'path: /app/www/public/apps' || ! occ config:system:get apps_paths | grep -q 'path: /app/www/public/custom_apps'; then + occ config:import < <(echo '{"system":{"apps_paths":[{"path":"\/app\/www\/public\/apps","url":"\/apps","writable":false},{"path":"\/app\/www\/public\/custom_apps","url":"\/custom_apps","writable":true}]}}') +fi + if (occ app:list --no-interaction | grep -q richdocumentscode) 2>/dev/null; then echo "Removing CODE Server" APP=$(occ app:list --no-interaction | grep richdocumentscode | awk -F ' ' '{print $2}' | tr -d ':')