From 2db9c7e93e55591cdc1d592f4177bc77a5d0ba67 Mon Sep 17 00:00:00 2001 From: JensDiemer Date: Sun, 10 Oct 2021 12:07:30 +0200 Subject: [PATCH] Fix file permissions closed #65 --- scripts/install | 8 ++++---- scripts/restore | 6 +++--- scripts/upgrade | 8 ++++---- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/scripts/install b/scripts/install index c30e5bd..364d932 100755 --- a/scripts/install +++ b/scripts/install @@ -105,7 +105,7 @@ ynh_script_progression --message="Install project via pip..." --weight=80 python3 -m venv "${final_path}/venv" cp ../conf/requirements.txt "$final_path/requirements.txt" -chown -R "$app" "$final_path" +chown -R "$app:" "$final_path" #run source in a 'sub shell' ( @@ -204,9 +204,9 @@ yunohost service add $app --description="Web based management to catalog things" #================================================= # Set permissions to app files -chown -R "$app" "$log_path" -chown -R "$app" "$public_path" -chown -R "$app" "$final_path" +chown -R "$app:" "$log_path" +chown -R "$app:" "$public_path" +chown -R "$app:" "$final_path" #================================================= # SETUP SYSTEMD diff --git a/scripts/restore b/scripts/restore index 63303ac..ffb0748 100755 --- a/scripts/restore +++ b/scripts/restore @@ -70,8 +70,8 @@ ynh_system_user_create --username=$app --home_dir="$final_path" --use_shell #================================================= # Restore permissions on app files -chown -R "$app" "$public_path" -chown -R "$app" "$final_path" +chown -R "$app:" "$public_path" +chown -R "$app:" "$final_path" #================================================= # SPECIFIC RESTORATION @@ -129,7 +129,7 @@ yunohost service add $app --description="Web based management to catalog things" mkdir -p "$log_path" touch "${log_file}" -chown -R "$app" "$log_path" +chown -R "$app:" "$log_path" ynh_restore_file --origin_path="/etc/logrotate.d/$app" #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index d9ef829..c86f71e 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -89,7 +89,7 @@ ynh_script_progression --message="Upgrade project via pip..." --weight=80 python3 -m venv --upgrade "${final_path}/venv" cp ../conf/requirements.txt "$final_path/requirements.txt" -chown -R "$app" "$final_path" +chown -R "$app:" "$final_path" #run source in a 'sub shell' ( @@ -196,9 +196,9 @@ yunohost service add $app --description="Web based management to catalog things" #================================================= # Set permissions to app files -chown -R "$app" "$log_path" -chown -R "$app" "$public_path" -chown -R "$app" "$final_path" +chown -R "$app:" "$log_path" +chown -R "$app:" "$public_path" +chown -R "$app:" "$final_path" #================================================= # Start pyinventory via systemd