From adde6141b12d5729892f0cd8e214256feb39f7c4 Mon Sep 17 00:00:00 2001 From: Kayou Date: Mon, 3 Jun 2019 17:44:21 +0200 Subject: [PATCH 1/5] Update nginx.conf --- conf/nginx.conf | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index 1e7c3ac..8bcd0eb 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -2,7 +2,7 @@ location __PATH__/ { # Path to source - root __FINALPATH__/ ; + alias __FINALPATH__/ ; # Force usage of https if ($scheme = http) { @@ -14,7 +14,13 @@ location __PATH__/ { # Common parameter to increase upload size limit in conjunction with dedicated php-fpm file client_max_body_size 50M; - try_files $uri $uri/ /index.php?$query_string; + location /yunohost/sso/ { + try_files $uri $uri/ index.php; + } + location / { + try_files $uri $uri/ @prettynoemiecms; + } + location ~ [^/]\.php(/|$) { fastcgi_split_path_info ^(.+?\.php)(/.*)$; fastcgi_pass unix:/var/run/php/php7.0-fpm-__NAME__.sock; @@ -31,6 +37,10 @@ location __PATH__/ { include conf.d/yunohost_panel.conf.inc; } +location @prettynoemiecms { + rewrite /(.*)$ /index.php?/$1 last; +} + location __PATH__/medias/ { alias __FINALPATH__/sites/$host/medias/; } From 9683c7462ca9b3f93030a84f50f698c79f404d89 Mon Sep 17 00:00:00 2001 From: Kayou Date: Mon, 3 Jun 2019 17:47:52 +0200 Subject: [PATCH 2/5] Update nginx.conf --- conf/nginx.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index 8bcd0eb..5efe3d2 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -14,10 +14,10 @@ location __PATH__/ { # Common parameter to increase upload size limit in conjunction with dedicated php-fpm file client_max_body_size 50M; - location /yunohost/sso/ { + location __PATH__/yunohost/sso/ { try_files $uri $uri/ index.php; } - location / { + location __PATH__/ { try_files $uri $uri/ @prettynoemiecms; } From 380175bb053f07126a0197b1d6f79d9c89e90e8d Mon Sep 17 00:00:00 2001 From: Kayou Date: Mon, 3 Jun 2019 18:00:53 +0200 Subject: [PATCH 3/5] Update nginx.conf --- conf/nginx.conf | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index 5efe3d2..1aa31b6 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -14,9 +14,10 @@ location __PATH__/ { # Common parameter to increase upload size limit in conjunction with dedicated php-fpm file client_max_body_size 50M; - location __PATH__/yunohost/sso/ { + location __PATH__/yunohost { try_files $uri $uri/ index.php; } + location __PATH__/ { try_files $uri $uri/ @prettynoemiecms; } @@ -38,7 +39,7 @@ location __PATH__/ { } location @prettynoemiecms { - rewrite /(.*)$ /index.php?/$1 last; + rewrite /(.*)$ __PATH__/index.php?/$1 last; } location __PATH__/medias/ { From 0471adb52b133d9a627efd89e2cbd017c86bf968 Mon Sep 17 00:00:00 2001 From: Kayou Date: Mon, 3 Jun 2019 18:28:40 +0200 Subject: [PATCH 4/5] Update nginx.conf --- conf/nginx.conf | 4 ---- 1 file changed, 4 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index 1aa31b6..05523a2 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -41,7 +41,3 @@ location __PATH__/ { location @prettynoemiecms { rewrite /(.*)$ __PATH__/index.php?/$1 last; } - -location __PATH__/medias/ { - alias __FINALPATH__/sites/$host/medias/; -} From e51d198f376171f0b83940eb3f6edcd2697670f5 Mon Sep 17 00:00:00 2001 From: Kay0u Date: Mon, 3 Jun 2019 20:43:47 +0200 Subject: [PATCH 5/5] Fix image path --- scripts/install | 3 +++ scripts/upgrade | 3 +++ 2 files changed, 6 insertions(+) diff --git a/scripts/install b/scripts/install index 3a6c241..d1fe1ce 100755 --- a/scripts/install +++ b/scripts/install @@ -146,6 +146,9 @@ ynh_app_setting_delete --app=$app --key=skipped_uris # Calculate and store the config file checksum into the app settings ynh_store_file_checksum --file="$final_path/sites/$domain/config.json" +# Fix a bug where images can't be uploaded +ynh_replace_string --match_string="isMediaPathModified = true" --replace_string="" --target_file="$final_path/app/config/config.ini" + #================================================= # GENERIC FINALIZATION #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 55a844d..23a587a 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -130,6 +130,9 @@ ynh_backup_if_checksum_is_different --file="$final_path/sites/$domain/config.jso # Recalculate and store the checksum of the file for the next upgrade. ynh_store_file_checksum --file="$final_path/sites/$domain/config.json" +# Fix a bug where images can't be uploaded +ynh_replace_string --match_string="isMediaPathModified = true" --replace_string="" --target_file="$final_path/app/config/config.ini" + #================================================= # GENERIC FINALIZATION #=================================================