From 7f070f06941d84a93a7bd23f7bb87e20e6935d71 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 12:31:35 +0200 Subject: [PATCH] cleaning --- manifest.toml | 2 +- scripts/backup | 1 - scripts/change_url | 1 - scripts/install | 7 ++----- scripts/restore | 4 ---- scripts/upgrade | 11 ++--------- 6 files changed, 5 insertions(+), 21 deletions(-) diff --git a/manifest.toml b/manifest.toml index c425e56..3446e1b 100644 --- a/manifest.toml +++ b/manifest.toml @@ -17,7 +17,7 @@ userdoc = "https://hackmd.io/c/codimd-documentation/%2Fs%2Fcodimd-documentation# code = "https://github.com/hackmdio/codimd" [integration] -yunohost = ">= 11.2.18" +yunohost = ">= 11.2.29" helpers_version = "2.1" architectures = ["amd64"] multi_instance = false diff --git a/scripts/backup b/scripts/backup index 996041d..587b47d 100644 --- a/scripts/backup +++ b/scripts/backup @@ -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 diff --git a/scripts/change_url b/scripts/change_url index 25e73ed..c3bafcb 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -30,7 +30,6 @@ ynh_config_add --template="config.json.example" --destination="$install_dir/conf #================================================= ynh_script_progression "Starting $app's systemd service..." -# Start a systemd service ynh_systemctl --service=$app --action=start --log_path=systemd --wait_until="HTTP Server listening" #================================================= diff --git a/scripts/install b/scripts/install index 8d596b3..9e0c1c9 100644 --- a/scripts/install +++ b/scripts/install @@ -18,8 +18,6 @@ ynh_script_progression "Setting up source files..." 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:www-data "$install_dir" chmod +x $install_dir/app.js #================================================= @@ -41,7 +39,6 @@ ynh_script_progression "Updating configuration..." ynh_config_add --template="config.json.example" --destination="$install_dir/config.json" ynh_config_add --template=".sequelizerc.example" --destination="$install_dir/.sequelizerc" -#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.json chmod 600 $install_dir/.sequelizerc #================================================= @@ -53,8 +50,8 @@ ynh_script_progression "Building CodiMD... (this will take some time and resourc pushd $install_dir - ynh_hide_warnings ynh_exec_as_app node_load_PATH bin/setup - ynh_hide_warnings ynh_exec_as_app node_load_PATH npm run build + ynh_hide_warnings ynh_exec_as_app bin/setup + ynh_hide_warnings ynh_exec_as_app npm run build popd #================================================= diff --git a/scripts/restore b/scripts/restore index f5e6537..6164c9e 100644 --- a/scripts/restore +++ b/scripts/restore @@ -10,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:www-data "$install_dir" -#================================================= -# SPECIFIC RESTORATION #================================================= # REINSTALL DEPENDENCIES #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 02da334..7ae389b 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -15,17 +15,13 @@ ynh_systemctl --service=$app --action="stop" --log_path="systemd" #================================================= ynh_script_progression "Upgrading source files..." -# Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir=$install_dir --keep="config.json .sequelizerc" -#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:www-data "$install_dir" #================================================= # UPGRADE DEPENDENCIES #================================================= ynh_script_progression "Upgrading dependencies..." -# Install Nodejs ynh_nodejs_install #============================================== @@ -34,9 +30,8 @@ ynh_nodejs_install ynh_script_progression "Building CodiMD... (this will take some time and resources!)" pushd "$install_dir" - - ynh_hide_warnings ynh_exec_as_app node_load_PATH bin/setup - ynh_hide_warnings ynh_exec_as_app node_load_PATH npm run build + ynh_hide_warnings ynh_exec_as_app bin/setup + ynh_hide_warnings ynh_exec_as_app npm run build popd #================================================= @@ -44,10 +39,8 @@ popd #================================================= ynh_script_progression "Upgrading systemd configuration..." -# Create a dedicated NGINX config ynh_config_add_nginx -# Create a dedicated systemd config ynh_config_add_systemd yunohost service add $app --description="Collaborative Markdown notes" --log="/var/log/$app/$app.log"