From 1b164f792a1a411096576808698450e0b302b3e1 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 13 Jan 2024 13:58:15 +0100 Subject: [PATCH] cleaning --- doc/ADMIN.md | 2 +- doc/ADMIN_fr.md | 2 +- scripts/change_url | 4 ++-- scripts/install | 5 +++-- scripts/remove | 11 +---------- scripts/restore | 1 + scripts/upgrade | 5 ++--- 7 files changed, 11 insertions(+), 19 deletions(-) diff --git a/doc/ADMIN.md b/doc/ADMIN.md index b976e27..2a397d2 100644 --- a/doc/ADMIN.md +++ b/doc/ADMIN.md @@ -1,5 +1,5 @@ -Various configuration options are available for Mumble web on this configuration file `/var/www/mumble-web/dist/config.local.js` +Various configuration options are available for Mumble web on this configuration file `__INSTALL_DIR__/dist/config.local.js` Here are online documentations: - Murmur documentation: diff --git a/doc/ADMIN_fr.md b/doc/ADMIN_fr.md index 3876a7a..5b1b82e 100644 --- a/doc/ADMIN_fr.md +++ b/doc/ADMIN_fr.md @@ -1,4 +1,4 @@ -Diverses options de configuration sont disponibles pour *Mumble web* sur ce fichier de configuration `/var/www/mumble-web/dist/config.local.js` +Diverses options de configuration sont disponibles pour *Mumble web* sur ce fichier de configuration `__INSTALL_DIR__/dist/config.local.js` Voici de la documentation en ligne : - Documentation Murmur : diff --git a/scripts/change_url b/scripts/change_url index 92a36c7..d50b2a4 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -16,7 +16,7 @@ source /usr/share/yunohost/helpers #================================================= ynh_script_progression --message="Stopping a systemd service..." --weight=1 -ynh_systemd_action --service_name="$app" --action="stop" --log_path="/var/log/$app/$app.log" +ynh_systemd_action --service_name="$app" --action="stop" --log_path="systemd" #================================================= # MODIFY URL IN NGINX CONF @@ -30,7 +30,7 @@ ynh_change_url_nginx_config #================================================= 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" +ynh_systemd_action --service_name="$app" --action="start" --log_path="systemd" #================================================= # END OF SCRIPT diff --git a/scripts/install b/scripts/install index c7ad9b0..d61cf82 100644 --- a/scripts/install +++ b/scripts/install @@ -20,7 +20,6 @@ yunohost app list | grep -q "id: mumbleserver" || ynh_die "mumble-server is need ynh_script_progression --message="Installing NodeJS..." --weight=4 ynh_install_nodejs --nodejs_version="$nodejs_version" -ynh_use_nodejs #================================================= # INSTALL Mumble-web @@ -39,6 +38,7 @@ chown -R "$app:www-data" "$install_dir" ynh_script_progression --message="Building Mumble web client..." --weight=1 pushd "$install_dir" + ynh_use_nodejs ynh_exec_warn_less ynh_exec_as "$app" "$ynh_node_load_PATH" "$ynh_npm" install --save --loglevel warn ynh_exec_warn_less ynh_exec_as "$app" "$ynh_node_load_PATH" "$ynh_npm" run build popd @@ -48,7 +48,7 @@ popd #================================================= ynh_script_progression --message="Adding a configuration file..." --weight=1 -ynh_add_config --template="../conf/config.local.js" --destination="$install_dir/dist/config.local.js" +ynh_add_config --template="config.local.js" --destination="$install_dir/dist/config.local.js" chmod 400 "$install_dir/dist/config.local.js" chown "$app" "$install_dir/dist/config.local.js" @@ -62,6 +62,7 @@ ynh_add_nginx_config # Create a dedicated systemd config ynh_add_systemd_config + yunohost service add "$app" --description="Mumble web client" --log="/var/log/$app/$app.log" #================================================= diff --git a/scripts/remove b/scripts/remove index fcd2a65..5367c1a 100644 --- a/scripts/remove +++ b/scripts/remove @@ -14,6 +14,7 @@ source /usr/share/yunohost/helpers #================================================= # REMOVE SERVICE FROM ADMIN PANEL #================================================= +ynh_script_progression --message="Removing system configurations related to $app..." --weight=1 # Remove the service from the list of services known by YunoHost (added from `yunohost service add`) if ynh_exec_warn_less yunohost service status $app >/dev/null; then @@ -21,22 +22,12 @@ if ynh_exec_warn_less yunohost service status $app >/dev/null; then yunohost service remove $app fi -#================================================= -# REMOVE SYSTEM CONFIGURATIONS -#================================================= -ynh_script_progression --message="Removing system configurations related to $app..." --weight=1 - # Remove the dedicated systemd config ynh_remove_systemd_config # Remove the dedicated nginx config ynh_remove_nginx_config -#================================================= -# REMOVE DEPENDENCIES -#================================================= -ynh_script_progression --message="Removing NodeJS..." --weight=1 - # Remove NodeJS ynh_remove_nodejs diff --git a/scripts/restore b/scripts/restore index ad15703..9a6cd1d 100644 --- a/scripts/restore +++ b/scripts/restore @@ -35,6 +35,7 @@ ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" ynh_restore_file --origin_path="/etc/systemd/system/$app.service" systemctl enable "$app.service" --quiet + yunohost service add "$app" --description="Mumble web client" --log="/var/log/$app/$app.log" #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 70b6e8c..a290c41 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -14,7 +14,7 @@ source /usr/share/yunohost/helpers #================================================= ynh_script_progression --message="Stopping a systemd service..." --weight=1 -ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/$app.log" +ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd" #================================================= # INSTALL DEPENDENCIES @@ -45,8 +45,6 @@ pushd "$install_dir" ynh_exec_warn_less ynh_exec_as "$app" "$ynh_node_load_PATH" "$ynh_npm" run build popd -# FIXME: add a configuration file again? - #================================================= # REAPPLY SYSTEM CONFIGURATIONS #================================================= @@ -57,6 +55,7 @@ ynh_add_nginx_config # Create a dedicated systemd config ynh_add_systemd_config + yunohost service add "$app" --description="Mumble web client" --log="/var/log/$app/$app.log" #=================================================