Skip to content

Commit 08d7a41

Browse files
authored
Merge pull request #412 from bcgov/dev
Merge dev into main
2 parents 5a005aa + fdc0744 commit 08d7a41

87 files changed

Lines changed: 98675 additions & 16078 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
id_rsa_ff_ee
2+
13
# Logs
24
logs
35
*.log
@@ -118,3 +120,6 @@ backend/etl/debezium-jdbc/.settings/org.eclipse.core.resources.prefs
118120
backend/etl/debezium-jdbc/.project
119121
backend/etl/debezium-jdbc/.classpath
120122
backend/etl/debezium-jdbc/target/
123+
124+
125+
notes/

forms-flow-ai/epd-forms/Summary of Site Condition.json

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

forms-flow-ai/epd-forms/bundling/Contaminated Sites Services Application Form.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

forms-flow-ai/epd-forms/bundling/Site Risk Classification Report.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
# Base image
2+
FROM node:14.17.6-alpine as build-stage
3+
4+
# Set working directory
5+
WORKDIR /forms-flow-web-root-config/app
6+
7+
# Set build arguments
8+
ARG NODE_ENV
9+
ARG MF_FORMSFLOW_WEB_URL
10+
ARG MF_FORMSFLOW_NAV_URL
11+
ARG MF_FORMSFLOW_SERVICE_URL
12+
ARG MF_FORMSFLOW_ADMIN_URL
13+
ARG MF_FORMSFLOW_THEME_URL
14+
ARG REACT_APP_CUSTOM_LOGOUT_URL
15+
ARG REACT_APP_CUSTOM_MAP_URL
16+
ARG ssh_prv_key
17+
ARG ssh_pub_key
18+
19+
# Set environment variables
20+
ENV MF_FORMSFLOW_WEB_URL ${MF_FORMSFLOW_WEB_URL}
21+
ENV MF_FORMSFLOW_NAV_URL ${MF_FORMSFLOW_NAV_URL}
22+
ENV MF_FORMSFLOW_SERVICE_URL ${MF_FORMSFLOW_SERVICE_URL}
23+
ENV MF_FORMSFLOW_ADMIN_URL ${MF_FORMSFLOW_ADMIN_URL}
24+
ENV MF_FORMSFLOW_THEME_URL ${MF_FORMSFLOW_THEME_URL}
25+
ENV NODE_ENV ${NODE_ENV}
26+
ENV REACT_APP_CUSTOM_LOGOUT_URL ${REACT_APP_CUSTOM_LOGOUT_URL}
27+
ENV REACT_APP_CUSTOM_MAP_URL ${REACT_APP_CUSTOM_MAP_URL}
28+
29+
# Add `/app/node_modules/.bin` to $PATH
30+
ENV PATH /forms-flow-web-root-config/app/node_modules/.bin:$PATH
31+
32+
# Install necessary packages
33+
RUN apk update && apk upgrade && \
34+
apk add --no-cache bash git openssh
35+
36+
# Install and cache app dependencies
37+
COPY package-lock.json /forms-flow-web-root-config/app/package-lock.json
38+
COPY package.json /forms-flow-web-root-config/app/package.json
39+
COPY env.sh /forms-flow-web-root-config/app/env.sh
40+
RUN npm ci --only=production
41+
42+
# Copy source code
43+
# COPY . /forms-flow-web-root-config/app/
44+
45+
# Authorize SSH Host
46+
RUN mkdir -p /root/.ssh && \
47+
chmod 0700 /root/.ssh && \
48+
echo " IdentityFile ~/.ssh/id_rsa" >> /etc/ssh/ssh_config
49+
50+
RUN echo "$ssh_prv_key" | sed 's/\\n/\n/g' > /root/.ssh/id_rsa && \
51+
echo "$ssh_pub_key" | sed 's/\\n/\n/g' > /root/.ssh/id_rsa.pub && \
52+
chmod 600 /root/.ssh/id_rsa && \
53+
chmod 600 /root/.ssh/id_rsa.pub
54+
55+
RUN mkdir -p /root/.ssh && ssh-keyscan github.com >> /root/.ssh/known_hosts
56+
57+
RUN git clone git@github.com:AOT-Technologies/forms-flow-ai-ee.git -b epd-ff-ee-5.2.0 /tmp/forms-flow-ai/
58+
59+
RUN cp -r /tmp/forms-flow-ai/forms-flow-web-root-config/. /forms-flow-web-root-config/app
60+
61+
62+
# Customizations
63+
ARG CUSTOM_SRC_DIR=src
64+
COPY ./ /tmp/${CUSTOM_SRC_DIR}/
65+
RUN cp -R /tmp/${CUSTOM_SRC_DIR}/* /forms-flow-web-root-config/app/ && rm -Rf /tmp/${CUSTOM_SRC_DIR}
66+
67+
ARG CUSTOM_SRC_DIR=public
68+
COPY ./ /tmp/${CUSTOM_SRC_DIR}/
69+
RUN cp -R /tmp/${CUSTOM_SRC_DIR}/* /forms-flow-web-root-config/app/ && rm -Rf /tmp/${CUSTOM_SRC_DIR}/
70+
71+
# Build the application
72+
RUN if [ $NODE_ENV == "development" ]; then \
73+
npm run build-dev:webpack; \
74+
else \
75+
npm run build:webpack; \
76+
fi
77+
78+
79+
# Production stage
80+
FROM nginx:1.25.1-alpine as production-stage
81+
82+
# Set label for image
83+
LABEL Name="formsflow"
84+
85+
# Create directories
86+
RUN mkdir /app
87+
WORKDIR /usr/share/nginx/html/config
88+
89+
# Copy built files from build stage
90+
COPY --from=build-stage /forms-flow-web-root-config/app/dist /usr/share/nginx/html
91+
COPY --from=build-stage /forms-flow-web-root-config/app/env.sh /usr/share/nginx/html/config
92+
93+
# Copy nginx configuration
94+
COPY nginx.conf /etc/nginx/nginx.conf
95+
96+
# Expose port
97+
EXPOSE 8080
98+
99+
# Install necessary packages
100+
RUN apk add --no-cache bash
101+
102+
# Set execute permission for env.sh
103+
RUN chmod +x /usr/share/nginx/html/config/env.sh
104+
105+
# Start Nginx server with environment setup
106+
CMD ["/bin/bash", "-c", "nginx -g \"daemon off;\""]
107+
# CMD ["/bin/bash", "-c", "/usr/share/nginx/html/config/env.sh && nginx -g \"daemon off;\""]
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
services:
2+
forms-flow-web-root-config:
3+
container_name: forms-flow-web-root-config
4+
build:
5+
context: .
6+
dockerfile: Dockerfile
7+
args:
8+
- MF_FORMSFLOW_WEB_URL=${MF_FORMSFLOW_WEB_URL:-https://forms-flow-microfrontends.aot-technologies.com/forms-flow-web-ee@v5.2.1-alpha/forms-flow-web.gz.js}
9+
- MF_FORMSFLOW_NAV_URL=${MF_FORMSFLOW_NAV_URL:-https://forms-flow-microfrontends.aot-technologies.com/forms-flow-nav@v5.2.1-alpha/forms-flow-nav.gz.js}
10+
- MF_FORMSFLOW_SERVICE_URL=${MF_FORMSFLOW_SERVICE_URL:-https://forms-flow-microfrontends.aot-technologies.com/forms-flow-service@v5.2.1-alpha/forms-flow-service.gz.js}
11+
- MF_FORMSFLOW_ADMIN_URL=${MF_FORMSFLOW_ADMIN_URL:-https://forms-flow-microfrontends.aot-technologies.com/forms-flow-admin@v5.2.1-alpha/forms-flow-admin.gz.js}
12+
- MF_FORMSFLOW_THEME_URL=${MF_FORMSFLOW_THEME_URL:-https://forms-flow-microfrontends.aot-technologies.com/forms-flow-theme@v5.2.1-alpha/forms-flow-theme.gz.js}
13+
- NODE_ENV=${NODE_ENV:-production}
14+
entrypoint: /bin/sh -c "/usr/share/nginx/html/config/env.sh && nginx -g 'daemon off;'"
15+
environment:
16+
- NODE_ENV=${NODE_ENV:-production}
17+
- REACT_APP_API_SERVER_URL=${FORMIO_DEFAULT_PROJECT_URL}
18+
- REACT_APP_API_PROJECT_URL=${FORMIO_DEFAULT_PROJECT_URL}
19+
- REACT_APP_KEYCLOAK_CLIENT=${KEYCLOAK_WEB_CLIENT_ID:-forms-flow-web}
20+
- REACT_APP_WEB_BASE_URL=${FORMSFLOW_API_URL}
21+
- REACT_APP_BPM_URL=${BPM_API_URL}
22+
- REACT_APP_WEBSOCKET_ENCRYPT_KEY=${WEBSOCKET_ENCRYPT_KEY:-giert989jkwrgb@DR55}
23+
- REACT_APP_KEYCLOAK_URL_REALM=${KEYCLOAK_URL_REALM:-forms-flow-ai}
24+
- REACT_APP_KEYCLOAK_URL=${KEYCLOAK_URL}
25+
- REACT_APP_APPLICATION_NAME=${APPLICATION_NAME:-formsflow.ai}
26+
- REACT_APP_ENABLE_APPLICATION_ACCESS_PERMISSION_CHECK=${ENABLE_APPLICATION_ACCESS_PERMISSION_CHECK:-false}
27+
- REACT_APP_WEB_BASE_CUSTOM_URL=${WEB_BASE_CUSTOM_URL}
28+
- REACT_APP_MULTI_TENANCY_ENABLED=${MULTI_TENANCY_ENABLED:-false}
29+
- REACT_APP_MT_ADMIN_BASE_URL=${MT_ADMIN_BASE_URL}
30+
- REACT_APP_MT_ADMIN_BASE_URL_VERSION=${MT_ADMIN_BASE_URL_VERSION}
31+
- REACT_APP_CUSTOM_SUBMISSION_URL=${CUSTOM_SUBMISSION_URL}
32+
- REACT_APP_CUSTOM_SUBMISSION_ENABLED=${CUSTOM_SUBMISSION_ENABLED:-false}
33+
- REACT_APP_DRAFT_ENABLED=${DRAFT_ENABLED:-false}
34+
- REACT_APP_DRAFT_POLLING_RATE=${DRAFT_POLLING_RATE:-15000}
35+
- REACT_APP_EXPORT_PDF_ENABLED=${EXPORT_PDF_ENABLED:-false}
36+
- REACT_APP_PUBLIC_WORKFLOW_ENABLED=${PUBLIC_WORKFLOW_ENABLED:-false}
37+
- REACT_APP_DOCUMENT_SERVICE_URL=${DOCUMENT_SERVICE_URL}
38+
- REACT_APP_CUSTOM_THEME_URL=${CUSTOM_THEME_URL}
39+
- REACT_APP_CUSTOM_RESOURCE_BUNDLE_URL=${CUSTOM_RESOURCE_BUNDLE_URL}
40+
- REACT_APP_KEYCLOAK_ENABLE_CLIENT_AUTH=${KEYCLOAK_ENABLE_CLIENT_AUTH:-false}
41+
- REACT_APP_ENABLE_FORMS_MODULE=${ENABLE_FORMS_MODULE:-true}
42+
- REACT_APP_ENABLE_TASKS_MODULE=${ENABLE_TASKS_MODULE:-true}
43+
- REACT_APP_ENABLE_DASHBOARDS_MODULE=${ENABLE_DASHBOARDS_MODULE:-true}
44+
- REACT_APP_ENABLE_PROCESSES_MODULE=${ENABLE_PROCESSES_MODULE:-true}
45+
- REACT_APP_ENABLE_APPLICATIONS_MODULE=${ENABLE_APPLICATIONS_MODULE:-true}
46+
- REACT_APP_CUSTOM_MAP_URL=${EPD_CUSTOM_MAP_URL:-http://localhost:4000/map}
47+
- REACT_APP_CUSTOM_LOGOUT_URL=${EPD_IDP_LOGOUT_URL:-https://logontest7.gov.bc.ca/clp-cgi/logoff.cgi?retnow=1&returl=https://epd-keycloak-dev.apps.silver.devops.gov.bc.ca/auth/realms/forms-flow-ai/protocol/openid-connect/logout?post_logout_redirect_uri=http://localhost:4000}
48+
ports:
49+
- "3000:8080"
50+
tty: true
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
3+
# Recreate config file
4+
rm -rf ./config.js
5+
touch ./config.js
6+
7+
envsubst < ./config.template.js > ./config.js;
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIM8mwzO0j1vTTis0XJ44UGSe+CbsVzcrYDvzzHih+GM0 adam.coard@aot-technologies.com
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# nginx.conf
2+
worker_processes auto;
3+
error_log /var/log/nginx/error.log;
4+
5+
pid /tmp/nginx.pid;
6+
7+
8+
events {
9+
worker_connections 4096;
10+
}
11+
12+
http {
13+
include /etc/nginx/mime.types;
14+
client_body_temp_path /tmp/client_temp;
15+
proxy_temp_path /tmp/proxy_temp_path;
16+
fastcgi_temp_path /tmp/fastcgi_temp;
17+
uwsgi_temp_path /tmp/uwsgi_temp;
18+
scgi_temp_path /tmp/scgi_temp;
19+
default_type application/octet-stream;
20+
server_tokens off;
21+
underscores_in_headers on;
22+
23+
# Use a w3c standard log format
24+
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
25+
'$status $body_bytes_sent "$http_referer" '
26+
'"$http_user_agent" "$http_x_forwarded_for"';
27+
28+
access_log /var/log/nginx/access.log main;
29+
30+
31+
server {
32+
33+
# add in most common security headers
34+
add_header Content-Security-Policy "default-src * data: blob: filesystem: 'unsafe-inline' 'unsafe-eval'";
35+
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains";
36+
add_header X-Content-Type-Options "nosniff";
37+
add_header X-XSS-Protection 1;
38+
add_header X-Frame-Options SAMEORIGIN;
39+
40+
41+
42+
listen 8080;
43+
server_name _;
44+
45+
index index.html;
46+
error_log /dev/stdout info;
47+
access_log /dev/stdout;
48+
49+
# forms-flow-web-root-config
50+
location / {
51+
add_header 'Access-Control-Allow-Origin' '*';
52+
root /usr/share/nginx/html;
53+
index index.html index.htm;
54+
try_files $uri $uri/ /index.html;
55+
}
56+
57+
error_page 500 502 503 504 /50x.html;
58+
59+
location = /50x.html {
60+
root /usr/share/nginx/html;
61+
}
62+
}
63+
}

0 commit comments

Comments
 (0)