From 4d128aaf6ec90eb3fd7d630c432954e2236e8b3b Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 21 May 2021 14:46:20 +0200 Subject: [PATCH 1/7] Fix --- check_process | 4 ++-- conf/nginx.conf | 5 ++--- scripts/install | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/check_process b/check_process index 0e2363c..88c0bfb 100644 --- a/check_process +++ b/check_process @@ -7,7 +7,7 @@ password="password" ; Checks pkg_linter=1 - setup_sub_dir=1 + setup_sub_dir=0 setup_root=1 setup_nourl=0 setup_private=1 @@ -15,7 +15,7 @@ upgrade=1 #upgrade=1 from_commit= backup_restore=1 - multi_instance=0 + multi_instance=1 change_url=1 ;;; Options Email= diff --git a/conf/nginx.conf b/conf/nginx.conf index f74bf7a..9bab126 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,12 +1,11 @@ -#sub_path_only rewrite ^__PATH__$ __PATH__/ permanent; -location __PATH__/ { +location / { # Force usage of https if ($scheme = http) { rewrite ^ https://$server_name$request_uri? permanent; } - proxy_pass http://127.0.0.1:__PORT__/; + proxy_pass http://127.0.0.1:__PORT__; proxy_redirect off; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; diff --git a/scripts/install b/scripts/install index 9307a3c..ff48f57 100644 --- a/scripts/install +++ b/scripts/install @@ -21,7 +21,7 @@ ynh_abort_if_errors #================================================= domain=$YNH_APP_ARG_DOMAIN -path_url=$YNH_APP_ARG_PATH +path_url="/" is_public=$YNH_APP_ARG_IS_PUBLIC architecture=$(ynh_detect_arch) password=$YNH_APP_ARG_PASSWORD From c34a047a8ff807291ba67632cc261f3da93cc2cf Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 21 May 2021 14:46:35 +0200 Subject: [PATCH 2/7] Update manifest.json --- manifest.json | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/manifest.json b/manifest.json index e2911d5..510d99c 100644 --- a/manifest.json +++ b/manifest.json @@ -21,7 +21,7 @@ "requirements": { "yunohost": ">= 4.2.4" }, - "multi_instance": false, + "multi_instance": true, "services": [ "nginx" ], @@ -32,12 +32,6 @@ "type": "domain", "example": "domain.org" }, - { - "name": "path", - "type": "path", - "example": "/miniflux", - "default": "/miniflux" - }, { "name": "admin", "type": "user", From 8d3915405c2ef61457df320b465055ede2dd10ad Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 21 May 2021 14:49:49 +0200 Subject: [PATCH 3/7] Revert "Update manifest.json" This reverts commit c34a047a8ff807291ba67632cc261f3da93cc2cf. --- manifest.json | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index 510d99c..e2911d5 100644 --- a/manifest.json +++ b/manifest.json @@ -21,7 +21,7 @@ "requirements": { "yunohost": ">= 4.2.4" }, - "multi_instance": true, + "multi_instance": false, "services": [ "nginx" ], @@ -32,6 +32,12 @@ "type": "domain", "example": "domain.org" }, + { + "name": "path", + "type": "path", + "example": "/miniflux", + "default": "/miniflux" + }, { "name": "admin", "type": "user", From 590ddd38bc79269b5bc070c54962dbb394dbb9cf Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 21 May 2021 14:50:02 +0200 Subject: [PATCH 4/7] Revert "Fix" This reverts commit 4d128aaf6ec90eb3fd7d630c432954e2236e8b3b. --- check_process | 4 ++-- conf/nginx.conf | 5 +++-- scripts/install | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/check_process b/check_process index 88c0bfb..0e2363c 100644 --- a/check_process +++ b/check_process @@ -7,7 +7,7 @@ password="password" ; Checks pkg_linter=1 - setup_sub_dir=0 + setup_sub_dir=1 setup_root=1 setup_nourl=0 setup_private=1 @@ -15,7 +15,7 @@ upgrade=1 #upgrade=1 from_commit= backup_restore=1 - multi_instance=1 + multi_instance=0 change_url=1 ;;; Options Email= diff --git a/conf/nginx.conf b/conf/nginx.conf index 9bab126..f74bf7a 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,11 +1,12 @@ -location / { +#sub_path_only rewrite ^__PATH__$ __PATH__/ permanent; +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_pass http://127.0.0.1:__PORT__/; proxy_redirect off; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; diff --git a/scripts/install b/scripts/install index ff48f57..9307a3c 100644 --- a/scripts/install +++ b/scripts/install @@ -21,7 +21,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 architecture=$(ynh_detect_arch) password=$YNH_APP_ARG_PASSWORD From 3d166c322e428c7dde7b9696a04ba2e7e08dcdc8 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 21 May 2021 14:51:22 +0200 Subject: [PATCH 5/7] Update miniflux.conf --- conf/miniflux.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/conf/miniflux.conf b/conf/miniflux.conf index 8102b7c..02025a2 100644 --- a/conf/miniflux.conf +++ b/conf/miniflux.conf @@ -1,3 +1,4 @@ +BASE_URL=http://__DOMAIN____PATH__ LISTEN_ADDR=127.0.0.1:__PORT__ DATABASE_URL=postgres://__DB_NAME__:__DB_PWD__@localhost/__DB_NAME__?sslmode=disable RUN_MIGRATIONS=1 From fde426664f62413cc516325f735d6c3e88a01c5d Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 21 May 2021 14:57:21 +0200 Subject: [PATCH 6/7] Fix --- conf/nginx.conf | 2 +- scripts/change_url | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index f74bf7a..a7548a2 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -6,7 +6,7 @@ location __PATH__/ { rewrite ^ https://$server_name$request_uri? permanent; } - proxy_pass http://127.0.0.1:__PORT__/; + proxy_pass http://127.0.0.1:__PORT____PATH__/; proxy_redirect off; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; diff --git a/scripts/change_url b/scripts/change_url index 391f4b0..152e74a 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -101,6 +101,17 @@ then ynh_store_file_checksum --file="/etc/nginx/conf.d/$new_domain.d/$app.conf" fi +#================================================= +# ADD A CONFIGURATION +#================================================= +ynh_script_progression --message="Adding a configuration file..." --weight=1 + +domain="$new_domain" +path="$new_path" +ynh_add_config --template="../conf/miniflux.conf" --destination="$final_path/$app.conf" + +chmod 600 "$final_path/$app.conf" + #================================================= # GENERIC FINALISATION #================================================= From b9cceb653cb87668da65c336358c7912ddc93f46 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 21 May 2021 15:06:33 +0200 Subject: [PATCH 7/7] Update restore --- scripts/restore | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/restore b/scripts/restore index be934f7..242c5f2 100644 --- a/scripts/restore +++ b/scripts/restore @@ -66,6 +66,7 @@ ynh_restore_file --origin_path="$final_path" chmod 750 "$final_path" chmod -R o-rwx "$final_path" +chmod +x "$final_path/miniflux" chown -R $app:www-data "$final_path" #=================================================