From 37e3e1a08392f698f5a378c8c57aada1811f75e8 Mon Sep 17 00:00:00 2001 From: Malene Lundemo Date: Wed, 19 Mar 2025 11:57:18 +0100 Subject: [PATCH 1/5] Update .env --- .env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.env b/.env index fba8e06..7d81863 100644 --- a/.env +++ b/.env @@ -1,6 +1,6 @@ GROUP_ID=15 DOMAIN=localhost -URL_PREFIX=http:// +URL_PREFIX=http://tdt4242-15.idi.ntnu.no/ PORT_PREFIX=2 DEV_POSTFIX=1 STAG_POSTFIX=2 From c78482be17873b2f89d189817ce8f1bd02fcf431 Mon Sep 17 00:00:00 2001 From: Malene Lundemo Date: Wed, 19 Mar 2025 12:02:05 +0100 Subject: [PATCH 2/5] Update update_primary_nginx.yml --- .github/workflows/update_primary_nginx.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/update_primary_nginx.yml b/.github/workflows/update_primary_nginx.yml index 4286e65..fb23ab0 100644 --- a/.github/workflows/update_primary_nginx.yml +++ b/.github/workflows/update_primary_nginx.yml @@ -23,7 +23,7 @@ jobs: #Doesn't work properly, envsubst replaces all instances of $variable and ${variable}, but we want to keep e.g., $host as nginx variables - name: Create temporary nginx config file - run: envsubst '${PROD_PORT_PREFIX} ${DEV_PORT_PREFIX} ${STAG_PORT_PREFIX} ${GATEWAY_POSTFIX}' < ./nginx_template.txt > temp_default.conf + run: envsubst '${URL_PREFIX} ${PROD_PORT_PREFIX} ${DEV_PORT_PREFIX} ${STAG_PORT_PREFIX} ${GATEWAY_POSTFIX}' < ./nginx_template.txt > temp_default.conf # Maybe look at https://www.baeldung.com/linux/envsubst-command to get an idea - name: Copy temporary file to correct place From 584743d3ad88e6a83dfabb7d79f647417a95fa08 Mon Sep 17 00:00:00 2001 From: Malene Lundemo Date: Wed, 19 Mar 2025 12:15:49 +0100 Subject: [PATCH 3/5] Update .env --- .env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.env b/.env index 7d81863..fba8e06 100644 --- a/.env +++ b/.env @@ -1,6 +1,6 @@ GROUP_ID=15 DOMAIN=localhost -URL_PREFIX=http://tdt4242-15.idi.ntnu.no/ +URL_PREFIX=http:// PORT_PREFIX=2 DEV_POSTFIX=1 STAG_POSTFIX=2 From bdc4b4b18d2cdfa109f9cb8b10a47e22973a4886 Mon Sep 17 00:00:00 2001 From: Malene Lundemo Date: Wed, 19 Mar 2025 12:16:16 +0100 Subject: [PATCH 4/5] Update update_primary_nginx.yml --- .github/workflows/update_primary_nginx.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/update_primary_nginx.yml b/.github/workflows/update_primary_nginx.yml index fb23ab0..4286e65 100644 --- a/.github/workflows/update_primary_nginx.yml +++ b/.github/workflows/update_primary_nginx.yml @@ -23,7 +23,7 @@ jobs: #Doesn't work properly, envsubst replaces all instances of $variable and ${variable}, but we want to keep e.g., $host as nginx variables - name: Create temporary nginx config file - run: envsubst '${URL_PREFIX} ${PROD_PORT_PREFIX} ${DEV_PORT_PREFIX} ${STAG_PORT_PREFIX} ${GATEWAY_POSTFIX}' < ./nginx_template.txt > temp_default.conf + run: envsubst '${PROD_PORT_PREFIX} ${DEV_PORT_PREFIX} ${STAG_PORT_PREFIX} ${GATEWAY_POSTFIX}' < ./nginx_template.txt > temp_default.conf # Maybe look at https://www.baeldung.com/linux/envsubst-command to get an idea - name: Copy temporary file to correct place From 3fa8c82e20c1d562587a868a97ec579bc3126c50 Mon Sep 17 00:00:00 2001 From: Malene Lundemo Date: Thu, 20 Mar 2025 13:08:52 +0100 Subject: [PATCH 5/5] Update update_primary_nginx.yml --- .github/workflows/update_primary_nginx.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/update_primary_nginx.yml b/.github/workflows/update_primary_nginx.yml index 4286e65..e6450a3 100644 --- a/.github/workflows/update_primary_nginx.yml +++ b/.github/workflows/update_primary_nginx.yml @@ -1,9 +1,7 @@ name: setup nginx from the configuration file on: - workflow_dispatch: - jobs: deploy: @@ -21,11 +19,11 @@ jobs: - name: Check environment variables run: env - #Doesn't work properly, envsubst replaces all instances of $variable and ${variable}, but we want to keep e.g., $host as nginx variables - name: Create temporary nginx config file run: envsubst '${PROD_PORT_PREFIX} ${DEV_PORT_PREFIX} ${STAG_PORT_PREFIX} ${GATEWAY_POSTFIX}' < ./nginx_template.txt > temp_default.conf - # Maybe look at https://www.baeldung.com/linux/envsubst-command to get an idea - name: Copy temporary file to correct place run: cp temp_default.conf /etc/nginx/conf.d/default.conf - #run: cp nginx/nginx.conf /etc/nginx/conf.d/nginx_securefit.conf + + - name: Restart nginx + run: sudo systemctl reload nginx