summaryrefslogtreecommitdiffstats
path: root/docker-entrypoint.sh
diff options
context:
space:
mode:
authorTilo Spannagel <development@tilosp.de>2017-08-10 14:53:11 +0200
committerTilo Spannagel <development@tilosp.de>2017-08-14 19:05:30 +0200
commit69b4a015ed7c21cd829f9747e0209fb80604e7b3 (patch)
tree0e04cecb2fe06a93aafd8c15e7b3198584e5ccb8 /docker-entrypoint.sh
parent7366057ce105d50df72df819193182cabfafa4e1 (diff)
Fix permissions when running as root
Diffstat (limited to 'docker-entrypoint.sh')
-rwxr-xr-xdocker-entrypoint.sh16
1 files changed, 4 insertions, 12 deletions
diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh
index 61242d41..9298bb47 100755
--- a/docker-entrypoint.sh
+++ b/docker-entrypoint.sh
@@ -35,26 +35,18 @@ if version_greater "$image_version" "$installed_version"; then
run_as 'php /var/www/html/occ app:list' > /tmp/list_before
fi
if [[ $EUID -eq 0 ]]; then
- rsync_options=-a
+ rsync_options="-rlDog --chown www-data:root"
else
- rsync_options=-rlD
+ rsync_options="-rlD"
fi
rsync $rsync_options --delete --exclude /config/ --exclude /data/ --exclude /custom_apps/ --exclude /themes/ /usr/src/nextcloud/ /var/www/html/
- for dir in config data themes; do
+ for dir in config data custom_apps themes; do
if [ ! -d /var/www/html/"$dir" ] || directory_empty /var/www/html/"$dir"; then
- cp -arT /usr/src/nextcloud/"$dir" /var/www/html/"$dir"
+ rsync $rsync_options --include /"$dir"/ --exclude '/*' /usr/src/nextcloud/ /var/www/html/
fi
done
- if [ ! -d /var/www/html/custom_apps ] && [ ! -f /var/www/html/config/apps.config.php ]; then
- cp -a /usr/src/nextcloud/config/apps.config.php /var/www/html/config/apps.config.php
- fi
-
- if [ ! -d /var/www/html/custom_apps ] || directory_empty /var/www/html/custom_apps; then
- cp -arT /usr/src/nextcloud/custom_apps /var/www/html/custom_apps
- fi
-
if [ "$installed_version" != "0.0.0~unknown" ]; then
run_as 'php /var/www/html/occ upgrade --no-app-disable'