From a1a52fb17c1c3c1d589b992e0b0a67e08da8a884 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Thu, 30 Jul 2020 07:04:34 +0200 Subject: [PATCH] add logs --- conf/config.js | 1 + conf/systemd.service | 2 ++ scripts/backup | 1 - scripts/install | 4 +--- scripts/remove | 1 - scripts/restore | 9 --------- scripts/upgrade | 11 +---------- 7 files changed, 5 insertions(+), 24 deletions(-) diff --git a/conf/config.js b/conf/config.js index f474b39..ba29d25 100644 --- a/conf/config.js +++ b/conf/config.js @@ -1,6 +1,7 @@ { "host": "127.0.0.1", + "port": __PORT__, "keyLength": 10, diff --git a/conf/systemd.service b/conf/systemd.service index 88fa801..c8af1d9 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -9,6 +9,8 @@ Group=__APP__ WorkingDirectory=__FINALPATH__ Environment="PATH=__ENV_PATH__" ExecStart=__YNH_NPM__ start +StandardOutput=append:/var/log/__APP__/__APP__.log +StandardError=inherit Restart=always [Install] diff --git a/scripts/backup b/scripts/backup index daa9258..e75918d 100755 --- a/scripts/backup +++ b/scripts/backup @@ -52,7 +52,6 @@ ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" # BACKUP LOGROTATE #================================================= -# FIXME Currently, the log is only redirected to syslog. ynh_backup --src_path="/etc/logrotate.d/$app" #================================================= diff --git a/scripts/install b/scripts/install index 50e6a42..ab1fb44 100755 --- a/scripts/install +++ b/scripts/install @@ -193,9 +193,7 @@ ynh_script_progression --message="Configuring SSOwat..." --weight=1 if [ $is_public -eq 1 ] then - # Everyone can access the app. - # The "main" permission is automatically created before the install script. - ynh_permission_update --permission "main" --add "visitors" + ynh_permission_update --permission "main" --add "visitors" fi #================================================= diff --git a/scripts/remove b/scripts/remove index 4382e11..4897edc 100755 --- a/scripts/remove +++ b/scripts/remove @@ -61,7 +61,6 @@ ynh_remove_nginx_config #================================================= ynh_script_progression --message="Removing logrotate configuration..." --weight=1 -# FIXME Currently, the log is only redirected to syslog. ynh_remove_logrotate #================================================= diff --git a/scripts/restore b/scripts/restore index 91c63df..d408ca5 100755 --- a/scripts/restore +++ b/scripts/restore @@ -85,15 +85,6 @@ systemctl enable $app.service ynh_restore_file "/home/yunohost.app/$app" -#================================================= -# HANDLE LOG FILES AND RESTORE LOGROTATE -#================================================= - -# FIXME Currently, the log is only redirected to syslog. -# mkdir -p /var/log/$app -# touch /var/log/$app/$app.log -# chown $app -R /var/log/$app - #================================================= # SECURE FILES AND DIRECTORIES #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index f1cb9a6..cfd132d 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -94,7 +94,7 @@ fi #================================================= ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=2 -# Create a dedicated nginx config +# Create a dedicated NGINX config ynh_add_nginx_config #================================================= @@ -190,15 +190,6 @@ ynh_script_progression --message="Starting a systemd service..." --weight=1 ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" -#================================================= -# SETUP SSOWAT -#================================================= - -# if [ $is_public -eq 1 ]; -# then -# ynh_app_setting_set $app skipped_uris "/" -# fi - #================================================= # RELOAD NGINX #=================================================