From bd25ce75c5e01012a1176a9f0d6bcaa7ab845954 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Fri, 22 Mar 2024 19:57:45 +0100 Subject: [PATCH] Try to workaround crappy 404 on root with a redirect in CI --- scripts/_common.sh | 6 ++++++ scripts/install | 1 + scripts/upgrade | 1 + 3 files changed, 8 insertions(+) diff --git a/scripts/_common.sh b/scripts/_common.sh index 944a65e..4bce3fb 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -8,6 +8,12 @@ # PERSONAL HELPERS #================================================= +_ci_fix_nginx() { + if [ "${PACKAGE_CHECK_EXEC:-0}" -eq 1 ]; then + echo 'rewrite ^/$ /catalog/;' >> "/etc/nginx/conf.d/${domain}.d/$app.conf" + fi +} + #================================================= # EXPERIMENTAL HELPERS #================================================= diff --git a/scripts/install b/scripts/install index 54c5cbb..3f4a009 100755 --- a/scripts/install +++ b/scripts/install @@ -68,6 +68,7 @@ ynh_script_progression --message="Adding system configurations related to $app.. # Create a dedicated NGINX config ynh_add_nginx_config +_ci_fix_nginx # Create a dedicated systemd config ynh_add_systemd_config diff --git a/scripts/upgrade b/scripts/upgrade index 1c1a1b3..3b35296 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -70,6 +70,7 @@ ynh_script_progression --message="Upgrading system configurations related to $ap # Create a dedicated NGINX config ynh_add_nginx_config +_ci_fix_nginx # Create a dedicated systemd config ynh_add_systemd_config