diff --git a/docker-armhf/nextcloud/Dockerfile b/docker-armhf/nextcloud/Dockerfile index b923ea2bc..6e3b551ef 100644 --- a/docker-armhf/nextcloud/Dockerfile +++ b/docker-armhf/nextcloud/Dockerfile @@ -22,8 +22,8 @@ source /usr/local/etc/library.sh; \ set +x; \ install_app /nc-nextcloud.sh; \ run_app_unsafe /nc-nextcloud.sh; \ -mv /var/www/nextcloud /data-ro/app; \ -ln -s /data-ro/app /var/www/nextcloud; \ +mv /var/www/nextcloud /data-ro/nextcloud; \ +ln -s /data-ro/nextcloud /var/www/nextcloud; \ # stop mysqld mysqladmin -u root shutdown; \ @@ -46,7 +46,7 @@ COPY docker-common/nextcloud/020nextcloud /etc/services-enabled.d/ COPY bin/ncp-provisioning.sh /usr/local/bin/ # display message until first run initialization is complete -COPY docker-common/nextcloud/ncp-wait-msg.html /data-ro/app +COPY docker-common/nextcloud/ncp-wait-msg.html /data-ro/nextcloud RUN \ -mv /data-ro/app/index.php /; \ -mv /data-ro/app/ncp-wait-msg.html /data-ro/app/index.php; +mv /data-ro/nextcloud/index.php /; \ +mv /data-ro/nextcloud/ncp-wait-msg.html /data-ro/nextcloud/index.php; diff --git a/docker-common/nextcloud/020nextcloud b/docker-common/nextcloud/020nextcloud index ae1429af1..50160316e 100755 --- a/docker-common/nextcloud/020nextcloud +++ b/docker-common/nextcloud/020nextcloud @@ -18,7 +18,7 @@ set -e # we want to work in the volume version of the code rm /var/www/nextcloud -ln -s /data/app /var/www/nextcloud +ln -s /data/nextcloud /var/www/nextcloud echo "Starting Redis" sed -i 's|^requirepass .*|requirepass default|' /etc/redis/redis.conf @@ -33,7 +33,7 @@ echo "Starting Postfix" postfix start # INIT DATABASE AND NEXTCLOUD CONFIG (first run) -test -f /data/app/config/config.php || { +test -f /data/nextcloud/config/config.php || { echo "Uninitialized instance, running nc-init..." source /usr/local/etc/library.sh run_app_unsafe /nc-init.sh @@ -41,8 +41,8 @@ test -f /data/app/config/config.php || { } # Better do real provisioning at the end, as it can restart PHP asynchronously -sed -i "s|'password'.*|'password' => 'default',|" /data/app/config/config.php -sed -i "s|'dbpassword' =>.*|'dbpassword' => 'default',|" /data/app/config/config.php +sed -i "s|'password'.*|'password' => 'default',|" /data/nextcloud/config/config.php +sed -i "s|'dbpassword' =>.*|'dbpassword' => 'default',|" /data/nextcloud/config/config.php echo -e "[client]\npassword=default" > /root/.my.cnf chmod 600 /root/.my.cnf DBPASSWD=default @@ -69,6 +69,6 @@ echo "Provisioning" bash /usr/local/bin/ncp-provisioning.sh # Display NC logs in the docker logs -tail -f -n0 /data/app/data/nextcloud.log & +tail -f -n0 /data/nextcloud/data/nextcloud.log & exit 0 diff --git a/docker/nextcloud/Dockerfile b/docker/nextcloud/Dockerfile index 49f1675d4..688cba32f 100644 --- a/docker/nextcloud/Dockerfile +++ b/docker/nextcloud/Dockerfile @@ -22,8 +22,8 @@ source /usr/local/etc/library.sh; \ set +x; \ install_app /nc-nextcloud.sh; \ run_app_unsafe /nc-nextcloud.sh; \ -mv /var/www/nextcloud /data-ro/app; \ -ln -s /data-ro/app /var/www/nextcloud; \ +mv /var/www/nextcloud /data-ro/nextcloud; \ +ln -s /data-ro/nextcloud /var/www/nextcloud; \ # stop mysqld mysqladmin -u root shutdown; \ @@ -46,7 +46,7 @@ COPY docker-common/nextcloud/020nextcloud /etc/services-enabled.d/ COPY bin/ncp-provisioning.sh /usr/local/bin/ # display message until first run initialization is complete -COPY docker-common/nextcloud/ncp-wait-msg.html /data-ro/app +COPY docker-common/nextcloud/ncp-wait-msg.html /data-ro/nextcloud RUN \ -mv /data-ro/app/index.php /; \ -mv /data-ro/app/ncp-wait-msg.html /data-ro/app/index.php; +mv /data-ro/nextcloud/index.php /; \ +mv /data-ro/nextcloud/ncp-wait-msg.html /data-ro/nextcloud/index.php; diff --git a/update.sh b/update.sh index e817d8034..3722867ed 100755 --- a/update.sh +++ b/update.sh @@ -190,12 +190,18 @@ cp -r ncp-app /var/www/ # docker images only [[ -f /.docker-image ]] && { + + # fix dirs [[ -d /data/app ]] && { + ncc config:system:set datadirectory --value="/data/nextcloud/data" [[ -d /data/nextcloud ]] && mv /data/nextcloud /data/nextcloud-old mv /data/app /data/nextcloud && \ rm -f /var/www/nextcloud && \ ln -s /data/nextcloud /var/www/nextcloud } + + # re-enable automount + is_active_app nc-automount && run_app nc-automount : } @@ -245,9 +251,6 @@ cp -r ncp-app /var/www/ EOF - # re-enable automount - is_active_app nc-automount && run_app nc-automount - # update nc-backup install_app nc-backup install_app nc-restore