From de2f191a86f45c870f0e29187d8c35c36fbaec94 Mon Sep 17 00:00:00 2001 From: Rodolphe Robles Date: Tue, 7 Apr 2020 18:03:14 +0200 Subject: [PATCH 01/17] try to make possible install on root path and change url from or to root path --- conf/nginx.conf | 4 ++-- scripts/change_url | 24 ++++++++++++++++++------ scripts/install | 7 ++++++- 3 files changed, 26 insertions(+), 9 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index a159644..fbcf8b5 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -8,13 +8,13 @@ location __PATH__ { } # Example PHP configuration (remove if not used) - index index.php; + index index.php /_route.php;; # Common parameter to increase upload size limit in conjuction with dedicated php-fpm file #client_max_body_size 50M; - try_files $uri $uri/ index.php; location ~ [^/]\.php(/|$) { + try_files $uri $uri/ index.php /_route.php; fastcgi_split_path_info ^(.+?\.php)(/.*)$; fastcgi_pass unix:/var/run/php/php7.0-fpm-__NAME__.sock; fastcgi_index index.php; diff --git a/scripts/change_url b/scripts/change_url index e768040..8b82734 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -37,13 +37,13 @@ old_path=$(ynh_normalize_url_path $old_path) change_domain=0 if [ "$old_domain" != "$new_domain" ] then - change_domain=1 + change_domain=1 fi change_path=0 if [ "$old_path" != "$new_path" ] then - change_path=1 + change_path=1 fi #================================================= @@ -58,8 +58,6 @@ final_path=/var/www/$app # Change the path in the nginx config file if [ $change_path -eq 1 ] then - # ynh_replace_string - ynh_replace_string --match_string="const WWW_URI = '$old_path/';" --replace_string="const WWW_URI = '$new_path/';" --target_file="$final_path/config.local.php" # Make a backup of the original nginx config file if modified ynh_backup_if_checksum_is_different "$nginx_conf_path" # Replace locations starting with old_path @@ -69,6 +67,21 @@ then ynh_replace_string "return \([[:digit:]]\{3\}\) $old_path" "return \1 $new_path" "$nginx_conf_path" # Calculate and store the nginx config file checksum ynh_store_file_checksum "$nginx_conf_path" + # ynh_replace_string + if old_url != "/" + then + ynh_replace_string --match_string="const WWW_URI = '$old_path/';" --replace_string="const WWW_URI = '$new_path/';" --target_file="$final_path/config.local.php" + else + ynh_replace_string --match_string="const WWW_URI = '$old_path';" --replace_string="const WWW_URI = '$new_path/';" --target_file="$final_path/config.local.php" + fi + + if new_url != "/" + then + ynh_replace_string --match_string="const WWW_URI = '$old_path/';" --replace_string="const WWW_URI = '$new_path/';" --target_file="$final_path/config.local.php" + else + ynh_replace_string --match_string="const WWW_URI = '$old_path/';" --replace_string="const WWW_URI = '$new_path';" --target_file="$final_path/config.local.php" + fi + fi @@ -77,10 +90,9 @@ if [ $change_domain -eq 1 ] then # Delete file checksum for the old conf file location ynh_delete_file_checksum "$nginx_conf_path" - mv $nginx_conf_path /etc/nginx/conf.d/$new_domain.d/$app.conf + mv $nginx_conf_path /etc/nginx/conf.d/$new_domain.d/$app.conf # Store file checksum for the new config file location ynh_store_file_checksum "/etc/nginx/conf.d/$new_domain.d/$app.conf" - # ynh_replace_string fi # GENERIC FINALISATION diff --git a/scripts/install b/scripts/install index 7327a06..ccf548f 100644 --- a/scripts/install +++ b/scripts/install @@ -88,8 +88,13 @@ cp -a $final_path/config.dist.php $final_path/config.local.php # ynh_replace_string --match_string="const ROOT = __DIR__;" --replace_string="const ROOT = /var/www/garradin/;" --target_file="$final_path/config.local.php" ynh_replace_string --match_string="const PREFER_HTTPS = false;" --replace_string="const PREFER_HTTPS = true;" --target_file="$final_path/config.local.php" -ynh_replace_string --match_string="//const WWW_URI = '/asso/';" --replace_string="const WWW_URI = '$path_url/';" --target_file="$final_path/config.local.php" +if path_url != "/" +then + ynh_replace_string --match_string="//const WWW_URI = '/asso/';" --replace_string="const WWW_URI = '$path_url/';" --target_file="$final_path/config.local.php" +else + ynh_replace_string --match_string="//const WWW_URI = '/asso/';" --replace_string="const WWW_URI = '$path_url';" --target_file="$final_path/config.local.php" +fi #================================================= # Files owned by user app #================================================= From 8e416c03522136211a287eb142405a50aab80e4e Mon Sep 17 00:00:00 2001 From: Rodolphe Robles Date: Tue, 7 Apr 2020 18:08:24 +0200 Subject: [PATCH 02/17] try to make possible install on root path and change url from or to root path --- scripts/change_url | 4 ++-- scripts/install | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/change_url b/scripts/change_url index 8b82734..f8e1b03 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -68,14 +68,14 @@ then # Calculate and store the nginx config file checksum ynh_store_file_checksum "$nginx_conf_path" # ynh_replace_string - if old_url != "/" + if $old_url != "/" then ynh_replace_string --match_string="const WWW_URI = '$old_path/';" --replace_string="const WWW_URI = '$new_path/';" --target_file="$final_path/config.local.php" else ynh_replace_string --match_string="const WWW_URI = '$old_path';" --replace_string="const WWW_URI = '$new_path/';" --target_file="$final_path/config.local.php" fi - if new_url != "/" + if $new_url != "/" then ynh_replace_string --match_string="const WWW_URI = '$old_path/';" --replace_string="const WWW_URI = '$new_path/';" --target_file="$final_path/config.local.php" else diff --git a/scripts/install b/scripts/install index ccf548f..ec0bd7f 100644 --- a/scripts/install +++ b/scripts/install @@ -89,7 +89,7 @@ cp -a $final_path/config.dist.php $final_path/config.local.php # ynh_replace_string --match_string="const ROOT = __DIR__;" --replace_string="const ROOT = /var/www/garradin/;" --target_file="$final_path/config.local.php" ynh_replace_string --match_string="const PREFER_HTTPS = false;" --replace_string="const PREFER_HTTPS = true;" --target_file="$final_path/config.local.php" -if path_url != "/" +if $path_url != "/" then ynh_replace_string --match_string="//const WWW_URI = '/asso/';" --replace_string="const WWW_URI = '$path_url/';" --target_file="$final_path/config.local.php" else From 8297a8050b841f090a372fd89ce22a030f62a552 Mon Sep 17 00:00:00 2001 From: Rodolphe Robles Date: Tue, 7 Apr 2020 18:16:27 +0200 Subject: [PATCH 03/17] try to make possible install on root path and change url from or to root path --- scripts/change_url | 4 ++-- scripts/install | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/change_url b/scripts/change_url index f8e1b03..c8c18e1 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -68,14 +68,14 @@ then # Calculate and store the nginx config file checksum ynh_store_file_checksum "$nginx_conf_path" # ynh_replace_string - if $old_url != "/" + if $old_url != / then ynh_replace_string --match_string="const WWW_URI = '$old_path/';" --replace_string="const WWW_URI = '$new_path/';" --target_file="$final_path/config.local.php" else ynh_replace_string --match_string="const WWW_URI = '$old_path';" --replace_string="const WWW_URI = '$new_path/';" --target_file="$final_path/config.local.php" fi - if $new_url != "/" + if $new_url != / then ynh_replace_string --match_string="const WWW_URI = '$old_path/';" --replace_string="const WWW_URI = '$new_path/';" --target_file="$final_path/config.local.php" else diff --git a/scripts/install b/scripts/install index ec0bd7f..10c1b7e 100644 --- a/scripts/install +++ b/scripts/install @@ -89,7 +89,7 @@ cp -a $final_path/config.dist.php $final_path/config.local.php # ynh_replace_string --match_string="const ROOT = __DIR__;" --replace_string="const ROOT = /var/www/garradin/;" --target_file="$final_path/config.local.php" ynh_replace_string --match_string="const PREFER_HTTPS = false;" --replace_string="const PREFER_HTTPS = true;" --target_file="$final_path/config.local.php" -if $path_url != "/" +if $path_url != / then ynh_replace_string --match_string="//const WWW_URI = '/asso/';" --replace_string="const WWW_URI = '$path_url/';" --target_file="$final_path/config.local.php" else From f0d6e0116aca4394efc200edc49e2d5605f88823 Mon Sep 17 00:00:00 2001 From: Rodolphe Robles Date: Tue, 7 Apr 2020 18:18:40 +0200 Subject: [PATCH 04/17] try to make possible install on root path and change url from or to root path --- conf/nginx.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index fbcf8b5..5292783 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -8,13 +8,13 @@ location __PATH__ { } # Example PHP configuration (remove if not used) - index index.php /_route.php;; + index index.php; # Common parameter to increase upload size limit in conjuction with dedicated php-fpm file #client_max_body_size 50M; location ~ [^/]\.php(/|$) { - try_files $uri $uri/ index.php /_route.php; + try_files $uri $uri/ index.php; fastcgi_split_path_info ^(.+?\.php)(/.*)$; fastcgi_pass unix:/var/run/php/php7.0-fpm-__NAME__.sock; fastcgi_index index.php; From 853c60a09217e52d4889fe348bc386d067daa3fa Mon Sep 17 00:00:00 2001 From: Rodolphe Robles Date: Tue, 7 Apr 2020 18:22:25 +0200 Subject: [PATCH 05/17] try to make possible install on root path and change url from or to root path --- scripts/install | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index 10c1b7e..32c262b 100644 --- a/scripts/install +++ b/scripts/install @@ -91,9 +91,9 @@ ynh_replace_string --match_string="const PREFER_HTTPS = false;" --replace_string if $path_url != / then - ynh_replace_string --match_string="//const WWW_URI = '/asso/';" --replace_string="const WWW_URI = '$path_url/';" --target_file="$final_path/config.local.php" + ynh_replace_string --match_string="//const WWW_URI = '/asso/';" --replace_string="const WWW_URI = '$path_url';" --target_file="$final_path/config.local.php" else - ynh_replace_string --match_string="//const WWW_URI = '/asso/';" --replace_string="const WWW_URI = '$path_url';" --target_file="$final_path/config.local.php" + ynh_replace_string --match_string="//const WWW_URI = '/asso/';" --replace_string="const WWW_URI = '$path_url/';" --target_file="$final_path/config.local.php" fi #================================================= # Files owned by user app From 002c6b1d449a346525d1b09b87c57081317698f6 Mon Sep 17 00:00:00 2001 From: Rodolphe Robles Date: Tue, 7 Apr 2020 18:32:12 +0200 Subject: [PATCH 06/17] try to make possible install on root path and change url from or to root path --- conf/nginx.conf | 2 +- scripts/install | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index 5292783..3b36f07 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -8,7 +8,7 @@ location __PATH__ { } # Example PHP configuration (remove if not used) - index index.php; + # index index.php; # Common parameter to increase upload size limit in conjuction with dedicated php-fpm file #client_max_body_size 50M; diff --git a/scripts/install b/scripts/install index 32c262b..10c1b7e 100644 --- a/scripts/install +++ b/scripts/install @@ -91,9 +91,9 @@ ynh_replace_string --match_string="const PREFER_HTTPS = false;" --replace_string if $path_url != / then - ynh_replace_string --match_string="//const WWW_URI = '/asso/';" --replace_string="const WWW_URI = '$path_url';" --target_file="$final_path/config.local.php" + ynh_replace_string --match_string="//const WWW_URI = '/asso/';" --replace_string="const WWW_URI = '$path_url/';" --target_file="$final_path/config.local.php" else - ynh_replace_string --match_string="//const WWW_URI = '/asso/';" --replace_string="const WWW_URI = '$path_url/';" --target_file="$final_path/config.local.php" + ynh_replace_string --match_string="//const WWW_URI = '/asso/';" --replace_string="const WWW_URI = '$path_url';" --target_file="$final_path/config.local.php" fi #================================================= # Files owned by user app From 1a99a69f7c5f36293744191a2b72bb020536d1ec Mon Sep 17 00:00:00 2001 From: Rodolphe Robles Date: Tue, 7 Apr 2020 18:52:49 +0200 Subject: [PATCH 07/17] try to make possible install on root path and change url from or to root path --- scripts/install | 2 -- 1 file changed, 2 deletions(-) diff --git a/scripts/install b/scripts/install index 10c1b7e..d150526 100644 --- a/scripts/install +++ b/scripts/install @@ -92,8 +92,6 @@ ynh_replace_string --match_string="const PREFER_HTTPS = false;" --replace_string if $path_url != / then ynh_replace_string --match_string="//const WWW_URI = '/asso/';" --replace_string="const WWW_URI = '$path_url/';" --target_file="$final_path/config.local.php" -else - ynh_replace_string --match_string="//const WWW_URI = '/asso/';" --replace_string="const WWW_URI = '$path_url';" --target_file="$final_path/config.local.php" fi #================================================= # Files owned by user app From 7e4b9eca7631b94044cd4873a1bbce61a52e9389 Mon Sep 17 00:00:00 2001 From: Rodolphe Robles Date: Tue, 7 Apr 2020 19:00:57 +0200 Subject: [PATCH 08/17] try to make possible install on root path and change url from or to root path --- conf/nginx.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index 3b36f07..7c4f09a 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -8,13 +8,13 @@ location __PATH__ { } # Example PHP configuration (remove if not used) - # index index.php; + index index.php /_route.php; # Common parameter to increase upload size limit in conjuction with dedicated php-fpm file #client_max_body_size 50M; location ~ [^/]\.php(/|$) { - try_files $uri $uri/ index.php; + try_files $uri $uri/ index.php /_route.php; fastcgi_split_path_info ^(.+?\.php)(/.*)$; fastcgi_pass unix:/var/run/php/php7.0-fpm-__NAME__.sock; fastcgi_index index.php; From a4ada7041111efc29373508da392a47e64543d4a Mon Sep 17 00:00:00 2001 From: Rodolphe Robles Date: Tue, 7 Apr 2020 19:05:40 +0200 Subject: [PATCH 09/17] try to make possible install on root path and change url from or to root path --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index d150526..a6d34a4 100644 --- a/scripts/install +++ b/scripts/install @@ -89,7 +89,7 @@ cp -a $final_path/config.dist.php $final_path/config.local.php # ynh_replace_string --match_string="const ROOT = __DIR__;" --replace_string="const ROOT = /var/www/garradin/;" --target_file="$final_path/config.local.php" ynh_replace_string --match_string="const PREFER_HTTPS = false;" --replace_string="const PREFER_HTTPS = true;" --target_file="$final_path/config.local.php" -if $path_url != / +if $path_url != '/' then ynh_replace_string --match_string="//const WWW_URI = '/asso/';" --replace_string="const WWW_URI = '$path_url/';" --target_file="$final_path/config.local.php" fi From 7fbd49baada7ff30d043c31353dcc498e1911442 Mon Sep 17 00:00:00 2001 From: Rodolphe Robles Date: Tue, 7 Apr 2020 19:09:51 +0200 Subject: [PATCH 10/17] try to make possible install on root path and change url from or to root path --- scripts/install | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/scripts/install b/scripts/install index a6d34a4..7327a06 100644 --- a/scripts/install +++ b/scripts/install @@ -88,11 +88,8 @@ cp -a $final_path/config.dist.php $final_path/config.local.php # ynh_replace_string --match_string="const ROOT = __DIR__;" --replace_string="const ROOT = /var/www/garradin/;" --target_file="$final_path/config.local.php" ynh_replace_string --match_string="const PREFER_HTTPS = false;" --replace_string="const PREFER_HTTPS = true;" --target_file="$final_path/config.local.php" +ynh_replace_string --match_string="//const WWW_URI = '/asso/';" --replace_string="const WWW_URI = '$path_url/';" --target_file="$final_path/config.local.php" -if $path_url != '/' -then - ynh_replace_string --match_string="//const WWW_URI = '/asso/';" --replace_string="const WWW_URI = '$path_url/';" --target_file="$final_path/config.local.php" -fi #================================================= # Files owned by user app #================================================= From d123e8a6d6306cacfe5fabf05e62e94514f0019c Mon Sep 17 00:00:00 2001 From: Rodolphe Robles Date: Tue, 7 Apr 2020 19:19:15 +0200 Subject: [PATCH 11/17] try to make possible install on root path and change url from or to root path --- conf/nginx.conf | 2 +- scripts/change_url | 15 +-------------- 2 files changed, 2 insertions(+), 15 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index 7c4f09a..265611a 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -8,7 +8,7 @@ location __PATH__ { } # Example PHP configuration (remove if not used) - index index.php /_route.php; + # index index.php /_route.php; # Common parameter to increase upload size limit in conjuction with dedicated php-fpm file #client_max_body_size 50M; diff --git a/scripts/change_url b/scripts/change_url index c8c18e1..96e3e4a 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -68,20 +68,7 @@ then # Calculate and store the nginx config file checksum ynh_store_file_checksum "$nginx_conf_path" # ynh_replace_string - if $old_url != / - then - ynh_replace_string --match_string="const WWW_URI = '$old_path/';" --replace_string="const WWW_URI = '$new_path/';" --target_file="$final_path/config.local.php" - else - ynh_replace_string --match_string="const WWW_URI = '$old_path';" --replace_string="const WWW_URI = '$new_path/';" --target_file="$final_path/config.local.php" - fi - - if $new_url != / - then - ynh_replace_string --match_string="const WWW_URI = '$old_path/';" --replace_string="const WWW_URI = '$new_path/';" --target_file="$final_path/config.local.php" - else - ynh_replace_string --match_string="const WWW_URI = '$old_path/';" --replace_string="const WWW_URI = '$new_path';" --target_file="$final_path/config.local.php" - fi - + ynh_replace_string --match_string="const WWW_URI = '$old_path/';" --replace_string="const WWW_URI = '$new_path/';" --target_file="$final_path/config.local.php" fi From 05cc520dd9b170a55d8a9a7db2b5e28323eade6d Mon Sep 17 00:00:00 2001 From: Rodolphe Robles Date: Tue, 7 Apr 2020 19:46:56 +0200 Subject: [PATCH 12/17] try to make possible install on root path and change url from or to root path --- conf/nginx.conf | 4 ++-- scripts/install | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index 265611a..5292783 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -8,13 +8,13 @@ location __PATH__ { } # Example PHP configuration (remove if not used) - # index index.php /_route.php; + index index.php; # Common parameter to increase upload size limit in conjuction with dedicated php-fpm file #client_max_body_size 50M; location ~ [^/]\.php(/|$) { - try_files $uri $uri/ index.php /_route.php; + try_files $uri $uri/ index.php; fastcgi_split_path_info ^(.+?\.php)(/.*)$; fastcgi_pass unix:/var/run/php/php7.0-fpm-__NAME__.sock; fastcgi_index index.php; diff --git a/scripts/install b/scripts/install index 7327a06..d7f6478 100644 --- a/scripts/install +++ b/scripts/install @@ -89,6 +89,7 @@ cp -a $final_path/config.dist.php $final_path/config.local.php # ynh_replace_string --match_string="const ROOT = __DIR__;" --replace_string="const ROOT = /var/www/garradin/;" --target_file="$final_path/config.local.php" ynh_replace_string --match_string="const PREFER_HTTPS = false;" --replace_string="const PREFER_HTTPS = true;" --target_file="$final_path/config.local.php" ynh_replace_string --match_string="//const WWW_URI = '/asso/';" --replace_string="const WWW_URI = '$path_url/';" --target_file="$final_path/config.local.php" +ynh_replace_string --match_string="const ROOT = __DIR__;" --replace_string="const ROOT = '/var/www/garradin/www';" --target_file="$final_path/config.local.php" #================================================= # Files owned by user app From ea6749662d8e60c0aff7d08cbdb0b56baf9fbccc Mon Sep 17 00:00:00 2001 From: Rodolphe Robles Date: Tue, 7 Apr 2020 20:00:37 +0200 Subject: [PATCH 13/17] try to make possible install on root path and change url from or to root path --- conf/nginx.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index 5292783..bcfc888 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -8,13 +8,13 @@ location __PATH__ { } # Example PHP configuration (remove if not used) - index index.php; # Common parameter to increase upload size limit in conjuction with dedicated php-fpm file #client_max_body_size 50M; location ~ [^/]\.php(/|$) { - try_files $uri $uri/ index.php; + try_files $uri $uri/ index.php /routes.php; + index index.php /_route.php; fastcgi_split_path_info ^(.+?\.php)(/.*)$; fastcgi_pass unix:/var/run/php/php7.0-fpm-__NAME__.sock; fastcgi_index index.php; From efecd9f88fed8910a7f113dff706b4d1c9ac1a6f Mon Sep 17 00:00:00 2001 From: Rodolphe Robles Date: Tue, 7 Apr 2020 20:26:17 +0200 Subject: [PATCH 14/17] come back to precedent config por nginx --- conf/nginx.conf | 6 +++--- scripts/install | 1 - 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index bcfc888..36a7e15 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -8,13 +8,13 @@ location __PATH__ { } # Example PHP configuration (remove if not used) + index index.php; # Common parameter to increase upload size limit in conjuction with dedicated php-fpm file #client_max_body_size 50M; + try_files $uri $uri/ index.php; location ~ [^/]\.php(/|$) { - try_files $uri $uri/ index.php /routes.php; - index index.php /_route.php; fastcgi_split_path_info ^(.+?\.php)(/.*)$; fastcgi_pass unix:/var/run/php/php7.0-fpm-__NAME__.sock; fastcgi_index index.php; @@ -27,4 +27,4 @@ location __PATH__ { # Include SSOWAT user panel. include conf.d/yunohost_panel.conf.inc; -} +} \ No newline at end of file diff --git a/scripts/install b/scripts/install index d7f6478..7327a06 100644 --- a/scripts/install +++ b/scripts/install @@ -89,7 +89,6 @@ cp -a $final_path/config.dist.php $final_path/config.local.php # ynh_replace_string --match_string="const ROOT = __DIR__;" --replace_string="const ROOT = /var/www/garradin/;" --target_file="$final_path/config.local.php" ynh_replace_string --match_string="const PREFER_HTTPS = false;" --replace_string="const PREFER_HTTPS = true;" --target_file="$final_path/config.local.php" ynh_replace_string --match_string="//const WWW_URI = '/asso/';" --replace_string="const WWW_URI = '$path_url/';" --target_file="$final_path/config.local.php" -ynh_replace_string --match_string="const ROOT = __DIR__;" --replace_string="const ROOT = '/var/www/garradin/www';" --target_file="$final_path/config.local.php" #================================================= # Files owned by user app From 135ac5033dfe48e8cc847910b3eff4295a4b4ac2 Mon Sep 17 00:00:00 2001 From: Rodolphe Robles Date: Tue, 7 Apr 2020 23:46:46 +0200 Subject: [PATCH 15/17] just a test to watch if it is possible like this install on root path --- scripts/change_url | 10 +++++++--- scripts/install | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/scripts/change_url b/scripts/change_url index 96e3e4a..682215d 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -68,9 +68,13 @@ then # Calculate and store the nginx config file checksum ynh_store_file_checksum "$nginx_conf_path" # ynh_replace_string - ynh_replace_string --match_string="const WWW_URI = '$old_path/';" --replace_string="const WWW_URI = '$new_path/';" --target_file="$final_path/config.local.php" -fi - + if [ $new_path != '/' ] + then + ynh_replace_string --match_string="const WWW_URI = '$old_path/';" --replace_string="const WWW_URI = '$new_path/';" --target_file="$final_path/config.local.php" + else + ynh_replace_string --match_string="const WWW_URI = '$old_path/';" --replace_string="const WWW_URI = '/';" --target_file="$final_path/config.local.php" + fi +fi # Change the domain for nginx if [ $change_domain -eq 1 ] diff --git a/scripts/install b/scripts/install index 7327a06..5c34850 100644 --- a/scripts/install +++ b/scripts/install @@ -88,7 +88,7 @@ cp -a $final_path/config.dist.php $final_path/config.local.php # ynh_replace_string --match_string="const ROOT = __DIR__;" --replace_string="const ROOT = /var/www/garradin/;" --target_file="$final_path/config.local.php" ynh_replace_string --match_string="const PREFER_HTTPS = false;" --replace_string="const PREFER_HTTPS = true;" --target_file="$final_path/config.local.php" -ynh_replace_string --match_string="//const WWW_URI = '/asso/';" --replace_string="const WWW_URI = '$path_url/';" --target_file="$final_path/config.local.php" +ynh_replace_string --match_string="//const WWW_URI = '/asso/';" --replace_string="const WWW_URI = '/';" --target_file="$final_path/config.local.php" #================================================= # Files owned by user app From 7536ad48829765989a364832524761125cc6b009 Mon Sep 17 00:00:00 2001 From: Rodolphe Robles Date: Wed, 8 Apr 2020 00:29:27 +0200 Subject: [PATCH 16/17] come back to this code, have not found how to install on root path with this version --- scripts/change_url | 7 +------ scripts/install | 4 ++-- scripts/upgrade | 1 - 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/scripts/change_url b/scripts/change_url index 682215d..ce53487 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -68,12 +68,7 @@ then # Calculate and store the nginx config file checksum ynh_store_file_checksum "$nginx_conf_path" # ynh_replace_string - if [ $new_path != '/' ] - then - ynh_replace_string --match_string="const WWW_URI = '$old_path/';" --replace_string="const WWW_URI = '$new_path/';" --target_file="$final_path/config.local.php" - else - ynh_replace_string --match_string="const WWW_URI = '$old_path/';" --replace_string="const WWW_URI = '/';" --target_file="$final_path/config.local.php" - fi + ynh_replace_string --match_string="const WWW_URI = '$old_path/';" --replace_string="const WWW_URI = '$new_path/';" --target_file="$final_path/config.local.php" fi # Change the domain for nginx diff --git a/scripts/install b/scripts/install index 5c34850..b11cf9a 100644 --- a/scripts/install +++ b/scripts/install @@ -87,8 +87,8 @@ ynh_setup_source --dest_dir="$final_path" cp -a $final_path/config.dist.php $final_path/config.local.php # ynh_replace_string --match_string="const ROOT = __DIR__;" --replace_string="const ROOT = /var/www/garradin/;" --target_file="$final_path/config.local.php" -ynh_replace_string --match_string="const PREFER_HTTPS = false;" --replace_string="const PREFER_HTTPS = true;" --target_file="$final_path/config.local.php" -ynh_replace_string --match_string="//const WWW_URI = '/asso/';" --replace_string="const WWW_URI = '/';" --target_file="$final_path/config.local.php" +# ynh_replace_string --match_string="const PREFER_HTTPS = false;" --replace_string="const PREFER_HTTPS = true;" --target_file="$final_path/config.local.php" +ynh_replace_string --match_string="//const WWW_URI = '/asso/';" --replace_string="const WWW_URI = '$path_url/';" --target_file="$final_path/config.local.php" #================================================= # Files owned by user app diff --git a/scripts/upgrade b/scripts/upgrade index 06ddfde..e92853f 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -148,7 +148,6 @@ fi cp -a $final_path/config.dist.php $final_path/config.local.php # ynh_replace_string --match_string="const ROOT = __DIR__;" --replace_string="const ROOT = /var/www/garradin/;" --target_file="$final_path/config.local.php" -ynh_replace_string --match_string="const PREFER_HTTPS = false;" --replace_string="const PREFER_HTTPS = true;" --target_file="$final_path/config.local.php" ynh_replace_string --match_string="//const WWW_URI = '/asso/';" --replace_string="const WWW_URI = '$path_url/';" --target_file="$final_path/config.local.php" #================================================= From 896c1f39273689df3fe31493c7a731d33daa69c6 Mon Sep 17 00:00:00 2001 From: Rodolphe Robles Date: Wed, 8 Apr 2020 00:33:18 +0200 Subject: [PATCH 17/17] but back check_up as origin --- check_process | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/check_process b/check_process index b1210b1..b25c98b 100644 --- a/check_process +++ b/check_process @@ -6,7 +6,7 @@ ; Checks pkg_linter=1 setup_sub_dir=1 - setup_root=0 + setup_root=1 setup_nourl=0 setup_private=1 setup_public=1 @@ -15,7 +15,7 @@ multi_instance=1 incorrect_path=1 port_already_use=0 - change_url=1 + change_url=0 ;;; Levels Level 1=auto Level 2=auto