diff --git a/conf/nginx.conf b/conf/nginx.conf index 54b5309..6915e58 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,5 +1,5 @@ #sub_path_only rewrite ^__PATH__$ __PATH__/ permanent; -location ^~ __PATH__/ { +location __PATH__/ { # Path to source alias __INSTALL_DIR__/; @@ -33,27 +33,27 @@ location ^~ __PATH__/ { } ## disable all access to the following directories - location ^~ __PATH__/config/ { + location ~ ^__PATH__/config/ { deny all; return 403; } - location ^~ __PATH__/tmp/ { + location ~ ^__PATH__/tmp/ { deny all; return 403; } - location ^~ __PATH__/core/ { + location ~ ^__PATH__/core/ { deny all; return 403; } - location ^~ __PATH__/lang/ { + location ~ ^__PATH__/lang/ { deny all; return 403; } - location ~ __PATH__/\.ht { + location ~ ^__PATH__/\.ht { deny all; return 403; } @@ -78,7 +78,7 @@ location ^~ __PATH__/ { } ## properly display textfiles in root directory - location ~__PATH__/(.*\.md|LEGALNOTICE|LICENSE) { + location ~ ^__PATH__/(.*\.md|LEGALNOTICE|LICENSE) { default_type text/plain; } diff --git a/scripts/change_url b/scripts/change_url index fb8fd35..fc21bd7 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -18,6 +18,22 @@ ynh_script_progression --message="Updating NGINX web server configuration..." -- ynh_change_url_nginx_config +#================================================= +# SPECIFIC MODIFICATIONS +#================================================= +# RECONFIGURING MATOMO +#================================================= +ynh_script_progression --message="Reconfiguring Matomo..." --weight=2 + +if [[ -f "$install_dir/config/config.ini.php" ]]; then + # config.ini.php is only created during the post-install process... + # it is therefore not present when the CI tests are carried out... + # This condition is only for CI test to go through the upgrade process + + # See https://matomo.org/faq/how-to-install/faq_18/ + ynh_replace_string --match_string="$old_domain" --replace_string="$new_domain" --target_file="$install_dir/config/config.ini.php" +fi + #================================================= # SETUP A CRON #=================================================