Skip to content

Commit

Permalink
feat: add cert end date
Browse files Browse the repository at this point in the history
  • Loading branch information
vrenaville committed Aug 7, 2023
1 parent 586d784 commit 7eaa983
Show file tree
Hide file tree
Showing 3 changed files with 730 additions and 6 deletions.
15 changes: 9 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM debian:bullseye as builder
FROM debian:bookworm as builder


WORKDIR /tmp/
Expand Down Expand Up @@ -34,8 +34,8 @@ RUN set -ex \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

FROM debian:bullseye

FROM debian:bookworm-slim
ENV CERTFILE='/tmp/tls-cert/tls.crt'
RUN set -ex \
&& apt-get update \
&& apt-get upgrade -y \
Expand All @@ -44,13 +44,16 @@ RUN set -ex \
curl \
libmicrohttpd-dev \
&& curl -L https://github.com/digitalocean/prometheus-client-c/releases/download/v0.1.3/libprom-dev-0.1.3-Linux.deb -o /tmp/libprom-dev-0.1.3-Linux.deb \
&& curl -L https://github.com/digitalocean/prometheus-client-c/releases/download/v0.1.3/libpromhttp-dev-0.1.3-Linux.deb -o /tmp/libpromhttp-dev-0.1.3-Linux.dev \
&& curl -L https://github.com/digitalocean/prometheus-client-c/releases/download/v0.1.3/libpromhttp-dev-0.1.3-Linux.deb -o /tmp/libpromhttp-dev-0.1.3-Linux.deb \
&& dpkg --install /tmp/libprom-dev-0.1.3-Linux.deb \
&& dpkg --install /tmp/libpromhttp-dev-0.1.3-Linux.dev \
&& dpkg --install /tmp/libpromhttp-dev-0.1.3-Linux.deb \
&& rm /tmp/libpromhttp-dev-0.1.3-Linux.deb \
&& rm /tmp/libprom-dev-0.1.3-Linux.deb \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
COPY --from=builder /tmp/odyssey/build/sources/odyssey /usr/local/bin/
COPY ./entrypoint.sh .
RUN adduser --disabled-password --gecos '' odyssey
USER odyssey
ENTRYPOINT ["/usr/local/bin/odyssey"]
ENTRYPOINT ["./entrypoint.sh"]
EXPOSE 5432
10 changes: 10 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash
# Test if CERT file exist, if yes store the expiration date
if [ -f "$CERTFILE" ]; then
openssl x509 -enddate -noout < $CERTFILE > /tmp/TLSENDATE
else
echo "No cert file"
echo "no CRT" > /tmp/TLSENDATE
fi
# Start Odyssey
/usr/local/bin/odyssey $1
Loading

0 comments on commit 7eaa983

Please sign in to comment.