Skip to content

Commit

Permalink
feat: allow setting the trustStore password through an environment va…
Browse files Browse the repository at this point in the history
…riable
  • Loading branch information
psanders committed Feb 29, 2024
1 parent 40ad101 commit 350ea16
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ COPY .scripts/init-postgres.sh .
COPY mods/pgdata/schema.prisma .
COPY mods/pgdata/migrations migrations

RUN apk add --no-cache nodejs npm tini openssl postgresql postgresql-client su-exec \
RUN apk add --no-cache nodejs npm tini openssl postgresql postgresql-client su-exec sed \
&& mkdir -p ${PATH_TO_CERTS} /var/lib/postgresql/data /run/postgresql /root/.npm \
&& addgroup -g ${GID} ${USER} \
&& adduser --disabled-password --gecos "" --ingroup ${USER} --home ${HOME} --uid ${UID} ${USER} \
Expand All @@ -80,4 +80,6 @@ CMD sh -c "su-exec postgres pg_ctl start -D /var/lib/postgresql/data --options='
if [ -n \"$HEPLIFY_OPTIONS\" ]; then \
heplify $HEPLIFY_OPTIONS & \
fi && \
sed -i 's|keyStorePassword: .*|keyStorePassword: ${PKCS_PASSWORD}|g' config/edgeport.yaml && \
sed -i 's|trustStorePassword: .*|trustStorePassword: ${PKCS_PASSWORD}|g' config/edgeport.yaml && \
DATABASE_URL=$DATABASE_URL su-exec $USER node ./dist/runner"
4 changes: 3 additions & 1 deletion mods/edgeport/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ COPY .scripts/generate-certs.sh .

# TODO: We need to find a way to avoid hardcoding the user and group ids
# and still be able to run the container as a non-root user
RUN apk add --no-cache tini openssl curl \
RUN apk add --no-cache tini openssl curl sed \
&& curl -L -o heplify https://github.com/sipcapture/heplify/releases/download/v1.65.10/heplify \
&& chmod +x heplify \
&& chmod +x edgeport.sh convert-to-p12.sh generate-certs.sh \
Expand All @@ -59,6 +59,8 @@ USER 1000:3000
ENTRYPOINT ["tini", "-v", "-e", "143", "--"]
CMD ["sh", "-c", "set -e && \
./convert-to-p12.sh $PATH_TO_CERTS $PKCS12_PASSWORD && \
sed -i 's|keyStorePassword: .*|keyStorePassword: ${PKCS_PASSWORD}|g' config/edgeport.yaml && \
sed -i 's|trustStorePassword: .*|trustStorePassword: ${PKCS_PASSWORD}|g' config/edgeport.yaml && \
if [ -n \"$HEPLIFY_OPTIONS\" ]; then \
./heplify $HEPLIFY_OPTIONS & \
fi && \
Expand Down

0 comments on commit 350ea16

Please sign in to comment.