From 0bc1cb962a1f23f61dfa170f24d01bf332cce235 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sat, 10 Jun 2023 18:09:29 +0200 Subject: [PATCH] cleaning --- scripts/install | 5 +---- scripts/restore | 14 -------------- scripts/upgrade | 18 +----------------- 3 files changed, 2 insertions(+), 35 deletions(-) diff --git a/scripts/install b/scripts/install index 176d602..b6fe1a2 100755 --- a/scripts/install +++ b/scripts/install @@ -13,13 +13,11 @@ source /usr/share/yunohost/helpers #================================================= # INSTALL DEPENDENCIES #================================================= -ynh_script_progression --message="Installing Go Lang..." --weight=1 +ynh_script_progression --message="Installing dependencies..." --weight=1 ynh_exec_warn_less ynh_install_go --go_version=$go_version ynh_use_go -ynh_script_progression --message="Installing Node JS..." --weight=1 - ynh_install_nodejs --nodejs_version=$nodejs_version #================================================= @@ -30,7 +28,6 @@ ynh_script_progression --message="Setting up source files..." --weight=1 # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$install_dir/sources" -chmod 750 "$install_dir" chmod -R o-rwx "$install_dir" chown -R $app:www-data "$install_dir" diff --git a/scripts/restore b/scripts/restore index f22c597..d17ff90 100755 --- a/scripts/restore +++ b/scripts/restore @@ -17,23 +17,11 @@ ynh_script_progression --message="Restoring the app main directory..." --weight= ynh_restore_file --origin_path="$install_dir" -chmod 750 "$install_dir" chmod -R o-rwx "$install_dir" chown -R $app:www-data "$install_dir" chmod +x "$install_dir/run_fider" -#================================================= -# SPECIFIC RESTORATION -#================================================= -# REINSTALL DEPENDENCIES -#================================================= -ynh_script_progression --message="Reinstalling dependencies..." --weight=1 - -# Define and install dependencies -ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies -install_golang_from_backports - #================================================= # RESTORE THE NGINX CONFIGURATION #================================================= @@ -46,8 +34,6 @@ ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" #================================================= ynh_script_progression --message="Restoring the PostgreSQL database..." --weight=1 -db_pwd=$(ynh_app_setting_get --app=$app --key=psqlpwd) -ynh_psql_setup_db --db_user=$db_user --db_name=$db_name --db_pwd=$db_pwd ynh_psql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./db.sql #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 12f7f6b..633c4c0 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -40,14 +40,6 @@ if [ -d "/opt/yunohost/$app" ]; then mv "/opt/yunohost/$app" "$install_dir" fi -#================================================= -# CREATE DEDICATED USER -#================================================= -ynh_script_progression --message="Making sure dedicated system user exists..." --weight=1 - -# Create a dedicated user (if not existing) -ynh_system_user_create --username=$app --home_dir="$install_dir" - #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= @@ -60,18 +52,9 @@ then ynh_setup_source --dest_dir="$install_dir" fi -chmod 750 "$install_dir" chmod -R o-rwx "$install_dir" chown -R $app:www-data "$install_dir" -#================================================= -# UPGRADE DEPENDENCIES -#================================================= -ynh_script_progression --message="Upgrading dependencies..." --weight=1 - -ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies -install_golang_from_backports - #================================================= # NGINX CONFIGURATION #================================================= @@ -88,6 +71,7 @@ ynh_add_nginx_config ynh_script_progression --message="Updating the configuration file..." --weight=1 ynh_add_config --template="run_fider" --destination="$install_dir/run_fider" + chown $app:www-data "$install_dir/run_fider" chmod 744 "$install_dir/run_fider"