Skip to content

Commit 2a61e12

Browse files
refactor: address initial review feedback
Signed-off-by: K3rnelPan1c <[email protected]>
1 parent 7412114 commit 2a61e12

File tree

5 files changed

+25
-16
lines changed

5 files changed

+25
-16
lines changed

.github/renovate.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
":pinAllExceptPeerDependencies",
88
":semanticCommits",
99
":semanticCommitScope(deps)",
10-
"docker:disableMajor",
1110
"docker:pinDigests",
1211
"group:monorepos"
1312
],

.github/workflows/ci-release.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ jobs:
3434
- name: Setup Environment
3535
id: variables
3636
run: |-
37-
git config user.name "dependency-track-bot"
38-
git config user.email "dependency-track-bot@owasp.com"
37+
git config user.name "github-actions[bot]"
38+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
3939
4040
npm version ${{ github.event.inputs.version-to-bump }} -m "prepare-release: set version to %s"
4141

docker/Dockerfile.alpine

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM nginxinc/nginx-unprivileged:1.20.2-alpine
1+
FROM nginxinc/nginx-unprivileged:1.21.6-alpine@sha256:c754b5ff17e6cd39e786855ee31d4eeac21276d26119bf37385cbb3dcc3a9d29
22

33
# Arguments that can be passed at build time
44
ARG COMMIT_SHA=unknown
@@ -20,7 +20,9 @@ COPY ./dist ${APP_DIR}
2020
# Ensure UID 101 & GID 0 own all the needed directories
2121
# Applying these changes allows the container to run via the OpenShift default SCC "Restricted" whereby arbitrary an UID and GID=0 are assigned
2222
RUN chown -R 101:0 ${APP_DIR} \
23-
&& chmod -R g=u ${APP_DIR}
23+
&& chmod -R g=u ${APP_DIR} \
24+
# add jq to easily manipulate config.json in entrypoint script
25+
&& apk --no-cache add jq
2426

2527
# Specify the user to run as (in numeric format for compatibility with Kubernetes/OpenShift's SCC)
2628
# Inherited from parent image
@@ -37,7 +39,7 @@ WORKDIR ${APP_DIR}
3739
# metadata labels
3840
LABEL \
3941
org.opencontainers.image.vendor="OWASP" \
40-
org.opencontainers.image.title="Official Dependency-Track Container image" \
42+
org.opencontainers.image.title="Official Dependency-Track Frontend Container image" \
4143
org.opencontainers.image.description="Dependency-Track is an intelligent Component Analysis platform" \
4244
org.opencontainers.image.version="${APP_VERSION}" \
4345
org.opencontainers.image.url="https://dependencytrack.org/" \

docker/Dockerfile.debian

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM nginxinc/nginx-unprivileged:1.20.2
1+
FROM nginxinc/nginx-unprivileged:1.21.6@sha256:93bf6dcd6b4acbaf8b07a8b2fcdad73eeed54b74566ce5b4fc73b541445fb4e2
22

33
# Arguments that can be passed at build time
44
ARG COMMIT_SHA=unknown
@@ -20,7 +20,11 @@ COPY ./dist ${APP_DIR}
2020
# Ensure UID 101 & GID 0 own all the needed directories
2121
# Applying these changes allows the container to run via the OpenShift default SCC "Restricted" whereby arbitrary an UID and GID=0 are assigned
2222
RUN chown -R 101:0 ${APP_DIR} \
23-
&& chmod -R g=u ${APP_DIR}
23+
&& chmod -R g=u ${APP_DIR} \
24+
# add jq to easily manipulate config.json in entrypoint script
25+
&& apt-get update -yqq \
26+
&& DEBIAN_FRONTEND=noninteractive apt-get install -yqq --no-install-recommends jq \
27+
&& rm -rf /var/lib/apt/lists/*
2428

2529
# Specify the user to run as (in numeric format for compatibility with Kubernetes/OpenShift's SCC)
2630
# Inherited from parent image
@@ -37,7 +41,7 @@ WORKDIR ${APP_DIR}
3741
# metadata labels
3842
LABEL \
3943
org.opencontainers.image.vendor="OWASP" \
40-
org.opencontainers.image.title="Official Dependency-Track Container image" \
44+
org.opencontainers.image.title="Official Dependency-Track Frontend Container image" \
4145
org.opencontainers.image.description="Dependency-Track is an intelligent Component Analysis platform" \
4246
org.opencontainers.image.version="${APP_VERSION}" \
4347
org.opencontainers.image.url="https://dependencytrack.org/" \

docker/docker-entrypoint.sh

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,17 @@ set -e
66
if mount | grep '/static/config.json'; then
77
echo "config.json is mounted from host - ENV configuration will be ignored"
88
else
9-
sed -i ./static/config.json \
10-
-e "s;\"API_BASE_URL\": \"\";\"API_BASE_URL\": \"${API_BASE_URL}\";" \
11-
-e "s;\"OIDC_ISSUER\": \"\";\"OIDC_ISSUER\": \"${OIDC_ISSUER}\";" \
12-
-e "s;\"OIDC_CLIENT_ID\": \"\";\"OIDC_CLIENT_ID\": \"${OIDC_CLIENT_ID}\";" \
13-
-e "s;\"OIDC_SCOPE\": \"openid email profile\";\"OIDC_SCOPE\": \"${OIDC_SCOPE}\";" \
14-
-e "s;\"OIDC_FLOW\": \"code\";\"OIDC_FLOW\": \"${OIDC_FLOW}\";" \
15-
-e "s;\"OIDC_LOGIN_BUTTON_TEXT\" : \"\";\"OIDC_LOGIN_BUTTON_TEXT\" : \"${OIDC_LOGIN_BUTTON_TEXT}\";"
9+
# Apply ENV vars to temporary config.json
10+
jq '.API_BASE_URL = env.API_BASE_URL
11+
| .OIDC_ISSUER = env.OIDC_ISSUER
12+
| .OIDC_CLIENT_ID = env.OIDC_CLIENT_ID
13+
| .OIDC_SCOPE = env.OIDC_SCOPE
14+
| .OIDC_FLOW = env.OIDC_FLOW
15+
| .OIDC_LOGIN_BUTTON_TEXT = env.OIDC_LOGIN_BUTTON_TEXT' \
16+
./static/config.json > /tmp/config.json
17+
18+
# Override default config file
19+
mv -f /tmp/config.json ./static/config.json
1620
fi
1721

1822
exec "$@"

0 commit comments

Comments
 (0)