diff --git a/scripts/install b/scripts/install index 43f78ee..0006f94 100755 --- a/scripts/install +++ b/scripts/install @@ -26,6 +26,7 @@ mv "$install_dir/httpsh/usr/local/bin/ttyd-login" "$install_dir/httpsh-ttyd-logi ynh_add_config --template="../conf/ttyd_httpsh.conf" --destination="$install_dir/ttyd_httpsh.conf" chown -R "$app:$app" "$install_dir" +chmod 750 "$install_dir" #================================================= # SYSTEM CONFIGURATION @@ -40,8 +41,9 @@ yunohost service add "$app" --description="httpsh on ttyd web terminal" --log="/ mkdir "/var/log/$app" touch "/var/log/$app/$app.log" + chown -R "$app:$app" "/var/log/$app" -chmod -R 750 "/var/log/$app" +chmod 750 "/var/log/$app" ynh_use_logrotate diff --git a/scripts/restore b/scripts/restore index 15bf90d..0626462 100755 --- a/scripts/restore +++ b/scripts/restore @@ -18,6 +18,7 @@ ynh_script_progression --message="Restoring the app main directory..." --weight= ynh_restore_file --origin_path="$install_dir" chown -R "$app:$app" "$install_dir" +chmod 750 "$install_dir" #================================================= # RESTORE SYSTEM CONFIGURATIONS @@ -33,8 +34,9 @@ yunohost service add "$app" --description="httpsh on ttyd web terminal" --log="/ mkdir "/var/log/$app" touch "/var/log/$app/$app.log" + chown -R "$app:$app" "/var/log/$app" -chmod -R 750 "/var/log/$app" +chmod 750 "/var/log/$app" ynh_restore_file --origin_path="/etc/logrotate.d/$app" diff --git a/scripts/upgrade b/scripts/upgrade index 48175d6..7c818ab 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -59,10 +59,8 @@ then ynh_setup_source --source_id=httpsh --dest_dir="$install_dir/httpsh" fi -# $install_dir will automatically be initialized with some decent -# permissions by default ... however, you may need to recursively reapply -# ownership to all files such as after the ynh_setup_source step -chown -R "$app:$app" "$install_dir" +chown -R "$app:$app" "/var/log/$app" +chmod 750 "/var/log/$app" #================================================= # REAPPLY SYSTEM CONFIGURATIONS @@ -91,7 +89,8 @@ mv "$install_dir/httpsh/usr/local/bin/ttyd-login" "$install_dir/httpsh" ynh_add_config --template="../conf/ttyd_httpsh.conf" --destination="$install_dir/ttyd_httpsh.conf" -chown -R "$app:$app" "$install_dir" +chown -R "$app:$app" "/var/log/$app" +chmod 750 "/var/log/$app" #================================================= # START SYSTEMD SERVICE