diff --git a/conf/systemd.service b/conf/systemd.service index b499d7f..205089d 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -6,7 +6,7 @@ After=network.target [Service] Type=forking -User=www-data +User=__APP__ Restart=always RestartSec=10 WorkingDirectory=__FINALPATH__ diff --git a/scripts/install b/scripts/install index a240880..898531c 100644 --- a/scripts/install +++ b/scripts/install @@ -165,7 +165,7 @@ ynh_add_systemd_config ynh_script_progression --message="Securing files and directories..." # Set permissions to app files -chown -R www-data $final_path +chown -R $app $final_path #================================================= # SETUP LOGROTATE diff --git a/scripts/restore b/scripts/restore index ed8218b..896ccd4 100644 --- a/scripts/restore +++ b/scripts/restore @@ -74,7 +74,7 @@ ynh_system_user_create --username=$app ynh_script_progression --message="Restoring user rights..." # Restore permissions on app files -chown -R www-data $final_path +chown -R $app: $final_path #================================================= # SPECIFIC RESTORATION diff --git a/scripts/upgrade b/scripts/upgrade index b197681..8c246ad 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -218,7 +218,14 @@ ynh_add_systemd_config ynh_script_progression --message="Securing files and directories..." # Set permissions on app files -chown -R www-data $final_path +chown -R $app: $final_path + +#================================================= +# INTEGRATE SERVICE IN YUNOHOST +#================================================= +ynh_script_progression --message="Integrating service in YunoHost..." + +yunohost service add $app --log "/var/log/$app.log" --log "/var/www/$app/log/production.log" #================================================= # SETUP SSOWAT