From d0b1baa31a8a6d103ea03bab2b597dd65923a59f Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Wed, 10 Mar 2021 23:15:26 +0100 Subject: [PATCH] cleaning --- check_process | 1 - conf/config.js | 2 +- scripts/install | 16 ++++++++-------- scripts/upgrade | 19 +++++-------------- 4 files changed, 14 insertions(+), 24 deletions(-) diff --git a/check_process b/check_process index 26c6100..2afd349 100644 --- a/check_process +++ b/check_process @@ -15,7 +15,6 @@ upgrade=1 from_commit=ddbb3b36b8bcd00e573456bd9ad07b1aa5e41cb1 backup_restore=1 multi_instance=0 - incorrect_path=0 port_already_use=1 change_url=1 ;;; Options diff --git a/conf/config.js b/conf/config.js index c46d9ca..75f1ac9 100644 --- a/conf/config.js +++ b/conf/config.js @@ -142,7 +142,7 @@ module.exports = { /* CryptPad will display a point of contact for your instance on its contact page * (/contact.html) if you provide it below. */ - adminEmail: '__ADMIN_MAIL__', + adminEmail: '__EMAIL__', /* * By default, CryptPad contacts one of our servers once a day. diff --git a/scripts/install b/scripts/install index 7399b7c..45da7e4 100644 --- a/scripts/install +++ b/scripts/install @@ -49,8 +49,6 @@ ynh_app_setting_set --app=$app --key=domain --value=$domain ynh_app_setting_set --app=$app --key=path_url --value=$path_url ynh_app_setting_set --app=$app --key=admin --value=$admin -email=$(ynh_user_get_info --username=$admin --key=mail) - #================================================= # STANDARD MODIFICATIONS #================================================= @@ -104,8 +102,8 @@ ynh_add_nginx_config #================================================= ynh_script_progression --message="Configuring a systemd service..." --weight=1 -ynh_replace_string --match_string="__ENV_PATH__" --replace_string="$PATH" --target_file="../conf/systemd.service" -ynh_replace_string --match_string="__YNH_NPM__" --replace_string="$ynh_npm" --target_file="../conf/systemd.service" +ynh_replace_string --match_string="__ENV_PATH__" --replace_string="$PATH" --target_file="../conf/systemd.service" +ynh_replace_string --match_string="__YNH_NPM__" --replace_string="$ynh_npm" --target_file="../conf/systemd.service" ynh_add_systemd_config @@ -116,9 +114,11 @@ ynh_add_systemd_config # Copy default configuration file mv "../conf/config.js" "$final_path/config/config.js" -ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="$final_path/config/config.js" -ynh_replace_string --match_string="__PORTI__" --replace_string="$porti" --target_file="$final_path/config/config.js" -ynh_replace_string --match_string="__ADMIN_MAIL__" --replace_string="$email" --target_file="$final_path/config/config.js" +email=$(ynh_user_get_info --username=$admin --key=mail) + +ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="$final_path/config/config.js" +ynh_replace_string --match_string="__PORTI__" --replace_string="$porti" --target_file="$final_path/config/config.js" +ynh_replace_string --match_string="__EMAIL__" --replace_string="$email" --target_file="$final_path/config/config.js" # Store file checksum to detected user modifications on upgrade ynh_store_file_checksum "$final_path/config/config.js" @@ -155,7 +155,7 @@ yunohost service add $app --description="Zero Knowledge realtime collaborative e ynh_script_progression --message="Starting a systemd service..." --weight=2 # Start a systemd service -ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="server available" +ynh_systemd_action --service_name=$app --action=start --log_path=systemd --line_match="server available" #================================================= # SETUP SSOWAT diff --git a/scripts/upgrade b/scripts/upgrade index 966e102..1f58d9e 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -35,15 +35,6 @@ upgrade_type=$(ynh_check_app_version_changed) #================================================= ynh_script_progression --message="Ensuring downward compatibility..." --weight=2 -# Fix is_public as a boolean value -if [ "$is_public" = "Yes" ]; then - ynh_app_setting_set --app=$app --key=is_public --value=1 - is_public=1 -elif [ "$is_public" = "No" ]; then - ynh_app_setting_set --app=$app --key=is_public --value=0 - is_public=0 -fi - # If final_path doesn't exist, create it if [ -z "$final_path" ]; then final_path=/var/www/$app @@ -125,9 +116,9 @@ ynh_backup_if_checksum_is_different "$final_path/config/config.js" # Copy default configuration file mv "../conf/config.js" "$final_path/config/config.js" -ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="$final_path/config/config.js" -ynh_replace_string --match_string="__PORTI__" --replace_string="$porti" --target_file="$final_path/config/config.js" -ynh_replace_string --match_string="__ADMIN_MAIL__" --replace_string="$email" --target_file="$final_path/config/config.js" +ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="$final_path/config/config.js" +ynh_replace_string --match_string="__PORTI__" --replace_string="$porti" --target_file="$final_path/config/config.js" +ynh_replace_string --match_string="__EMAIL__" --replace_string="$email" --target_file="$final_path/config/config.js" # Store file checksum to detected user modifications on upgrade ynh_store_file_checksum "$final_path/config/config.js" @@ -146,8 +137,8 @@ popd || ynh_die #================================================= ynh_script_progression --message="Upgrading systemd configuration..." --weight=1 -ynh_replace_string --match_string="__ENV_PATH__" --replace_string="$PATH" --target_file="../conf/systemd.service" -ynh_replace_string --match_string="__YNH_NPM__" --replace_string="$ynh_npm" --target_file="../conf/systemd.service" +ynh_replace_string --match_string="__ENV_PATH__" --replace_string="$PATH" --target_file="../conf/systemd.service" +ynh_replace_string --match_string="__YNH_NPM__" --replace_string="$ynh_npm" --target_file="../conf/systemd.service" # Create a dedicated systemd config ynh_add_systemd_config