From 0f7f6cbb6f902e05dae392db5f9cb9849fa66431 Mon Sep 17 00:00:00 2001 From: Simon Bruder Date: Mon, 15 Jul 2019 15:24:34 +0000 Subject: [PATCH] update nginx config at every startup (to account for hotswap of keys) --- Dockerfile | 2 +- entrypoint.sh | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index eb72ae5..3becd00 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,7 +6,7 @@ RUN apk add --no-cache \ tor COPY torrc /etc/tor/torrc -COPY nginx.conf /etc/nginx/nginx.conf +COPY nginx.conf /etc/nginx/nginx.conf.tmpl COPY entrypoint.sh /entrypoint.sh ENTRYPOINT ["/entrypoint.sh"] diff --git a/entrypoint.sh b/entrypoint.sh index 370f106..12d6e78 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -4,10 +4,9 @@ su-exec tor tor -f /etc/tor/torrc tor_domain=$(cat /var/lib/tor/hidden-service/hostname) main_domain=$(echo $MAIN_DOMAIN|sed 's/\./\\\./') -sed -i \ - -e "s/@@TOR_DOMAIN@@/$tor_domain/g" \ +sed -e "s/@@TOR_DOMAIN@@/$tor_domain/g" \ -e "s/@@MAIN_DOMAIN@@/$main_domain/g" \ - /etc/nginx/nginx.conf + /etc/nginx/nginx.conf.tmpl > /etc/nginx/nginx.conf echo $tor_domain