Bugfix file permissions in install/upgrade/restore

This commit is contained in:
JensDiemer 2022-04-15 16:39:12 +02:00
parent a07e23020b
commit 33bad5cb9f
3 changed files with 26 additions and 3 deletions

View file

@ -217,9 +217,13 @@ yunohost service add $app --description="Web based management to catalog things"
# Set permissions to app files # Set permissions to app files
chown -R "$app:" "$log_path" chown -R "$app:" "$log_path"
chown -R "$app:" "$public_path" chown -R "$app:www-data" "$public_path"
chown -R "$app:" "$final_path" chown -R "$app:" "$final_path"
chmod o-rwx "$log_path"
chmod o-rwx "$public_path"
chmod o-rwx "$final_path"
#================================================= #=================================================
# SETUP SYSTEMD # SETUP SYSTEMD
#================================================= #=================================================

View file

@ -70,7 +70,7 @@ ynh_system_user_create --username=$app --home_dir="$final_path" --use_shell
#================================================= #=================================================
# Restore permissions on app files # Restore permissions on app files
chown -R "$app:" "$public_path" chown -R "$app:www-data" "$public_path"
chown -R "$app:" "$final_path" chown -R "$app:" "$final_path"
#================================================= #=================================================
@ -144,6 +144,21 @@ touch "${log_file}"
chown -R "$app:" "$log_path" chown -R "$app:" "$log_path"
ynh_restore_file --origin_path="/etc/logrotate.d/$app" ynh_restore_file --origin_path="/etc/logrotate.d/$app"
#=================================================
# GENERIC FINALIZATION
#=================================================
# SECURE FILES AND DIRECTORIES
#=================================================
# Set permissions to app files
chown -R "$app:" "$log_path"
chown -R "$app:www-data" "$public_path"
chown -R "$app:" "$final_path"
chmod o-rwx "$log_path"
chmod o-rwx "$public_path"
chmod o-rwx "$final_path"
#================================================= #=================================================
# GENERIC FINALIZATION # GENERIC FINALIZATION
#================================================= #=================================================

View file

@ -212,9 +212,13 @@ yunohost service add $app --description="Web based management to catalog things"
# Set permissions to app files # Set permissions to app files
chown -R "$app:" "$log_path" chown -R "$app:" "$log_path"
chown -R "$app:" "$public_path" chown -R "$app:www-data" "$public_path"
chown -R "$app:" "$final_path" chown -R "$app:" "$final_path"
chmod o-rwx "$log_path"
chmod o-rwx "$public_path"
chmod o-rwx "$final_path"
#================================================= #=================================================
# Start for_runners via systemd # Start for_runners via systemd
#================================================= #=================================================