From 8384717fae29b8576b39d27447bda18292760c31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Thu, 14 Sep 2023 14:19:44 +0200 Subject: [PATCH] cleaning --- manifest.toml | 8 ++++---- scripts/_common.sh | 2 +- scripts/install | 22 +++++----------------- scripts/remove | 22 +--------------------- scripts/restore | 18 ++++-------------- scripts/upgrade | 22 +++++----------------- 6 files changed, 20 insertions(+), 74 deletions(-) diff --git a/manifest.toml b/manifest.toml index 5896d40..41292c0 100644 --- a/manifest.toml +++ b/manifest.toml @@ -43,10 +43,10 @@ ram.runtime = "50M" [resources] [resources.sources.main] - arm64.url = "https://github.com/wekan/wekan/releases/download/v6.97/wekan-6.97-arm64.zip" - arm64.sha256 = "3c60fadf67cee852da3e453f32e9548b5ba4f9bd2bdba7e4f60a9f3c4998b08a" - amd64.url = "https://github.com/wekan/wekan/releases/download/v6.97/wekan-6.97-amd64.zip" - amd64.sha256 = "b2637a2a1545a35ac622651aa9d58b58f295ada66cfe9863602aafbfcac90dcc" + arm64.url = "https://github.com/wekan/wekan/releases/download/v7.09/wekan-7.09-arm64.zip" + arm64.sha256 = "0ef14b07dd7fdb635b0350094f3df57aeb6d082e4525fe087e097c4f8cfbf238" + amd64.url = "https://github.com/wekan/wekan/releases/download/v7.09/wekan-7.09-amd64.zip" + amd64.sha256 = "7f9956c878bab40c99d5a7bebdeb1a7fa7d0016098cd47f0946bfde7d997ae7d" autoupdate.strategy = "latest_github_release" autoupdate.asset.amd64 = "*-amd64.zip" autoupdate.asset.arm64 = "*-arm64.zip" diff --git a/scripts/_common.sh b/scripts/_common.sh index c862664..ce74726 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -16,7 +16,7 @@ mongo_version=6.0 #================================================= readonly YNH_DEFAULT_MONGO_VERSION=4.4 -# Declare the actual MongoDB version to use: 4.4 ; 5.0 +# Declare the actual MongoDB version to use: 4.4; 5.0; 6.0 # A packager willing to use another version of MongoDB can override the variable into its _common.sh. YNH_MONGO_VERSION=${YNH_MONGO_VERSION:-$YNH_DEFAULT_MONGO_VERSION} diff --git a/scripts/install b/scripts/install index 6020072..16b2ec0 100644 --- a/scripts/install +++ b/scripts/install @@ -47,6 +47,11 @@ ynh_script_progression --message="Configuring NGINX web server..." # Create a dedicated NGINX config ynh_add_nginx_config +# Create a dedicated systemd config +ynh_add_systemd_config + +yunohost service add $app --description="Wekan daemon" --log="/var/log/$app/$app.log" + #================================================= # SPECIFIC SETUP #================================================= @@ -61,23 +66,6 @@ ynh_add_config --template=".env" --destination="$install_dir/.env" chmod 400 "$install_dir/.env" chown $app:$app "$install_dir/.env" -#================================================= -# SETUP SYSTEMD -#================================================= -ynh_script_progression --message="Configuring a systemd service..." - -# Create a dedicated systemd config -ynh_add_systemd_config - -#================================================= -# GENERIC FINALIZATION -#================================================= -# INTEGRATE SERVICE IN YUNOHOST -#================================================= -ynh_script_progression --message="Integrating service in YunoHost..." - -yunohost service add $app --description="Wekan daemon" - #================================================= # START SYSTEMD SERVICE #================================================= diff --git a/scripts/remove b/scripts/remove index 9b4df5a..8a5c2cd 100755 --- a/scripts/remove +++ b/scripts/remove @@ -30,38 +30,18 @@ then yunohost service remove $app fi -#================================================= -# STOP AND REMOVE SERVICE -#================================================= -ynh_script_progression --message="Stopping and removing the systemd service..." - # Remove the dedicated systemd config ynh_remove_systemd_config -#================================================= -# REMOVE THE MONGODB DATABASE -#================================================= -ynh_script_progression --message="Removing the MongoDB database..." - # Remove a database if it exists, along with the associated user ynh_mongo_remove_db --db_user=$db_user --db_name=$db_name - -#================================================= -# REMOVE NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Removing NGINX web server configuration..." +ynh_remove_mongo # Remove the dedicated NGINX config ynh_remove_nginx_config -#================================================= -# REMOVE DEPENDENCIES -#================================================= -#REMOVEME? ynh_script_progression --message="Removing dependencies..." - # Remove metapackage and its dependencies ynh_remove_nodejs -ynh_remove_mongo #================================================= # END OF SCRIPT diff --git a/scripts/restore b/scripts/restore index 81efeb8..24ea87e 100644 --- a/scripts/restore +++ b/scripts/restore @@ -32,13 +32,6 @@ ynh_install_nodejs --nodejs_version=$nodejs_version ynh_use_nodejs ynh_install_mongo --mongo_version=$mongo_version -#================================================= -# RESTORE THE NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Restoring the NGINX web server configuration..." - -ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" - #================================================= # RESTORE THE MONGODB DATABASE #================================================= @@ -47,18 +40,15 @@ ynh_script_progression --message="Restoring the MongoDB database..." ynh_mongo_restore_db --database="$db_name" < ./dump.bson #================================================= -# RESTORE SYSTEMD +# RESTORE THE NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Restoring the systemd configuration..." +ynh_script_progression --message="Restoring the NGINX web server configuration..." + +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..." - yunohost service add $app --description="Wekan daemon" #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index a09b9db..fb95938 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -70,6 +70,11 @@ ynh_script_progression --message="Upgrading NGINX web server configuration..." # Create a dedicated NGINX config ynh_add_nginx_config +# Create a dedicated systemd config +ynh_add_systemd_config + +yunohost service add $app --description="Wekan daemon" --log="/var/log/$app/$app.log" + #================================================= # SPECIFIC UPGRADE #================================================= @@ -84,23 +89,6 @@ ynh_add_config --template=".env" --destination="$install_dir/.env" chmod 400 "$install_dir/.env" chown $app:$app "$install_dir/.env" -#================================================= -# SETUP SYSTEMD -#================================================= -ynh_script_progression --message="Upgrading systemd configuration..." - -# Create a dedicated systemd config -ynh_add_systemd_config - -#================================================= -# GENERIC FINALIZATION -#================================================= -# INTEGRATE SERVICE IN YUNOHOST -#================================================= -ynh_script_progression --message="Integrating service in YunoHost..." - -yunohost service add $app --description="Wekan daemon" - #================================================= # START SYSTEMD SERVICE #=================================================