From 6f2956db04bc392fcb018bd29702c0731b9a0835 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Tue, 31 Aug 2021 15:55:02 +0200 Subject: [PATCH] Fix --- conf/app.src | 1 + scripts/install | 16 ++++++++-------- scripts/remove | 20 ++++++++++---------- 3 files changed, 19 insertions(+), 18 deletions(-) diff --git a/conf/app.src b/conf/app.src index 59e80e0..c656ff4 100644 --- a/conf/app.src +++ b/conf/app.src @@ -4,3 +4,4 @@ SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true SOURCE_FILENAME= +SOURCE_EXTRACT=true diff --git a/scripts/install b/scripts/install index 0be08bb..a18f6be 100644 --- a/scripts/install +++ b/scripts/install @@ -116,6 +116,14 @@ chmod 750 "$final_path" chmod -R o-rwx "$final_path" chown -R $app:www-data "$final_path" +#================================================= +# CONFIGURE SERVER.JS +#================================================= + +ynh_add_config --template="../conf/config.json" --destination="$final_path/config.json" +chmod 666 "$final_path/config.json" +chown $app "$final_path/config.json" + #================================================= # CONFIGURE NODEBB #================================================= @@ -141,14 +149,6 @@ ynh_replace_string --match_string="__ENV_PATH__" --replace_string="$PATH" --targ ynh_add_systemd_config -#================================================= -# CONFIGURE SERVER.JS -#================================================= - -ynh_add_config --template="../conf/config.json" --destination="$final_path/config.json" -chmod 400 "$final_path/config.json" -chown $app "$final_path/config.json" - #================================================= # START NodeBB IN BACKGROUND #================================================= diff --git a/scripts/remove b/scripts/remove index 18fca17..c8f22af 100644 --- a/scripts/remove +++ b/scripts/remove @@ -12,7 +12,7 @@ source /usr/share/yunohost/helpers #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." --time --weight=1 +ynh_script_progression --message="Loading installation settings..." --weight=1 app=$YNH_APP_INSTANCE_NAME @@ -31,14 +31,14 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path) # Remove the service from the list of services known by YunoHost (added from `yunohost service add`) if ynh_exec_warn_less yunohost service status $app >/dev/null then - ynh_script_progression --message="Removing $app service integration..." --time --weight=1 + ynh_script_progression --message="Removing $app service integration..." --weight=1 yunohost service remove $app fi #================================================= # STOP AND REMOVE SERVICE #================================================= -ynh_script_progression --message="Stopping and removing the systemd service..." --time --weight=1 +ynh_script_progression --message="Stopping and removing the systemd service..." --weight=1 # Remove the dedicated systemd config ynh_remove_systemd_config @@ -46,7 +46,7 @@ ynh_remove_systemd_config #================================================= # REMOVE THE MYSQL DATABASE #================================================= -ynh_script_progression --message="Removing the PostgreSQL database..." --time --weight=1 +ynh_script_progression --message="Removing the PostgreSQL database..." --weight=1 # Remove a database if it exists, along with the associated user ynh_psql_remove_db --db_user=$db_user --db_name=$db_name @@ -54,7 +54,7 @@ ynh_psql_remove_db --db_user=$db_user --db_name=$db_name #================================================= # REMOVE DEPENDENCIES #================================================= -ynh_script_progression --message="Removing dependencies..." --time --weight=1 +ynh_script_progression --message="Removing dependencies..." --weight=1 # Remove metapackage and its dependencies ynh_remove_app_dependencies @@ -62,7 +62,7 @@ ynh_remove_app_dependencies #================================================= # REMOVE APP MAIN DIR #================================================= -ynh_script_progression --message="Removing app main directory..." --time --weight=1 +ynh_script_progression --message="Removing app main directory..." --weight=1 # Remove the app directory securely ynh_secure_remove --file="$final_path" @@ -70,7 +70,7 @@ ynh_secure_remove --file="$final_path" #================================================= # REMOVE NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Removing NGINX web server configuration..." --time --weight=1 +ynh_script_progression --message="Removing NGINX web server configuration..." --weight=1 # Remove the dedicated NGINX config ynh_remove_nginx_config @@ -78,7 +78,7 @@ ynh_remove_nginx_config #================================================= # REMOVE LOGROTATE CONFIGURATION #================================================= -ynh_script_progression --message="Removing logrotate configuration..." --time --weight=1 +ynh_script_progression --message="Removing logrotate configuration..." --weight=1 # Remove the app-specific logrotate config ynh_remove_logrotate @@ -88,7 +88,7 @@ ynh_remove_logrotate #================================================= # REMOVE DEDICATED USER #================================================= -ynh_script_progression --message="Removing the dedicated system user..." --time --weight=1 +ynh_script_progression --message="Removing the dedicated system user..." --weight=1 # Delete a system user ynh_system_user_delete --username=$app @@ -97,4 +97,4 @@ ynh_system_user_delete --username=$app # END OF SCRIPT #================================================= -ynh_script_progression --message="Removal of $app completed" --time --last +ynh_script_progression --message="Removal of $app completed" --last