From 0f99ef873d8f3bb5be9ddd34261aad29a4fa1d55 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Thu, 2 Jul 2020 06:59:57 +0200 Subject: [PATCH 1/2] sub folder install --- README_fr.md | 2 +- check_process | 4 ++-- conf/config.json.example | 1 + conf/nginx.conf | 6 +++--- manifest.json | 14 ++++++++++++-- scripts/change_url | 1 + scripts/install | 3 ++- scripts/upgrade | 1 + 8 files changed, 23 insertions(+), 9 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..4878957 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..aac01d9 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; @@ -17,8 +17,8 @@ location ^~ / { proxy_set_header Connection "upgrade"; # 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; 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..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 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 eca36ff6d9e2854b466e947f82968b67cc6da2ac Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Thu, 2 Jul 2020 14:34:12 +0200 Subject: [PATCH 2/2] Update change_url --- scripts/change_url | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/change_url b/scripts/change_url index 573369a..5fe0855 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -29,6 +29,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) #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP