From f37ee776fea813880e0713d50dce59435456af2f Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Wed, 17 Mar 2021 11:54:14 +0100 Subject: [PATCH 1/3] Update manifest.json --- manifest.json | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/manifest.json b/manifest.json index 47521dc..153b77e 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Zero Knowledge realtime collaborative editor", "fr": "Éditeur chiffré collaboratif en temps réel." }, - "version": "4.2.1~ynh2", + "version": "4.2.1~ynh3", "url": "https://cryptpad.fr/", "license": "AGPL-3.0-only", "maintainer": { @@ -26,10 +26,6 @@ { "name": "domain", "type": "domain", - "ask": { - "en": "Choose a domain name for CryptPad", - "fr": "Choisissez un nom de domaine pour CryptPad" - }, "help": { "en": "CryptPad needs to be installed in a dedicated domain or sub-domain.", "fr": "CryptPad doit être installé dans un domaine ou sous-domaine dédié." @@ -39,19 +35,11 @@ { "name": "admin", "type": "user", - "ask": { - "en": "Choose an admin user", - "fr": "Choisissez l’administrateur" - }, "example": "johndoe" }, { "name": "is_public", "type": "boolean", - "ask": { - "en": "Is it a public site?", - "fr": "Est-ce un site publique ?" - }, "help": { "en": "If enabled, CryptPad will be accessible by people who do not have an account. This can be changed later via the webadmin.", "fr": "Si cette case est cochée, CryptPad sera accessible aux personnes n’ayant pas de compte. Vous pourrez changer ceci plus tard via la webadmin." From e5f2973a56c5eacdd3bc419f5f4d7c37f12aaceb Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Wed, 17 Mar 2021 12:02:40 +0100 Subject: [PATCH 2/3] Simplify conf --- check_process | 1 - conf/config.js | 2 +- conf/nginx.conf | 6 ++++-- scripts/install | 23 ++++++++++++----------- scripts/upgrade | 18 ++++++++++-------- 5 files changed, 27 insertions(+), 23 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/conf/nginx.conf b/conf/nginx.conf index 6117882..d3e50e5 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,8 +1,10 @@ location ^~ / { - # Force usage of https - if ($scheme = http) { + + # Force usage of https + if ($scheme = http) { rewrite ^ https://$server_name$request_uri? permanent; } + proxy_pass http://127.0.0.1:__PORT__; proxy_redirect off; proxy_set_header Host $host; diff --git a/scripts/install b/scripts/install index 7399b7c..5ef1cd7 100644 --- a/scripts/install +++ b/scripts/install @@ -27,6 +27,7 @@ domain=$YNH_APP_ARG_DOMAIN is_public=$YNH_APP_ARG_IS_PUBLIC path_url="/" admin=$YNH_APP_ARG_ADMIN +email=$(ynh_user_get_info --username=$admin --key=mail) app=$YNH_APP_INSTANCE_NAME @@ -49,8 +50,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 +103,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 @@ -113,15 +112,17 @@ ynh_add_systemd_config # CONFIGURE CONFIG.JS #================================================= -# Copy default configuration file -mv "../conf/config.js" "$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" +# # Store file checksum to detected user modifications on upgrade +# ynh_store_file_checksum "$final_path/config/config.js" + +ynh_add_config --template="../conf/config.js" --destination="$final_path/config/config.js" #================================================= # INSTALL CRYPTPAD diff --git a/scripts/upgrade b/scripts/upgrade index 696cf22..c99ed92 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -111,17 +111,19 @@ ynh_system_user_create --username=$app # CONFIGURE CONFIG.JS #================================================= -ynh_backup_if_checksum_is_different "$final_path/config/config.js" +# ynh_backup_if_checksum_is_different "$final_path/config/config.js" -# Copy default configuration file -mv "../conf/config.js" "$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" +# # Store file checksum to detected user modifications on upgrade +# ynh_store_file_checksum "$final_path/config/config.js" + +ynh_add_config --template="../conf/config.js" --destination="$final_path/config/config.js" #================================================= # INSTALL CRYPTPAD From b558968551a89bf34cc2fd0b203e55304a7b5967 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Wed, 17 Mar 2021 12:38:04 +0100 Subject: [PATCH 3/3] Cleaning up --- scripts/install | 10 ---------- scripts/upgrade | 12 ------------ 2 files changed, 22 deletions(-) diff --git a/scripts/install b/scripts/install index 5ef1cd7..0e9d309 100644 --- a/scripts/install +++ b/scripts/install @@ -112,16 +112,6 @@ ynh_add_systemd_config # CONFIGURE 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="__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" - ynh_add_config --template="../conf/config.js" --destination="$final_path/config/config.js" #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index c99ed92..5d3423a 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -111,18 +111,6 @@ ynh_system_user_create --username=$app # CONFIGURE CONFIG.JS #================================================= -# 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="__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" - ynh_add_config --template="../conf/config.js" --destination="$final_path/config/config.js" #=================================================