From 7d94920c66d5a396001bd276dc9b01910274717f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sun, 1 Sep 2024 21:52:27 +0200 Subject: [PATCH] cleaning --- scripts/install | 6 ------ scripts/remove | 8 -------- scripts/restore | 8 -------- scripts/upgrade | 18 ++++-------------- 4 files changed, 4 insertions(+), 36 deletions(-) diff --git a/scripts/install b/scripts/install index fc54735..6ca2d02 100644 --- a/scripts/install +++ b/scripts/install @@ -48,20 +48,15 @@ ynh_nodejs_install #================================================= ynh_script_progression "Setting up source files..." -# Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$install_dir" -#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod -R o-rwx "$install_dir" -#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown -R $app:$app "$install_dir" #================================================= # SYSTEM CONFIGURATION #================================================= ynh_script_progression "Adding system configurations related to $app..." -# Create a dedicated NGINX config ynh_config_add_nginx -# Create a dedicated systemd config ynh_config_add_systemd yunohost service add $app --description="Zero Knowledge realtime collaborative editor" --log="/var/log/$app/$app.log" @@ -91,7 +86,6 @@ popd #================================================= ynh_script_progression "Starting $app's systemd service..." -# Start a systemd service ynh_systemctl --service=$app --action="start" --log_path="systemd" #================================================= diff --git a/scripts/remove b/scripts/remove index b03a288..3ac0b44 100644 --- a/scripts/remove +++ b/scripts/remove @@ -11,24 +11,16 @@ source /usr/share/yunohost/helpers #================================================= ynh_script_progression "Removing system configurations related to $app..." -# Remove the service from the list of services known by YunoHost (added from `yunohost service add`) if ynh_hide_warnings yunohost service status $app >/dev/null then ynh_script_progression "Removing $app service integration..." yunohost service remove $app fi -# Remove the dedicated systemd config ynh_config_remove_systemd -# Remove the dedicated NGINX config ynh_config_remove_nginx -#================================================= -# REMOVE DEPENDENCIES -#================================================= -ynh_script_progression "Removing dependencies..." - ynh_nodejs_remove #================================================= diff --git a/scripts/restore b/scripts/restore index 33e1540..9e7d616 100644 --- a/scripts/restore +++ b/scripts/restore @@ -1,6 +1,5 @@ #!/bin/bash -# Keep this path for calling _common.sh inside the execution's context of backup and restore scripts source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers @@ -11,10 +10,6 @@ ynh_script_progression "Restoring the app main directory..." ynh_restore "$install_dir" -#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod -R o-rwx "$install_dir" -#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown -R $app:$app "$install_dir" -#REMOVEME? Assuming the file is setup using ynh_config_add, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod 600 "$install_dir/config/config.js" - #================================================= # APPLY FOLDER GROUP RIGHTS FOR WWW-DATA #================================================= @@ -26,14 +21,11 @@ chgrp -R www-data $install_dir #================================================= ynh_script_progression "Reinstalling dependencies..." -# Define and install dependencies ynh_nodejs_install #================================================= # RESTORE SYSTEM CONFIGURATIONS #================================================= -# RESTORE THE PHP-FPM CONFIGURATION -#================================================= ynh_script_progression "Restoring system configurations related to $app..." ynh_restore "/etc/nginx/conf.d/$domain.d/$app.conf" diff --git a/scripts/upgrade b/scripts/upgrade index e3f1fc4..67bdc7b 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -63,16 +63,14 @@ fi #================================================= ynh_script_progression "Upgrading NGINX web server configuration..." -# Create a dedicated NGINX config ynh_config_add_nginx -#================================================= -# UPGRADE DEPENDENCIES -#================================================= -ynh_script_progression "Upgrading dependencies..." - ynh_nodejs_install +ynh_config_add_systemd + +yunohost service add $app --description="Zero Knowledge realtime collaborative editor" --log="/var/log/$app/$app.log" + #================================================= # INSTALL CRYPTPAD #================================================= @@ -86,14 +84,6 @@ pushd "$install_dir" ynh_hide_warnings npm run build popd -#================================================= -# CREATE SYSTEMD SERVICE -#================================================= - -ynh_config_add_systemd - -yunohost service add $app --description="Zero Knowledge realtime collaborative editor" --log="/var/log/$app/$app.log" - #================================================= # ADD UPGRADED CONFIG WITH SANDBOX #=================================================