From 3dc9ab4937d385b16d1e1c03a554af9f95a74538 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Mon, 22 Mar 2021 23:00:59 +0100 Subject: [PATCH] Fix --- conf/systemd.service | 9 +++++++++ scripts/actions/reset_default_config | 2 +- scripts/change_url | 2 +- scripts/config | 2 +- scripts/install | 6 +++--- scripts/restore | 2 +- scripts/upgrade | 6 ++++-- 7 files changed, 20 insertions(+), 9 deletions(-) diff --git a/conf/systemd.service b/conf/systemd.service index 645f210..66cfd37 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -10,7 +10,16 @@ WorkingDirectory=__FINALPATH__ Environment=NODE_ENV=production Environment="__YNH_NODE_LOAD_PATH__" ExecStart=__FINALPATH__/src/bin/run.sh +StandardOutput=append:/var/log/__APP__/etherpad.log +StandardError=inherit Restart=always +PrivateDevices=true +ProtectControlGroups=true +ProtectHome=true +ProtectKernelTunables=true +ProtectSystem=full +RestrictSUIDSGID=true + [Install] WantedBy=multi-user.target diff --git a/scripts/actions/reset_default_config b/scripts/actions/reset_default_config index d1404e7..19936da 100755 --- a/scripts/actions/reset_default_config +++ b/scripts/actions/reset_default_config @@ -87,7 +87,7 @@ ynh_store_file_checksum --file="$config_file" ynh_script_progression --message="Restarting Etherpad..." --weight=9 # Wait for etherpad to be fully started -ynh_systemd_action --action=restart --line_match="You can access your Etherpad instance at" --log_path="systemd" --timeout="120" +ynh_systemd_action --action=restart --line_match="You can access your Etherpad instance at" --log_path="/var/log/$app/etherpad.log" --timeout="120" #================================================= # END OF SCRIPT diff --git a/scripts/change_url b/scripts/change_url index 172752c..b3954a7 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -130,7 +130,7 @@ ynh_systemd_action --action=reload --service_name=nginx ynh_script_progression --message="Restarting Etherpad..." --weight=10 # Wait for etherpad to be fully started -ynh_systemd_action --action=restart --line_match="You can access your Etherpad instance at" --log_path="systemd" --timeout="120" +ynh_systemd_action --action=restart --line_match="You can access your Etherpad instance at" --log_path="/var/log/$app/etherpad.log" --timeout="120" #================================================= # DEACTIVE MAINTENANCE MODE diff --git a/scripts/config b/scripts/config index 4d7a27d..a231fe9 100644 --- a/scripts/config +++ b/scripts/config @@ -290,7 +290,7 @@ apply_config() { if [ $restart_etherpad -eq 1 ] then # Wait for etherpad to be fully started - ynh_systemd_action --action=restart --line_match="You can access your Etherpad instance at" --log_path="systemd" --timeout="120" + ynh_systemd_action --action=restart --line_match="You can access your Etherpad instance at" --log_path="/var/log/$app/etherpad.log" --timeout="120" fi #================================================= diff --git a/scripts/install b/scripts/install index c41ae94..a87f067 100644 --- a/scripts/install +++ b/scripts/install @@ -222,7 +222,7 @@ ynh_add_systemd_config --others_var="ynh_node_load_PATH" # ADVERTISE SERVICE IN ADMIN PANEL #================================================= -yunohost service add $app --description="Collaborative editor" --log="/var/log/$app/etherpad.log" +yunohost service add $app --description="Collaborative editor" --log="/var/log/$app/etherpad.log" #================================================= # INSTALL FRAMAPAD'S PLUGINS @@ -315,7 +315,7 @@ ynh_systemd_action --action=reload --service_name=nginx ynh_script_progression --message="Restarting Etherpad..." --weight=20 # Wait for etherpad to be fully started -ynh_systemd_action --action=restart --line_match="You can access your Etherpad instance at" --log_path="systemd" --timeout="120" +ynh_systemd_action --action=restart --line_match="You can access your Etherpad instance at" --log_path="/var/log/$app/etherpad.log" --timeout="120" if [ $mypads -eq 1 ] then @@ -323,7 +323,7 @@ then mysql -u $db_name -p$db_pwd $db_name < "../conf/lang_mypads.sql" # Wait for etherpad to be fully started - ynh_systemd_action --action=restart --line_match="You can access your Etherpad instance at" --log_path="systemd" --timeout="120" + ynh_systemd_action --action=restart --line_match="You can access your Etherpad instance at" --log_path="/var/log/$app/etherpad.log" --timeout="120" fi #================================================= diff --git a/scripts/restore b/scripts/restore index 266deaf..7ea3d2f 100644 --- a/scripts/restore +++ b/scripts/restore @@ -173,7 +173,7 @@ ynh_systemd_action --action=reload --service_name=nginx ynh_script_progression --message="Restarting Etherpad..." --weight=8 # Wait for etherpad to be fully started -ynh_systemd_action --action=restart --line_match="You can access your Etherpad instance at" --log_path="systemd" --timeout="120" +ynh_systemd_action --action=restart --line_match="You can access your Etherpad instance at" --log_path="/var/log/$app/etherpad.log" --timeout="120" #================================================= # DEACTIVE MAINTENANCE MODE diff --git a/scripts/upgrade b/scripts/upgrade index af77c10..d04b8b8 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -49,7 +49,7 @@ pad_config_show_markdown=$(ynh_app_setting_get --app=$app --key=pad_config_show_ #================================================= # Wait for etherpad to be fully started -ynh_systemd_action --action=restart --line_match="You can access your Etherpad instance at" --log_path="systemd" --timeout="120" +ynh_systemd_action --action=restart --line_match="You can access your Etherpad instance at" --log_path="/var/log/$app/etherpad.log" --timeout="120" upgrade_type=$(ynh_check_app_version_changed) @@ -188,6 +188,8 @@ if [ "$upgrade_type" == "UPGRADE_APP" ] then ynh_script_progression --message="Upgrading source files..." --weight=4 + ynh_secure_remove --file="$final_path" + # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$final_path" fi @@ -394,7 +396,7 @@ ynh_systemd_action --action=reload --service_name=nginx ynh_script_progression --message="Restarting Etherpad..." --weight=9 # Wait for etherpad to be fully started -ynh_systemd_action --action=restart --line_match="You can access your Etherpad instance at" --log_path="systemd" --timeout="120" +ynh_systemd_action --action=restart --line_match="You can access your Etherpad instance at" --log_path="/var/log/$app/etherpad.log" --timeout="120" #================================================= # DEACTIVE MAINTENANCE MODE