diff options
author | Tilo Spannagel <development@tilosp.de> | 2017-08-10 14:53:11 +0200 |
---|---|---|
committer | Tilo Spannagel <development@tilosp.de> | 2017-08-14 19:05:30 +0200 |
commit | 69b4a015ed7c21cd829f9747e0209fb80604e7b3 (patch) | |
tree | 0e04cecb2fe06a93aafd8c15e7b3198584e5ccb8 | |
parent | 7366057ce105d50df72df819193182cabfafa4e1 (diff) |
Fix permissions when running as root
-rwxr-xr-x | 10.0/apache/docker-entrypoint.sh | 16 | ||||
-rwxr-xr-x | 10.0/fpm/docker-entrypoint.sh | 16 | ||||
-rwxr-xr-x | 11.0/apache/docker-entrypoint.sh | 16 | ||||
-rwxr-xr-x | 11.0/fpm/docker-entrypoint.sh | 16 | ||||
-rwxr-xr-x | 12.0/apache/docker-entrypoint.sh | 16 | ||||
-rwxr-xr-x | 12.0/fpm/docker-entrypoint.sh | 16 | ||||
-rwxr-xr-x | docker-entrypoint.sh | 16 |
7 files changed, 28 insertions, 84 deletions
diff --git a/10.0/apache/docker-entrypoint.sh b/10.0/apache/docker-entrypoint.sh index 61242d41..9298bb47 100755 --- a/10.0/apache/docker-entrypoint.sh +++ b/10.0/apache/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' diff --git a/10.0/fpm/docker-entrypoint.sh b/10.0/fpm/docker-entrypoint.sh index 61242d41..9298bb47 100755 --- a/10.0/fpm/docker-entrypoint.sh +++ b/10.0/fpm/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' diff --git a/11.0/apache/docker-entrypoint.sh b/11.0/apache/docker-entrypoint.sh index 61242d41..9298bb47 100755 --- a/11.0/apache/docker-entrypoint.sh +++ b/11.0/apache/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' diff --git a/11.0/fpm/docker-entrypoint.sh b/11.0/fpm/docker-entrypoint.sh index 61242d41..9298bb47 100755 --- a/11.0/fpm/docker-entrypoint.sh +++ b/11.0/fpm/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' diff --git a/12.0/apache/docker-entrypoint.sh b/12.0/apache/docker-entrypoint.sh index 61242d41..9298bb47 100755 --- a/12.0/apache/docker-entrypoint.sh +++ b/12.0/apache/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' diff --git a/12.0/fpm/docker-entrypoint.sh b/12.0/fpm/docker-entrypoint.sh index 61242d41..9298bb47 100755 --- a/12.0/fpm/docker-entrypoint.sh +++ b/12.0/fpm/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' 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' |