Skip to content

Commit

Permalink
Merge pull request #35 from reload/misc
Browse files Browse the repository at this point in the history
Support more than one IP address
  • Loading branch information
arnested authored Jan 30, 2025
2 parents fa1ca36 + f2fb361 commit a356967
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
##
# Base
##
FROM nginx:1.27.0-alpine3.19-slim@sha256:a529900d9252ce5d04531a4a594f93736dbbe3ec155a692d10484be82aaa159a AS base
FROM nginx:1.27.3-alpine-slim@sha256:5a56ae385906c5b43ccc99379bce883aa93dc0556d7f705ba501d819925e8fa1 AS base

COPY /base /

RUN apk add --no-cache \
ca-certificates=~20240226 \
ca-certificates=~20241121 \
gnutls-utils=~3

ARG workdir=/var/www
Expand Down
7 changes: 4 additions & 3 deletions context/base/docker-entrypoint.d/20-certs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,16 @@ CERT_KEY="/cert/${FIRST_VIRTUAL_HOST:-localhost}.key"
CA_CERT="/rootCA/rootCA.pem"
CA_KEY="/rootCA/rootCA-key.pem"

IP_ADDRESS=$(hostname -i)
export IP_ADDRESS

envsubst </etc/https-proxy/cert.cfg.template >/tmp/cert.cfg

for host in ${VIRTUAL_HOST:-localhost}; do
echo "dns_name = $host" >>/tmp/cert.cfg
done

for ip_address in $(hostname -i); do
echo "ip_address = $ip_address" >>/tmp/cert.cfg
done

certtool --generate-privkey --outfile "${CERT_KEY}"

if [ ! -r "${CA_CERT}" ] || [ ! -r "${CA_KEY}" ]; then
Expand Down
1 change: 0 additions & 1 deletion context/base/etc/https-proxy/cert.cfg.template
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@ organization = "Development certificate"
unit = "${HOSTNAME}"
cn = "${FIRST_VIRTUAL_HOST}"
expiration_days = ${EXPIRATION_DAYS}
ip_address = "${IP_ADDRESS}"

0 comments on commit a356967

Please sign in to comment.