File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
root/etc/s6-overlay/s6-rc.d/init-envfile Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change 11#!/usr/bin/with-contenv bash
22# shellcheck shell=bash
33
4- if find /run/s6/container_environment/*"FILE__"* -maxdepth 1 > /dev/null 2>&1; then
5- for FILENAME in /run/s6/container_environment/*; do
6- if [[ "${FILENAME##*/}" == "FILE__"* ]]; then
4+ if find /run/s6/container_environment/FILE__* -maxdepth 1 > /dev/null 2>&1; then
5+ for FILENAME in /run/s6/container_environment/FILE__*; do
76 SECRETFILE=$(cat "${FILENAME}")
87 if [[ -f ${SECRETFILE} ]]; then
98 FILESTRIP=${FILENAME//FILE__/}
10- cat "${SECRETFILE}" >"${FILESTRIP}"
9+ if [[ ${SECRET_NO_SANITIZE,,} = "true" ]]; then
10+ cat "${SECRETFILE}" >"${FILESTRIP}"
11+ else
12+ tr -d '\n' < "${SECRETFILE}" >"${FILESTRIP}"
13+ fi
1114 echo "[env-init] ${FILESTRIP##*/} set from ${FILENAME##*/}"
1215 else
1316 echo "[env-init] cannot find secret in ${FILENAME##*/}"
1417 fi
15- fi
1618 done
1719fi
You can’t perform that action at this time.
0 commit comments