From b38848e403433d24fefce5dc245de3bfb8543e64 Mon Sep 17 00:00:00 2001 From: Manuel Luypaert Date: Thu, 21 Sep 2023 12:05:06 +0100 Subject: [PATCH] Moved REACT Google Oath Client ENV variable definition to buildtime (as react doesnt do runtime variables) --- Makefile | 6 +++--- ebextensions-templates/app-env.config | 1 - 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 463ac243..1c4eca63 100644 --- a/Makefile +++ b/Makefile @@ -76,10 +76,11 @@ build: clean ui-build docker/${DEPLOY_JAR} \ ./docker/ .PHONY: ui-build -ui-build: \ +ui-build: google-oauth2-secrets \ $(call print-help,ui-build,\ Build JS and CSS file for release.) - @./scripts/build-ui.sh + @ export REACT_APP_GOOGLE_OAUTH_CLIENT_ID=${GOOGLE_OAUTH_CLIENT_ID} && \ + ./scripts/build-ui.sh .PHONY: clean clean: \ @@ -129,7 +130,6 @@ ifndef GOOGLE_REDIRECT_URI endif @cp ebextensions-templates/${EB_APP_ENV_FILE} .ebextensions/ sed -i -r 's~(WB_DB_URI:\s+)".*"~\1"'"${WB_DB_URI}"'"~' .ebextensions/${EB_APP_ENV_FILE} - sed -i -r 's~(REACT_APP_GOOGLE_OAUTH_CLIENT_ID:\s+)".*"~\1"'"${GOOGLE_OAUTH_CLIENT_ID}"'"~' .ebextensions/${EB_APP_ENV_FILE} sed -i -r 's~(API_GOOGLE_OAUTH_CLIENT_ID:\s+)".*"~\1"'"${GOOGLE_OAUTH_CLIENT_ID}"'"~' .ebextensions/${EB_APP_ENV_FILE} sed -i -r 's~(API_GOOGLE_OAUTH_CLIENT_SECRET:\s+)".*"~\1"'"${GOOGLE_OAUTH_CLIENT_SECRET}"'"~' .ebextensions/${EB_APP_ENV_FILE} sed -i -r 's~(GOOGLE_REDIRECT_URI:\s+)".*"~\1"'"${GOOGLE_REDIRECT_URI}"'"~' .ebextensions/${EB_APP_ENV_FILE} diff --git a/ebextensions-templates/app-env.config b/ebextensions-templates/app-env.config index 41587bf9..ee80477e 100644 --- a/ebextensions-templates/app-env.config +++ b/ebextensions-templates/app-env.config @@ -3,7 +3,6 @@ option_settings: WB_NAMES_RELEASE: 0.0.0 WB_DB_URI: "" GOOGLE_REDIRECT_URI: "" - REACT_APP_GOOGLE_OAUTH_CLIENT_ID: "" API_GOOGLE_OAUTH_CLIENT_ID: "" API_GOOGLE_OAUTH_CLIENT_SECRET: "" _JAVA_OPTIONS: "-Xmx4g"