From bd2bbb961bdf1a05a076e78ccc17717960b2cd0b Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 7 May 2021 13:34:47 +0200 Subject: [PATCH 1/2] permissions --- scripts/install | 3 ++- scripts/upgrade | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index 492187c..b367332 100644 --- a/scripts/install +++ b/scripts/install @@ -173,7 +173,8 @@ ynh_use_logrotate --logfile=$final_path/app/data/_data_/_default_/logs/fail2ban/ # Set permissions to app files find $final_path/. -type d -exec chmod 755 {} \; find $final_path/. -type f -exec chmod 644 {} \; -chown -R $app: $final_path +chmod -R o-rwx $final_path +chown -R $app:www-data $final_path #================================================= # SETUP FAIL2BAN diff --git a/scripts/upgrade b/scripts/upgrade index 26e3e1e..fb56e25 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -168,7 +168,8 @@ ynh_use_logrotate --logfile=$final_path/app/data/_data_/_default_/logs/fail2ban/ #================================================= # Set permissions on app files -chown -R $app: $final_path +chmod -R o-rwx $final_path +chown -R $app:www-data $final_path find $final_path/. -type d -exec chmod 755 {} \; find $final_path/. -type f -exec chmod 644 {} \; From ca1d6e7b5689e338fcf5701fbc68817ee4b23f2d Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 7 May 2021 14:08:24 +0200 Subject: [PATCH 2/2] fix --- scripts/remove | 8 ++++---- scripts/restore | 3 ++- scripts/upgrade | 4 ++-- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/scripts/remove b/scripts/remove index b3b3237..1bd247c 100644 --- a/scripts/remove +++ b/scripts/remove @@ -41,7 +41,7 @@ ynh_remove_app_dependencies #================================================= # REMOVE APP MAIN DIR #================================================= -ynh_script_progression --message="Removing the app main directory..." +ynh_script_progression --message="Removing the app main directory..." --weight=1 # Remove the app directory securely ynh_secure_remove --file="$final_path" @@ -49,7 +49,7 @@ ynh_secure_remove --file="$final_path" #================================================= # REMOVE NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Removing NGINX web server configuration..." +ynh_script_progression --message="Removing NGINX web server configuration..." --weight=1 # Remove the dedicated NGING config ynh_remove_nginx_config @@ -65,7 +65,7 @@ ynh_remove_fpm_config #================================================= # REMOVE LOGROTATE CONFIGURATION #================================================= -ynh_script_progression --message="Removing logrotate configuration..." +ynh_script_progression --message="Removing logrotate configuration..." --weight=1 # Remove the app-specific logrotate config ynh_remove_logrotate @@ -83,7 +83,7 @@ ynh_remove_fail2ban_config #================================================= # REMOVE GPG KEY #================================================= -ynh_script_progression --message="Removing GPG key" +ynh_script_progression --message="Removing GPG key" --weight=1 gpg --batch --delete-key --yes Rainloop diff --git a/scripts/restore b/scripts/restore index beb2a80..290b2ce 100644 --- a/scripts/restore +++ b/scripts/restore @@ -76,7 +76,8 @@ ynh_system_user_create --username=$app #================================================= # Restore permissions on app files -chown -R $app: $final_path +chmod -R o-rwx $final_path +chown -R $app:www-data $final_path #================================================= # RESTORE THE PHP-FPM CONFIGURATION diff --git a/scripts/upgrade b/scripts/upgrade index fb56e25..b670943 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -31,7 +31,7 @@ upgrade_type=$(ynh_check_app_version_changed) #================================================= # ENSURE DOWNWARD COMPATIBILITY #================================================= -ynh_script_progression --message="Ensuring downward compatibility..." +ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 # If db_name doesn't exist, create it if [ -z "$db_name" ]; then @@ -136,7 +136,7 @@ ynh_add_fpm_config #================================================= # UPDATE SSO AND PGP #================================================= -ynh_script_progression --message="Upgrading Rainloop configuration..." +ynh_script_progression --message="Upgrading Rainloop configuration..." --weight=2 # Upgrade time_offset value for fail2ban # FIXME Temporary fix for rainloop, waiting for https://github.com/YunoHost/yunohost/pull/752 to be released.