diff --git a/scripts/install b/scripts/install index 39e183c..c2acfad 100644 --- a/scripts/install +++ b/scripts/install @@ -30,13 +30,18 @@ chown -R $app:www-data "$install_dir" chmod +x $install_dir/bin/runSafe.sh #================================================= -# NGINX CONFIGURATION +# SYSTEM CONFIGURATION #================================================= -ynh_script_progression --message="Configuring NGINX web server..." --weight=2 +ynh_script_progression --message="Adding system configurations related to $app..." --weight=1 # Create a dedicated NGINX config ynh_add_nginx_config +env_path="$PATH" +ynh_add_systemd_config + +yunohost service add $app --description "Collaborative spreadsheet editor" --log="/var/log/$app/$app.log" + #================================================= # INSTALL ETHERCALC #================================================= @@ -48,21 +53,6 @@ pushd "$install_dir" ynh_exec_warn_less npm i zappajs popd -#================================================= -# SETUP SYSTEMD BASED SERVICES -#================================================= -ynh_script_progression --message="Configuring a systemd service..." --weight=1 - -env_path="$PATH" -ynh_add_systemd_config - -#================================================= -# ADVERTISE SERVICE IN ADMIN PANEL -#================================================= -ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 - -yunohost service add $app --description "Collaborative spreadsheet editor" --log="/var/log/$app/$app.log" - #================================================= # START SYSTEMD SERVICE #================================================= diff --git a/scripts/remove b/scripts/remove index 73f1477..ee3f6f6 100644 --- a/scripts/remove +++ b/scripts/remove @@ -10,10 +10,11 @@ source _common.sh source /usr/share/yunohost/helpers #================================================= -# STANDARD REMOVE +# REMOVE SYSTEM CONFIGURATIONS #================================================= -# REMOVE SERVICE INTEGRATION IN YUNOHOST +# REMOVE SYSTEMD SERVICE #================================================= +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 @@ -22,27 +23,12 @@ then yunohost service remove $app fi -#================================================= -# STOP AND REMOVE SERVICE -#================================================= -ynh_script_progression --message="Stopping and removing the systemd service..." --weight=1 - # Remove the dedicated systemd config ynh_remove_systemd_config -#================================================= -# REMOVE DEPENDENCIES -#================================================= -#REMOVEME? ynh_script_progression --message="Removing dependencies..." --weight=2 - # Remove metapackage and its dependencies ynh_remove_nodejs -#================================================= -# REMOVE NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Removing NGINX web server configuration..." --weight=1 - # Remove the dedicated NGINX config ynh_remove_nginx_config diff --git a/scripts/restore b/scripts/restore index 42a4151..2208cab 100644 --- a/scripts/restore +++ b/scripts/restore @@ -9,14 +9,6 @@ source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers -#================================================= -# STANDARD RESTORATION STEPS -#================================================= -# RESTORE THE NGINX CONFIGURATION -#================================================= - -ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" - #================================================= # RESTORE THE APP MAIN DIR #================================================= @@ -39,18 +31,17 @@ ynh_script_progression --message="Reinstalling dependencies..." --weight=1 ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version #================================================= -# RESTORE SYSTEMD +# RESTORE SYSTEM CONFIGURATIONS #================================================= -ynh_script_progression --message="Restoring the systemd configuration..." --weight=1 +# RESTORE THE PHP-FPM CONFIGURATION +#================================================= +ynh_script_progression --message="Restoring system configurations related to $app..." --weight=1 + +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 -#================================================= -# INTEGRATE SERVICE IN YUNOHOST -#================================================= -ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 - yunohost service add $app --description "Collaborative spreadsheet editor" --log="/var/log/$app/$app.log" #================================================= @@ -60,13 +51,6 @@ ynh_script_progression --message="Starting a systemd service..." --weight=1 ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" -#================================================= -# GENERIC FINALIZATION -#================================================= -# RELOAD NGINX AND PHP-FPM -#================================================= -ynh_script_progression --message="Reloading NGINX web server..." --weight=1 - ynh_systemd_action --service_name=nginx --action=reload #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index ba591d7..fe29ad4 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -41,20 +41,23 @@ chown -R $app:www-data "$install_dir" chmod +x $install_dir/bin/runSafe.sh #================================================= -# NGINX CONFIGURATION +# RECONFIGURE THE APP (UPDATE CONF, APPLY MIGRATIONS...) #================================================= -ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=1 +# UPDATE A CONFIG FILE +#================================================= +ynh_script_progression --message="Updating a configuration file..." --weight=1 + +# Install Nodejs +ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version # Create a dedicated nginx config ynh_add_nginx_config -#================================================= -# UPGRADE DEPENDENCIES -#================================================= -#REMOVEME? ynh_script_progression --message="Upgrading dependencies..." --weight=6 +env_path="$PATH" +# Create a dedicated systemd config +ynh_add_systemd_config -# Install Nodejs -ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version +yunohost service add $app --description "Collaborative spreadsheet editor" --log="/var/log/$app/$app.log" #================================================= # INSTALL ETHERCALC @@ -67,22 +70,6 @@ pushd "$install_dir" ynh_exec_warn_less npm i zappajs popd -#================================================= -# SETUP SYSTEMD -#================================================= -ynh_script_progression --message="Upgrading systemd configuration..." --weight=1 - -env_path="$PATH" -# Create a dedicated systemd config -ynh_add_systemd_config - -#================================================= -# INTEGRATE SERVICE IN YUNOHOST -#================================================= -ynh_script_progression --message="Integrating service in YunoHost..." --weight=2 - -yunohost service add $app --description "Collaborative spreadsheet editor" --log="/var/log/$app/$app.log" - #================================================= # START SYSTEMD SERVICE #=================================================