From 04e3db14fde58855c42951385cc742be84f9d3c6 Mon Sep 17 00:00:00 2001 From: Eric Nemchik Date: Wed, 7 Jun 2023 10:47:51 -0500 Subject: [PATCH] Symlink apps rather than using custom_apps Signed-off-by: Eric Nemchik --- Dockerfile | 1 - Dockerfile.aarch64 | 1 - root/app/upgrade.exclude | 1 - root/defaults/config.php | 21 ------------------- .../s6-rc.d/init-nextcloud-config/run | 20 +++++++----------- 5 files changed, 7 insertions(+), 37 deletions(-) delete mode 100644 root/defaults/config.php diff --git a/Dockerfile b/Dockerfile index 7c16385..afded74 100644 --- a/Dockerfile +++ b/Dockerfile @@ -92,7 +92,6 @@ RUN \ /app/www/src --strip-components=1 && \ rm -rf /app/www/src/updater && \ mkdir -p /app/www/src/data && \ - mkdir -p /app/www/src/custom_apps && \ chmod +x /app/www/src/occ && \ echo "**** cleanup ****" && \ rm -rf \ diff --git a/Dockerfile.aarch64 b/Dockerfile.aarch64 index da2e55a..9ba79c1 100644 --- a/Dockerfile.aarch64 +++ b/Dockerfile.aarch64 @@ -92,7 +92,6 @@ RUN \ /app/www/src --strip-components=1 && \ rm -rf /app/www/src/updater && \ mkdir -p /app/www/src/data && \ - mkdir -p /app/www/src/custom_apps && \ chmod +x /app/www/src/occ && \ echo "**** cleanup ****" && \ rm -rf \ diff --git a/root/app/upgrade.exclude b/root/app/upgrade.exclude index 354864d..b5d2e1d 100644 --- a/root/app/upgrade.exclude +++ b/root/app/upgrade.exclude @@ -1,5 +1,4 @@ /config/ /data/ -/custom_apps/ /themes/ /version.php diff --git a/root/defaults/config.php b/root/defaults/config.php deleted file mode 100644 index 45ed83c..0000000 --- a/root/defaults/config.php +++ /dev/null @@ -1,21 +0,0 @@ - '\\OC\\Memcache\\APCu', - 'memcache.distributed' => '\\OC\\Memcache\\Memcached', - 'datadirectory' => '/data', - 'apps_paths' => - array ( - 0 => - array ( - 'path' => '/app/www/public/apps', - 'url' => '/apps', - 'writable' => false, - ), - 1 => - array ( - 'path' => '/app/www/public/custom_apps', - 'url' => '/custom_apps', - 'writable' => true, - ), - ), -); 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 372e36c..ce9097b 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 @@ -3,11 +3,11 @@ # create folders mkdir -p \ + /app/www/public/apps \ /app/www/public/config \ - /app/www/public/custom_apps \ /app/www/public/themes \ + /config/www/nextcloud/apps \ /config/www/nextcloud/config \ - /config/www/nextcloud/custom_apps \ /config/www/nextcloud/themes \ /data @@ -20,15 +20,15 @@ if [ -f /config/www/nextcloud/version.php ]; then find \ /config/www/nextcloud/ \ -type d -empty \ + ! -path "/config/www/nextcloud/apps" \ ! -path "/config/www/nextcloud/config" \ - ! -path "/config/www/nextcloud/custom_apps" \ ! -path "/config/www/nextcloud/themes" \ -delete touch /tmp/migration fi # symlink config folders -for dir in config custom_apps themes; do +for dir in apps config themes; do if [ "$(readlink /app/www/public/${dir})" != "/config/www/nextcloud/${dir}" ]; then rm -rf "/app/www/public/${dir}" ln -s "/config/www/nextcloud/${dir}" "/app/www/public/${dir}" @@ -70,7 +70,7 @@ if vergt "${image_version}" "${installed_version}" || [ -f /tmp/migration ]; the fi rsync -rlD --exclude-from=/app/upgrade.exclude /app/www/src/ /app/www/public/ - for dir in config data custom_apps themes; do + for dir in apps config data themes; do if [ -z "$(ls -A /app/www/public/${dir}/ 2>/dev/null)" ]; then rsync -rlD --include "/${dir}/*" --exclude '/*' /app/www/src/ /app/www/public/ fi @@ -103,13 +103,13 @@ rm -f /tmp/migration lsiown abc:abc \ /app/www/public \ + /app/www/public/apps \ /app/www/public/config \ - /app/www/public/custom_apps \ /app/www/public/data \ /app/www/public/themes \ /config/www/nextcloud \ + /config/www/nextcloud/apps \ /config/www/nextcloud/config \ - /config/www/nextcloud/custom_apps \ /config/www/nextcloud/themes \ /data @@ -121,12 +121,6 @@ if occ config:system:get installed >/dev/null 2>&1; then if ! occ config:system:get memcache.distributed >/dev/null 2>&1; then occ config:system:set memcache.distributed --value='\\OC\\Memcache\\Memcached' fi - if ! occ config:system:get datadirectory >/dev/null 2>&1; then - occ config:system:set datadirectory --value='/data' - fi - if ! occ config:system:get apps_paths >/dev/null 2>&1 || ! 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 fi if (occ app:list --no-interaction | grep -q richdocumentscode) 2>/dev/null; then