From c6f33a231c5788e3d8c5a7e1b692783cdf0771c5 Mon Sep 17 00:00:00 2001 From: tituspijean Date: Sat, 5 Dec 2020 12:37:00 +0100 Subject: [PATCH 1/3] Fix NGINX paths --- conf/nginx.conf | 3 +-- scripts/change_url | 11 ----------- scripts/install | 7 ------- scripts/upgrade | 7 ------- 4 files changed, 1 insertion(+), 27 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index 576ce49..6b103cd 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -11,8 +11,7 @@ location __PATH__/ { index index.php; # Bug in Nginx with locations and aliases (see http://stackoverflow.com/a/35102259 ) - try_files $uri $uri/ __PATH_HACK__/index.php?$query_string; - #if (!-e $request_filename) { rewrite ^ __PATH_HACK__/index.php last; } + try_files $uri $uri/ __PATH__/__PATH__/index.php?$query_string; location ~* \.php$ { fastcgi_split_path_info ^(.+.php)(/.+)$; diff --git a/scripts/change_url b/scripts/change_url index c56b44f..f6d417d 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -29,11 +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) -# Add settings here as needed by your application -#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 #================================================= @@ -84,12 +79,6 @@ then # Set global variables for nginx helper domain="$old_domain" path_url="$new_path" - # Bug in Nginx with locations and aliases (see http://stackoverflow.com/a/35102259 ) - if [ $path_url = "/" ]; then - ynh_replace_string "__PATH_HACK__" "" "../conf/nginx.conf" - else - ynh_replace_string "__PATH_HACK__" "$path_url" "../conf/nginx.conf" - fi # Create a dedicated nginx config ynh_add_nginx_config fi diff --git a/scripts/install b/scripts/install index d734853..6151707 100644 --- a/scripts/install +++ b/scripts/install @@ -97,13 +97,6 @@ ynh_setup_source --dest_dir="$final_path" # NGINX CONFIGURATION #================================================= -# Bug in Nginx with locations and aliases (see http://stackoverflow.com/a/35102259 ) -if [ $path_url = "/" ]; then - ynh_replace_string "__PATH_HACK__" "" "../conf/nginx.conf" -else - ynh_replace_string "__PATH_HACK__" "$path_url/$path_url" "../conf/nginx.conf" -fi - # Create a dedicated nginx config ynh_add_nginx_config diff --git a/scripts/upgrade b/scripts/upgrade index 0e92323..7baaacf 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -160,13 +160,6 @@ fi #================================================= ynh_script_progression --message="Upgrading nginx web server configuration..." --weight=1 -# Bug in Nginx with locations and aliases (see http://stackoverflow.com/a/35102259 ) -if [ $path_url = "/" ]; then - ynh_replace_string "__PATH_HACK__" "" "../conf/nginx.conf" -else - ynh_replace_string "__PATH_HACK__" "$path_url/$path_url" "../conf/nginx.conf" -fi - # Create a dedicated nginx config ynh_add_nginx_config From cc702ac55b6022e33fe1d7048500f021d966cf96 Mon Sep 17 00:00:00 2001 From: tituspijean Date: Sat, 5 Dec 2020 12:40:28 +0100 Subject: [PATCH 2/3] Tune progression weights --- scripts/install | 6 +++--- scripts/upgrade | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/install b/scripts/install index 6151707..fcb7dc7 100644 --- a/scripts/install +++ b/scripts/install @@ -69,7 +69,7 @@ ynh_app_setting_set --app=$app --key=ssowat_version --value=$ssowat_version #================================================= # INSTALL DEPENDENCIES #================================================= -ynh_script_progression --message="Installing dependencies..." --weight=1 +ynh_script_progression --message="Installing dependencies..." --weight=2 ynh_install_app_dependencies $pkg_dependencies @@ -87,7 +87,7 @@ ynh_app_setting_set --app=$app --key=db_pwd --value=$db_pwd #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= -ynh_script_progression --message="Setting up source files..." --weight=7 +ynh_script_progression --message="Setting up source files..." --weight=3 ynh_app_setting_set --app=$app --key=final_path --value=$final_path # Download, check integrity, uncompress and patch the source from app.src @@ -131,7 +131,7 @@ ynh_add_swap --size=$swap_needed #================================================= # INSTALL COMPOSER DEPENDENCIES #================================================= -ynh_script_progression --message="Installing composer dependencies..." +ynh_script_progression --message="Installing composer dependencies..." --weight=5 ynh_exec_warn_less ynh_install_composer --user=$app --phpversion="$phpversion" --workdir="$final_path" diff --git a/scripts/upgrade b/scripts/upgrade index 7baaacf..47c5bfc 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -166,7 +166,7 @@ ynh_add_nginx_config #================================================= # UPGRADE DEPENDENCIES #================================================= -ynh_script_progression --message="Upgrading dependencies..." --weight=1 +ynh_script_progression --message="Upgrading dependencies..." --weight=2 ynh_install_app_dependencies $pkg_dependencies @@ -204,7 +204,7 @@ ynh_add_swap --size=$swap_needed if [ "$upgrade_type" == "UPGRADE_APP" ] then - ynh_script_progression --message="Installing composer dependencies..." + ynh_script_progression --message="Installing composer dependencies..." --weight=5 # Set right permissions chown -R $app:www-data $final_path From 6856982ed77e7535db614804bd15218d2cfa201f Mon Sep 17 00:00:00 2001 From: tituspijean Date: Sat, 5 Dec 2020 12:40:56 +0100 Subject: [PATCH 3/3] Bump package version --- manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index f33ccfd..24f7fdc 100644 --- a/manifest.json +++ b/manifest.json @@ -7,7 +7,7 @@ "fr": "Un forum de nouvelle génération, simplement.", "de": "Forum der nächsten Generation leicht gemacht." }, - "version": "0.1.0-beta.14~ynh1", + "version": "0.1.0-beta.14~ynh2", "url": "http://flarum.org/", "license": "MIT", "maintainer": {