From 526e19a378be797fb4a3fd696f75d7804a396fc3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 10 Nov 2023 14:11:04 +0100 Subject: [PATCH] cleaning --- scripts/restore | 5 ----- scripts/upgrade | 60 ++++--------------------------------------------- 2 files changed, 4 insertions(+), 61 deletions(-) diff --git a/scripts/restore b/scripts/restore index 7e0f696..e9cfb0f 100755 --- a/scripts/restore +++ b/scripts/restore @@ -61,14 +61,9 @@ couchdb couchdb/adminpass_again password ${COUCHDB_PASSWORD} couchdb couchdb/adminpass_again seen true" | debconf-set-selections DEBIAN_FRONTEND=noninteractive # apt-get install -y --force-yes couchdb -chmod 750 "$install_dir" chmod -R o-rwx "$install_dir" chown -R $app:$app "$install_dir" -chmod 750 "$data_dir" -chmod -R o-rwx "$data_dir" -chown -R $app:www-data "$data_dir" - #================================================= # GENERIC FINALIZATION #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 2a0ca7c..e1e8b39 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -9,55 +9,12 @@ source _common.sh source /usr/share/yunohost/helpers -#================================================= -# LOAD SETTINGS -#================================================= -#REMOVEME? ynh_script_progression --message="Loading installation settings..." --weight=1 - -#REMOVEME? app=$YNH_APP_INSTANCE_NAME - -#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) -#REMOVEME? path=$(ynh_app_setting_get --app=$app --key=path) -#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) -#REMOVEME? port=$(ynh_app_setting_get --app=$app --key=port) -#REMOVEME? password=$(ynh_app_setting_get --app=$app --key=password) - #================================================= # CHECK VERSION #================================================= -ynh_script_progression --message="Checking version..." --weight=1 upgrade_type=$(ynh_check_app_version_changed) -#================================================= -# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP -#================================================= -#REMOVEME? ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=15 - -# Backup the current version of the app -#REMOVEME? ynh_backup_before_upgrade -#REMOVEME? ynh_clean_setup () { - # Restore it if the upgrade fails -#REMOVEME? ynh_restore_upgradebackup -} -# Exit if an error occurs during the execution of the script -#REMOVEME? ynh_abort_if_errors - -#================================================= -# UPGRADE DEPENDENCIES -#================================================= -#REMOVEME? ynh_script_progression --message="Upgrading dependencies..." --weight=15 - -#REMOVEME? ynh_install_app_dependencies $pkg_dependencies - -#================================================= -# NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=2 - -# Create a dedicated NGINX config -ynh_add_nginx_config - #================================================= # SPECIFIC UPGRADE #================================================= @@ -88,7 +45,7 @@ fi #================================================= ynh_script_progression --message="Updating a configuration file..." --weight=1 -ynh_add_config --template="../conf/couch_ynh.ini" --destination="$install_dir/etc/local.d/couch_ynh.ini" +ynh_add_config --template="couch_ynh.ini" --destination="$install_dir/etc/local.d/couch_ynh.ini" chmod 750 "$install_dir" chmod -R o-rwx "$install_dir" @@ -101,14 +58,12 @@ chown -R $app:$app "$install_dir" #================================================= ynh_script_progression --message="Upgrading logrotate configuration..." --weight=1 +# Create a dedicated NGINX config +ynh_add_nginx_config + # Use logrotate to manage app-specific logfile(s) ynh_use_logrotate --non-append -#================================================= -# INTEGRATE SERVICE IN YUNOHOST -#================================================= -ynh_script_progression --message="Integrating service in YunoHost..." --weight=2 - yunohost service add $app --description="Open-source document-oriented NoSQL database" --log="/var/log/$app/$app.log" --needs_exposed_ports "$port" #================================================= @@ -119,13 +74,6 @@ ynh_script_progression --message="Reconfiguring Fail2Ban..." --weight=3 # Create a dedicated Fail2Ban config ynh_add_fail2ban_config --logpath="/var/log/couchdb/couchdb.log" --failregex="[warning] .*couch_httpd_auth: Authentication failed for user .+ from " --max_retry=5 -#================================================= -# RELOAD NGINX -#================================================= -#REMOVEME? ynh_script_progression --message="Reloading NGINX web server..." --weight=1 - -#REMOVEME? ynh_systemd_action --service_name=nginx --action=reload - #================================================= # END OF SCRIPT #=================================================