From 5abb9458c730784cbfa9c6c58e0600a8f71af4ec Mon Sep 17 00:00:00 2001 From: ahgraber Date: Fri, 5 Feb 2021 23:47:30 -0500 Subject: [PATCH] fix linebreaks in secrets --- Dockerfile | 2 +- docker/rootfs/etc/cont-init.d/01_envfile.sh | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index f4002977..b49e1fc2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM jc21/alpine-nginx-full:node +FROM --platform=${TARGETPLATFORM:-linux/amd64} jc21/alpine-nginx-full:node LABEL maintainer="Jamie Curnow " ENV SUPPRESS_NO_CONFIG_WARNING=1 diff --git a/docker/rootfs/etc/cont-init.d/01_envfile.sh b/docker/rootfs/etc/cont-init.d/01_envfile.sh index a0bc5ace..90dee690 100644 --- a/docker/rootfs/etc/cont-init.d/01_envfile.sh +++ b/docker/rootfs/etc/cont-init.d/01_envfile.sh @@ -19,7 +19,8 @@ for FILENAME in $(find /var/run/s6/container_environment/ | grep "__FILE$"); do # ... and set value to contents of secretfile # since s6 uses text files, this is effectively "export ..." - cat $(${SECRETFILE} | xargs) > ${STRIPFILE} + # cat ${SECRETFILE} > ${STRIPFILE} + cat $(${SECRETFILE} | sed "s/[^\w.-]+//g") > ${STRIPFILE} echo "[secret-init] Set ${STRIPFILE} to $(cat ${STRIPFILE})" # DEBUG - rm for prod!" echo "[secret-init] Success! ${STRIPFILE} set from ${FILENAME}"