From 70ad6e925c5f5f5cc1fa8a61f1aff3fc3353eeee Mon Sep 17 00:00:00 2001 From: anmol26s <5068843+anmol26s@users.noreply.github.com> Date: Wed, 26 Sep 2018 14:03:25 +0530 Subject: [PATCH] Sub-path fix and allow users to register other then yunohost (#4) * nginx fix for sub-path * sab-path fix https://github.com/YunoHost-Apps/yourls_ynh/issues/3 * sab-path fix * Registraion of other users then YNH --- check_process | 2 +- conf/nginx.conf | 2 +- manifest.json | 4 ++-- scripts/install | 5 +++++ 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/check_process b/check_process index 88fd2ab..a2a129d 100644 --- a/check_process +++ b/check_process @@ -7,7 +7,7 @@ ; Manifest domain="domain.tld" (DOMAIN) path="/path" (PATH) - admin="john" (USER) + admin="john" (admin) password="yourls123" (password) ; Checks pkg_linter=1 diff --git a/conf/nginx.conf b/conf/nginx.conf index dfff1a6..686b543 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -6,7 +6,7 @@ location __PATH__ { rewrite ^ https://$server_name$request_uri? permanent; } - try_files $uri $uri/ /yourls-loader.php; + try_files $uri $uri/ __PATHTOCHANGE__/yourls-loader.php; index index.php index.html index.htm; diff --git a/manifest.json b/manifest.json index cb65077..5b795f0 100644 --- a/manifest.json +++ b/manifest.json @@ -51,9 +51,9 @@ }, { "name": "admin", - "type": "user", + "type": "admin", "ask": { - "en": "Choose the Yourls administrator (can be other then YunoHOst registered user)", + "en": "Choose a Yourls administrator (can be other then YunoHost registered user)", "fr": "Administrateur du site Yourls" }, "example": "yoda" diff --git a/scripts/install b/scripts/install index d32b6c3..ebab6e4 100644 --- a/scripts/install +++ b/scripts/install @@ -86,6 +86,11 @@ ynh_setup_source "$final_path" #================================================= # Create a dedicated nginx config +if [ "$path_url" != "/" ]; then + ynh_replace_string "__PATHTOCHANGE__" "$path_url" "../conf/nginx.conf" +else + ynh_replace_string "__PATHTOCHANGE__" " " "../conf/nginx.conf" +fi ynh_add_nginx_config #=================================================