From 3ec4c07d78045fe77218885f883a4b74164a80a3 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Tue, 23 Jun 2020 17:44:44 +0200 Subject: [PATCH 01/16] install in sub folder --- check_process | 4 ++-- conf/config.json.example | 1 + conf/nginx.conf | 2 +- manifest.json | 12 +++++++++++- scripts/change_url | 1 + scripts/install | 3 ++- scripts/upgrade | 1 + 7 files changed, 19 insertions(+), 5 deletions(-) diff --git a/check_process b/check_process index 24dbef1..8e2f879 100644 --- a/check_process +++ b/check_process @@ -1,7 +1,7 @@ ;; Test complet ; Manifest domain="domain.tld" (DOMAIN) - path="/" (PATH) + path="/path" (PATH) admin="john" (USER) is_public=1 (PUBLIC|public=1|private=0) ; Checks @@ -15,7 +15,7 @@ backup_restore=1 multi_instance=1 port_already_use=1 - change_url=0 + change_url=1 ;;; Levels Level 5=auto ;;; Options diff --git a/conf/config.json.example b/conf/config.json.example index 78f5ddc..2834da5 100644 --- a/conf/config.json.example +++ b/conf/config.json.example @@ -3,6 +3,7 @@ "protocolUseSSL": true, "domain": "__DOMAIN__", "port": "__PORT__", + "urlPath": "__PATH__", "sessionSecret": "__SESSION__", "loglevel": "info", "useCDN": false, diff --git a/conf/nginx.conf b/conf/nginx.conf index 747be58..f78a0cc 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,4 +1,4 @@ -location ^~ / { +location ^~ __PATH__/ { # Force usage of https if ($scheme = http) { rewrite ^ https://$server_name$request_uri? permanent; diff --git a/manifest.json b/manifest.json index 7a3e907..4bd43d6 100644 --- a/manifest.json +++ b/manifest.json @@ -28,7 +28,17 @@ "en": "Choose a domain name for CodiMD", "fr": "Choisissez un nom de domaine pour CodiMD" }, - "example": "codimd.domain.org" + "example": "domain.org" + }, + { + "name": "path", + "type": "path", + "ask": { + "en": "Choose a path for CodiMD", + "fr": "Choisissez un chemin pour CodiMD" + }, + "example": "/codimd", + "default": "/codimd" }, { "name": "is_public", diff --git a/scripts/change_url b/scripts/change_url index d9c96f4..5fe0855 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -28,6 +28,7 @@ ynh_script_progression --message="Loading installation settings..." --weight=1 # Needed for helper "ynh_add_nginx_config" final_path=$(ynh_app_setting_get --app=$app --key=final_path) +path_url=$(ynh_app_setting_get --app=$app --key=path) port=$(ynh_app_setting_get --app=$app --key=port) #================================================= diff --git a/scripts/install b/scripts/install index 364b5c7..2ce7139 100644 --- a/scripts/install +++ b/scripts/install @@ -24,7 +24,7 @@ ynh_abort_if_errors #================================================= domain=$YNH_APP_ARG_DOMAIN -path_url="/" +path_url=$YNH_APP_ARG_PATH is_public=$YNH_APP_ARG_IS_PUBLIC session=$(ynh_string_random --length=30) @@ -148,6 +148,7 @@ ynh_script_progression --message="Modifying a config file..." # Main config File ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="../conf/config.json.example" ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="../conf/config.json.example" +ynh_replace_string --match_string="__PATH__" --replace_string="${path_url:1}" --target_file="../conf/config.json.example" ynh_replace_string --match_string="__DB_USER__" --replace_string="$db_user" --target_file="../conf/config.json.example" ynh_replace_string --match_string="__DB_NAME__" --replace_string="$db_name" --target_file="../conf/config.json.example" ynh_replace_string --match_string="__DB_PASS__" --replace_string="$db_pwd" --target_file="../conf/config.json.example" diff --git a/scripts/upgrade b/scripts/upgrade index 1506054..927a1a7 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -143,6 +143,7 @@ ynh_backup_if_checksum_is_different --file="$final_path/config.json" # Main config File ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="../conf/config.json.example" ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="../conf/config.json.example" +ynh_replace_string --match_string="__PATH__" --replace_string="${path_url:1}" --target_file="../conf/config.json.example" ynh_replace_string --match_string="__DB_USER__" --replace_string="$db_user" --target_file="../conf/config.json.example" ynh_replace_string --match_string="__DB_NAME__" --replace_string="$db_name" --target_file="../conf/config.json.example" ynh_replace_string --match_string="__DB_PASS__" --replace_string="$db_pwd" --target_file="../conf/config.json.example" From ea1b93117f532722b611077aece014ac9eb860c2 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Tue, 23 Jun 2020 18:04:37 +0200 Subject: [PATCH 02/16] fix nginx --- conf/nginx.conf | 20 +++++++------------- manifest.json | 2 +- 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index f78a0cc..b923d5b 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,20 +1,10 @@ location ^~ __PATH__/ { - # 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; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-Proto $scheme; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Host $server_name; - + proxy_pass http://127.0.0.1:__PORT__/; proxy_http_version 1.1; - proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header X-Forwarded-For $remote_addr; # setup for image upload client_max_body_size 8192m; @@ -22,4 +12,8 @@ location ^~ __PATH__/ { proxy_read_timeout 300; proxy_connect_timeout 300; + + # Include SSOWAT user panel. + include conf.d/yunohost_panel.conf.inc; + more_clear_input_headers 'Accept-Encoding'; } diff --git a/manifest.json b/manifest.json index 4bd43d6..74d0131 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Collaborative editor to work on notes written in Markdown", "fr": "Éditeur collaboratif pour travailler sur des notes en Markdown" }, - "version": "1.6.0~ynh3", + "version": "1.6.0~ynh4", "url": "https://github.com/codimd/server", "license": "AGPL-3.0-only", "maintainer": { From 23a7764f78072a287b06f58a3489d117de3ff756 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Thu, 25 Jun 2020 12:25:01 +0200 Subject: [PATCH 03/16] remove sessionSecret --- conf/config.json.example | 1 - scripts/install | 2 -- scripts/upgrade | 2 -- 3 files changed, 5 deletions(-) diff --git a/conf/config.json.example b/conf/config.json.example index 2834da5..a6c4126 100644 --- a/conf/config.json.example +++ b/conf/config.json.example @@ -4,7 +4,6 @@ "domain": "__DOMAIN__", "port": "__PORT__", "urlPath": "__PATH__", - "sessionSecret": "__SESSION__", "loglevel": "info", "useCDN": false, "allowGravatar": false, diff --git a/scripts/install b/scripts/install index 2ce7139..71a590e 100644 --- a/scripts/install +++ b/scripts/install @@ -26,7 +26,6 @@ ynh_abort_if_errors domain=$YNH_APP_ARG_DOMAIN path_url=$YNH_APP_ARG_PATH is_public=$YNH_APP_ARG_IS_PUBLIC -session=$(ynh_string_random --length=30) app=$YNH_APP_INSTANCE_NAME @@ -153,7 +152,6 @@ ynh_replace_string --match_string="__DB_USER__" --replace_string="$db_user" --t ynh_replace_string --match_string="__DB_NAME__" --replace_string="$db_name" --target_file="../conf/config.json.example" ynh_replace_string --match_string="__DB_PASS__" --replace_string="$db_pwd" --target_file="../conf/config.json.example" ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="../conf/config.json.example" -ynh_replace_string --match_string="__SESSION__" --replace_string="$session" --target_file="../conf/config.json.example" cp ../conf/config.json.example "$final_path/config.json" diff --git a/scripts/upgrade b/scripts/upgrade index 927a1a7..6364774 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -21,7 +21,6 @@ path_url=$(ynh_app_setting_get --app=$app --key=path) is_public=$(ynh_app_setting_get --app=$app --key=is_public) final_path=$(ynh_app_setting_get --app=$app --key=final_path) port=$(ynh_app_setting_get --app=$app --key=port) -session=$(ynh_app_setting_get --app=$app --key=session) db_name=$(ynh_app_setting_get --app=$app --key=db_name) db_user=$db_name @@ -148,7 +147,6 @@ ynh_replace_string --match_string="__DB_USER__" --replace_string="$db_user" --ta ynh_replace_string --match_string="__DB_NAME__" --replace_string="$db_name" --target_file="../conf/config.json.example" ynh_replace_string --match_string="__DB_PASS__" --replace_string="$db_pwd" --target_file="../conf/config.json.example" ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="../conf/config.json.example" -ynh_replace_string --match_string="__SESSION__" --replace_string="$session" --target_file="../conf/config.json.example" cp ../conf/config.json.example "$final_path/config.json" From 49e0e1cc789c0dac70186022807420ba5f43be48 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Thu, 25 Jun 2020 14:04:11 +0200 Subject: [PATCH 04/16] Update install --- scripts/install | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/install b/scripts/install index 71a590e..dcaffb3 100644 --- a/scripts/install +++ b/scripts/install @@ -48,7 +48,6 @@ ynh_script_progression --message="Storing installation settings..." --weight=2 ynh_app_setting_set --app=$app --key=domain --value=$domain ynh_app_setting_set --app=$app --key=path --value=$path_url ynh_app_setting_set --app=$app --key=is_public --value=$is_public -ynh_app_setting_set --app=$app --key=session --value=$session #================================================= # STANDARD MODIFICATIONS From 7cca1436364f4380362ba0068a33988b3cc57ee1 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Thu, 25 Jun 2020 15:50:43 +0200 Subject: [PATCH 05/16] Update change_url --- scripts/change_url | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/scripts/change_url b/scripts/change_url index 5fe0855..cd80a3b 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -27,10 +27,16 @@ app=$YNH_APP_INSTANCE_NAME ynh_script_progression --message="Loading installation settings..." --weight=1 # Needed for helper "ynh_add_nginx_config" -final_path=$(ynh_app_setting_get --app=$app --key=final_path) +domain=$(ynh_app_setting_get --app=$app --key=domain) path_url=$(ynh_app_setting_get --app=$app --key=path) +is_public=$(ynh_app_setting_get --app=$app --key=is_public) +final_path=$(ynh_app_setting_get --app=$app --key=final_path) port=$(ynh_app_setting_get --app=$app --key=port) +db_name=$(ynh_app_setting_get --app=$app --key=db_name) +db_user=$db_name +db_pwd=$(ynh_app_setting_get --app=$app --key=db_pwd) + #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #================================================= @@ -102,6 +108,22 @@ then ynh_store_file_checksum --file="/etc/nginx/conf.d/$new_domain.d/$app.conf" fi +#================================================= +# MODIFY A CONFIG FILE +#================================================= +ynh_script_progression --message="Modifying a config file..." + +# Main config File +ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="../conf/config.json.example" +ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="../conf/config.json.example" +ynh_replace_string --match_string="__PATH__" --replace_string="${path_url:1}" --target_file="../conf/config.json.example" +ynh_replace_string --match_string="__DB_USER__" --replace_string="$db_user" --target_file="../conf/config.json.example" +ynh_replace_string --match_string="__DB_NAME__" --replace_string="$db_name" --target_file="../conf/config.json.example" +ynh_replace_string --match_string="__DB_PASS__" --replace_string="$db_pwd" --target_file="../conf/config.json.example" +ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="../conf/config.json.example" + +cp ../conf/config.json.example "$final_path/config.json" + #================================================= # GENERIC FINALISATION #================================================= From 1b789974eee627934a579d50bb323224e8e2b861 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Thu, 25 Jun 2020 16:12:01 +0200 Subject: [PATCH 06/16] Update change_url --- scripts/change_url | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/change_url b/scripts/change_url index cd80a3b..4523b0c 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -115,8 +115,8 @@ ynh_script_progression --message="Modifying a config file..." # Main config File ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="../conf/config.json.example" -ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="../conf/config.json.example" -ynh_replace_string --match_string="__PATH__" --replace_string="${path_url:1}" --target_file="../conf/config.json.example" +ynh_replace_string --match_string="__DOMAIN__" --replace_string="$new_domain" --target_file="../conf/config.json.example" +ynh_replace_string --match_string="__PATH__" --replace_string="$new_path" --target_file="../conf/config.json.example" ynh_replace_string --match_string="__DB_USER__" --replace_string="$db_user" --target_file="../conf/config.json.example" ynh_replace_string --match_string="__DB_NAME__" --replace_string="$db_name" --target_file="../conf/config.json.example" ynh_replace_string --match_string="__DB_PASS__" --replace_string="$db_pwd" --target_file="../conf/config.json.example" From 3bf352fc9dba0bfcf97c4ffd062d2d9ea321d4d2 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Thu, 25 Jun 2020 16:26:13 +0200 Subject: [PATCH 07/16] Revert "Update change_url" This reverts commit 1b789974eee627934a579d50bb323224e8e2b861. --- scripts/change_url | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/change_url b/scripts/change_url index 4523b0c..cd80a3b 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -115,8 +115,8 @@ ynh_script_progression --message="Modifying a config file..." # Main config File ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="../conf/config.json.example" -ynh_replace_string --match_string="__DOMAIN__" --replace_string="$new_domain" --target_file="../conf/config.json.example" -ynh_replace_string --match_string="__PATH__" --replace_string="$new_path" --target_file="../conf/config.json.example" +ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="../conf/config.json.example" +ynh_replace_string --match_string="__PATH__" --replace_string="${path_url:1}" --target_file="../conf/config.json.example" ynh_replace_string --match_string="__DB_USER__" --replace_string="$db_user" --target_file="../conf/config.json.example" ynh_replace_string --match_string="__DB_NAME__" --replace_string="$db_name" --target_file="../conf/config.json.example" ynh_replace_string --match_string="__DB_PASS__" --replace_string="$db_pwd" --target_file="../conf/config.json.example" From f5f2708555851300f8be533b8208db90c63b0864 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Thu, 25 Jun 2020 16:26:24 +0200 Subject: [PATCH 08/16] Revert "Update change_url" This reverts commit 7cca1436364f4380362ba0068a33988b3cc57ee1. --- scripts/change_url | 24 +----------------------- 1 file changed, 1 insertion(+), 23 deletions(-) diff --git a/scripts/change_url b/scripts/change_url index cd80a3b..5fe0855 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -27,16 +27,10 @@ app=$YNH_APP_INSTANCE_NAME ynh_script_progression --message="Loading installation settings..." --weight=1 # Needed for helper "ynh_add_nginx_config" -domain=$(ynh_app_setting_get --app=$app --key=domain) -path_url=$(ynh_app_setting_get --app=$app --key=path) -is_public=$(ynh_app_setting_get --app=$app --key=is_public) final_path=$(ynh_app_setting_get --app=$app --key=final_path) +path_url=$(ynh_app_setting_get --app=$app --key=path) port=$(ynh_app_setting_get --app=$app --key=port) -db_name=$(ynh_app_setting_get --app=$app --key=db_name) -db_user=$db_name -db_pwd=$(ynh_app_setting_get --app=$app --key=db_pwd) - #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #================================================= @@ -108,22 +102,6 @@ then ynh_store_file_checksum --file="/etc/nginx/conf.d/$new_domain.d/$app.conf" fi -#================================================= -# MODIFY A CONFIG FILE -#================================================= -ynh_script_progression --message="Modifying a config file..." - -# Main config File -ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="../conf/config.json.example" -ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="../conf/config.json.example" -ynh_replace_string --match_string="__PATH__" --replace_string="${path_url:1}" --target_file="../conf/config.json.example" -ynh_replace_string --match_string="__DB_USER__" --replace_string="$db_user" --target_file="../conf/config.json.example" -ynh_replace_string --match_string="__DB_NAME__" --replace_string="$db_name" --target_file="../conf/config.json.example" -ynh_replace_string --match_string="__DB_PASS__" --replace_string="$db_pwd" --target_file="../conf/config.json.example" -ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="../conf/config.json.example" - -cp ../conf/config.json.example "$final_path/config.json" - #================================================= # GENERIC FINALISATION #================================================= From 08eba12cccd6dff33615d8b5a338905b398ad5e6 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 26 Jun 2020 11:34:43 +0200 Subject: [PATCH 09/16] Update install --- scripts/install | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index dcaffb3..c3b18c9 100644 --- a/scripts/install +++ b/scripts/install @@ -188,7 +188,8 @@ yunohost service add $app --description "Collaborative Markdown notes" --log="/v 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="HTTP Server listening" +ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" --line_match="HTTP Server listening" +#ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="HTTP Server listening" #================================================= # SETUP SSOWAT From 202069310f3e8873e2f5243bf9725f28aab17564 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 26 Jun 2020 11:49:58 +0200 Subject: [PATCH 10/16] Update upgrade --- scripts/upgrade | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index 6364774..e33416d 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -186,7 +186,9 @@ yunohost service add $app --description "Collaborative Markdown notes" --log="/v #================================================= ynh_script_progression --message="Starting a systemd service..." --weight=1 -ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="HTTP Server listening" +ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" --line_match="HTTP Server listening" + +#ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="HTTP Server listening" #================================================= # RELOAD NGINX From 9b7fb0a7f196ceb6bf52e375826368b417735e8e Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 26 Jun 2020 14:23:13 +0200 Subject: [PATCH 11/16] remove --- scripts/install | 3 +-- scripts/upgrade | 4 +--- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/scripts/install b/scripts/install index c3b18c9..dcaffb3 100644 --- a/scripts/install +++ b/scripts/install @@ -188,8 +188,7 @@ yunohost service add $app --description "Collaborative Markdown notes" --log="/v ynh_script_progression --message="Starting a systemd service..." --weight=2 # Start a systemd service -ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" --line_match="HTTP Server listening" -#ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="HTTP Server listening" +ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="HTTP Server listening" #================================================= # SETUP SSOWAT diff --git a/scripts/upgrade b/scripts/upgrade index e33416d..6364774 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -186,9 +186,7 @@ yunohost service add $app --description "Collaborative Markdown notes" --log="/v #================================================= ynh_script_progression --message="Starting a systemd service..." --weight=1 -ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" --line_match="HTTP Server listening" - -#ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="HTTP Server listening" +ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="HTTP Server listening" #================================================= # RELOAD NGINX From 827ee23d2f52e535ba00290ae093130eea02700d Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Tue, 30 Jun 2020 11:29:08 +0200 Subject: [PATCH 12/16] Update nginx.conf --- conf/nginx.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index b923d5b..f61238e 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -7,8 +7,8 @@ location ^~ __PATH__/ { proxy_set_header X-Forwarded-For $remote_addr; # setup for image upload - client_max_body_size 8192m; - proxy_max_temp_file_size 8192m; + client_max_body_size 256M; + proxy_max_temp_file_size 1024M; proxy_read_timeout 300; proxy_connect_timeout 300; From a0ad8bed4ad9b5a306e41b223589bda2b71be419 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Tue, 30 Jun 2020 14:00:37 +0200 Subject: [PATCH 13/16] Update README_fr.md --- README_fr.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README_fr.md b/README_fr.md index 44b8f3d..01de3bb 100644 --- a/README_fr.md +++ b/README_fr.md @@ -39,7 +39,7 @@ Vous pouvez configurer CodiMD en modifiant le fichier `/var/www/codimd/config.js #### Architectures supportées -* x86-64b - [![Build Status](https://ci-apps.yunohost.org/ci/logs/codimd%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/codimd/) +* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/codimd%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/codimd/) * ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/codimd%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/codimd/) ## Liens From 34d20cfd69f31b3360309825e7c0252e7ca43b86 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Wed, 1 Jul 2020 18:19:21 +0200 Subject: [PATCH 14/16] Update change_url --- scripts/change_url | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/change_url b/scripts/change_url index 5fe0855..573369a 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -29,7 +29,6 @@ ynh_script_progression --message="Loading installation settings..." --weight=1 # Needed for helper "ynh_add_nginx_config" final_path=$(ynh_app_setting_get --app=$app --key=final_path) path_url=$(ynh_app_setting_get --app=$app --key=path) -port=$(ynh_app_setting_get --app=$app --key=port) #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP From 76c9e61ee4e6458176ba60ad011e639539edb2e5 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Wed, 1 Jul 2020 21:08:11 +0200 Subject: [PATCH 15/16] rebase fix nginx remove sessionSecret Update change_url Update change_url Revert "Update change_url" This reverts commit 1b789974eee627934a579d50bb323224e8e2b861. Revert "Update change_url" This reverts commit 7cca1436364f4380362ba0068a33988b3cc57ee1. Update install Update upgrade remove Update nginx.conf Update README_fr.md Update change_url --- README_fr.md | 2 +- check_process | 4 ++-- conf/config.json.example | 1 + conf/nginx.conf | 26 ++++++++++---------------- manifest.json | 14 ++++++++++++-- scripts/change_url | 2 +- scripts/install | 3 ++- scripts/upgrade | 1 + 8 files changed, 30 insertions(+), 23 deletions(-) diff --git a/README_fr.md b/README_fr.md index 44b8f3d..01de3bb 100644 --- a/README_fr.md +++ b/README_fr.md @@ -39,7 +39,7 @@ Vous pouvez configurer CodiMD en modifiant le fichier `/var/www/codimd/config.js #### Architectures supportées -* x86-64b - [![Build Status](https://ci-apps.yunohost.org/ci/logs/codimd%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/codimd/) +* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/codimd%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/codimd/) * ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/codimd%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/codimd/) ## Liens diff --git a/check_process b/check_process index 24dbef1..8e2f879 100644 --- a/check_process +++ b/check_process @@ -1,7 +1,7 @@ ;; Test complet ; Manifest domain="domain.tld" (DOMAIN) - path="/" (PATH) + path="/path" (PATH) admin="john" (USER) is_public=1 (PUBLIC|public=1|private=0) ; Checks @@ -15,7 +15,7 @@ backup_restore=1 multi_instance=1 port_already_use=1 - change_url=0 + change_url=1 ;;; Levels Level 5=auto ;;; Options diff --git a/conf/config.json.example b/conf/config.json.example index 1b1df57..a6c4126 100644 --- a/conf/config.json.example +++ b/conf/config.json.example @@ -3,6 +3,7 @@ "protocolUseSSL": true, "domain": "__DOMAIN__", "port": "__PORT__", + "urlPath": "__PATH__", "loglevel": "info", "useCDN": false, "allowGravatar": false, diff --git a/conf/nginx.conf b/conf/nginx.conf index 747be58..f61238e 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,25 +1,19 @@ -location ^~ / { - # Force usage of https - if ($scheme = http) { - rewrite ^ https://$server_name$request_uri? permanent; - } +location ^~ __PATH__/ { - proxy_pass http://127.0.0.1:__PORT__; - proxy_redirect off; - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-Proto $scheme; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Host $server_name; - + proxy_pass http://127.0.0.1:__PORT__/; proxy_http_version 1.1; - proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header X-Forwarded-For $remote_addr; # setup for image upload - client_max_body_size 8192m; - proxy_max_temp_file_size 8192m; + client_max_body_size 256M; + proxy_max_temp_file_size 1024M; proxy_read_timeout 300; proxy_connect_timeout 300; + + # Include SSOWAT user panel. + include conf.d/yunohost_panel.conf.inc; + more_clear_input_headers 'Accept-Encoding'; } diff --git a/manifest.json b/manifest.json index 7a3e907..74d0131 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Collaborative editor to work on notes written in Markdown", "fr": "Éditeur collaboratif pour travailler sur des notes en Markdown" }, - "version": "1.6.0~ynh3", + "version": "1.6.0~ynh4", "url": "https://github.com/codimd/server", "license": "AGPL-3.0-only", "maintainer": { @@ -28,7 +28,17 @@ "en": "Choose a domain name for CodiMD", "fr": "Choisissez un nom de domaine pour CodiMD" }, - "example": "codimd.domain.org" + "example": "domain.org" + }, + { + "name": "path", + "type": "path", + "ask": { + "en": "Choose a path for CodiMD", + "fr": "Choisissez un chemin pour CodiMD" + }, + "example": "/codimd", + "default": "/codimd" }, { "name": "is_public", diff --git a/scripts/change_url b/scripts/change_url index d9c96f4..573369a 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -28,7 +28,7 @@ ynh_script_progression --message="Loading installation settings..." --weight=1 # Needed for helper "ynh_add_nginx_config" final_path=$(ynh_app_setting_get --app=$app --key=final_path) -port=$(ynh_app_setting_get --app=$app --key=port) +path_url=$(ynh_app_setting_get --app=$app --key=path) #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP diff --git a/scripts/install b/scripts/install index 955d49b..dcaffb3 100644 --- a/scripts/install +++ b/scripts/install @@ -24,7 +24,7 @@ ynh_abort_if_errors #================================================= domain=$YNH_APP_ARG_DOMAIN -path_url="/" +path_url=$YNH_APP_ARG_PATH is_public=$YNH_APP_ARG_IS_PUBLIC app=$YNH_APP_INSTANCE_NAME @@ -146,6 +146,7 @@ ynh_script_progression --message="Modifying a config file..." # Main config File ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="../conf/config.json.example" ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="../conf/config.json.example" +ynh_replace_string --match_string="__PATH__" --replace_string="${path_url:1}" --target_file="../conf/config.json.example" ynh_replace_string --match_string="__DB_USER__" --replace_string="$db_user" --target_file="../conf/config.json.example" ynh_replace_string --match_string="__DB_NAME__" --replace_string="$db_name" --target_file="../conf/config.json.example" ynh_replace_string --match_string="__DB_PASS__" --replace_string="$db_pwd" --target_file="../conf/config.json.example" diff --git a/scripts/upgrade b/scripts/upgrade index 6910d66..6364774 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -142,6 +142,7 @@ ynh_backup_if_checksum_is_different --file="$final_path/config.json" # Main config File ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="../conf/config.json.example" ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="../conf/config.json.example" +ynh_replace_string --match_string="__PATH__" --replace_string="${path_url:1}" --target_file="../conf/config.json.example" ynh_replace_string --match_string="__DB_USER__" --replace_string="$db_user" --target_file="../conf/config.json.example" ynh_replace_string --match_string="__DB_NAME__" --replace_string="$db_name" --target_file="../conf/config.json.example" ynh_replace_string --match_string="__DB_PASS__" --replace_string="$db_pwd" --target_file="../conf/config.json.example" From f18fc6b4d81ae0f54bcf3d65b52b2c51fae49ee4 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Wed, 1 Jul 2020 22:10:13 +0200 Subject: [PATCH 16/16] Update nginx.conf --- conf/nginx.conf | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index f61238e..ab4eec6 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,10 +1,16 @@ location ^~ __PATH__/ { proxy_pass http://127.0.0.1:__PORT__/; + proxy_redirect off; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Host $server_name; + proxy_http_version 1.1; proxy_set_header Connection "upgrade"; proxy_set_header Upgrade $http_upgrade; - proxy_set_header X-Forwarded-For $remote_addr; # setup for image upload client_max_body_size 256M;