Skip to content

Commit 58d5096

Browse files
committed
Warn rather than sanitize
1 parent c7907f7 commit 58d5096

File tree

1 file changed

+4
-4
lines changed
  • root/etc/s6-overlay/s6-rc.d/init-envfile

1 file changed

+4
-4
lines changed

root/etc/s6-overlay/s6-rc.d/init-envfile/run

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ if find /run/s6/container_environment/FILE__* -maxdepth 1 > /dev/null 2>&1; then
66
SECRETFILE=$(cat "${FILENAME}")
77
if [[ -f ${SECRETFILE} ]]; then
88
FILESTRIP=${FILENAME//FILE__/}
9-
if [[ ${SECRET_NO_SANITIZE,,} = "true" ]]; then
10-
cat "${SECRETFILE}" >"${FILESTRIP}"
11-
else
12-
tr -d '\n' < "${SECRETFILE}" >"${FILESTRIP}"
9+
if [[ $(tail -n1 "${SECRETFILE}" | wc -l) = 1 ]]; then
10+
echo "[env-init] Your secret: ${FILENAME##*/}"
11+
echo " contains a trailing newline and may not work as expected"
1312
fi
13+
cat "${SECRETFILE}" >"${FILESTRIP}"
1414
echo "[env-init] ${FILESTRIP##*/} set from ${FILENAME##*/}"
1515
else
1616
echo "[env-init] cannot find secret in ${FILENAME##*/}"

0 commit comments

Comments
 (0)