Skip to content

Commit

Permalink
Merge pull request #96 from tawoe/prestart
Browse files Browse the repository at this point in the history
Prestart
  • Loading branch information
simonredfern authored Feb 28, 2025
2 parents ceb148a + 5918055 commit ca6f202
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
11 changes: 11 additions & 0 deletions Dockerfiles/Dockerfile_frontend
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,17 @@ COPY Dockerfiles/go.mod ./
RUN go build -v -o /usr/src/app/prestart

FROM registry.access.redhat.com/ubi9/nginx-120

ENV VITE_OBP_LOGO_URL=https://static.openbankproject.com/images/obp_logo.png \
VITE_OBP_API_VERSION='v5.1.0' \
VITE_OBP_LINKS_COLOR='#39455f' \
VITE_OBP_HEADER_LINKS_COLOR='#52b165' \
VITE_OBP_HEADER_LINKS_HOVER_COLOR='#39455f' \
VITE_OBP_HEADER_LINKS_BACKGROUND_COLOR='#eef0f4' \
VITE_OBP_API_DEFAULT_RESOURCE_DOC_VERSION=OBPv5.1.0 \
VITE_CHATBOT_ENABLED=false \
VITE_SHOW_API_MANAGER_BUTTON=false

USER 0
RUN dnf update -y
RUN chown -R 1001 /var/log/nginx
Expand Down
3 changes: 2 additions & 1 deletion Dockerfiles/frontend_build.env
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ VITE_OBP_HEADER_LINKS_HOVER_COLOR=VITE_OBP_HEADER_LINKS_HOVER_COLOR
VITE_OBP_HEADER_LINKS_BACKGROUND_COLOR=VITE_OBP_HEADER_LINKS_BACKGROUND_COLOR
VITE_OBP_API_DEFAULT_RESOURCE_DOC_VERSION=VITE_OBP_API_DEFAULT_RESOURCE_DOC_VERSION
VITE_CHATBOT_ENABLED=VITE_CHATBOT_ENABLED
VITE_CHATBOT_URL=VITE_CHATBOT_URL
VITE_CHATBOT_URL=VITE_CHATBOT_URL
VITE_SHOW_API_MANAGER_BUTTON=VITE_SHOW_API_MANAGER_BUTTON
2 changes: 1 addition & 1 deletion Dockerfiles/prestart.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func main() {
// url config variables are expected to be a valid URL in the container environment
url_config := []string{"VITE_OBP_API_HOST", "VITE_OBP_API_MANAGER_HOST", "VITE_OBP_API_PORTAL_HOST", "VITE_OBP_LOGO_URL"}
// DANGERZONE: The following strings will be replaced by container environment variables without any checking of whatever!!!
config := []string{"VITE_OBP_API_VERSION", "VITE_OBP_LINKS_COLOR", "VITE_OBP_HEADER_LINKS_COLOR", "VITE_OBP_HEADER_LINKS_HOVER_COLOR", "VITE_OBP_HEADER_LINKS_BACKGROUND_COLOR", "VITE_OBP_API_DEFAULT_RESOURCE_DOC_VERSION", "VITE_CHATBOT_ENABLED", "VITE_CHATBOT_URL"}
config := []string{"VITE_OBP_API_VERSION","VITE_SHOW_API_MANAGER_BUTTON", "VITE_OBP_LINKS_COLOR", "VITE_OBP_HEADER_LINKS_COLOR", "VITE_OBP_HEADER_LINKS_HOVER_COLOR", "VITE_OBP_HEADER_LINKS_BACKGROUND_COLOR", "VITE_OBP_API_DEFAULT_RESOURCE_DOC_VERSION", "VITE_CHATBOT_ENABLED", "VITE_CHATBOT_URL"}
configMap := make(map[string]string)

for _, key := range config {
Expand Down

0 comments on commit ca6f202

Please # to comment.