]> git.ipfire.org Git - thirdparty/paperless-ngx.git/commitdiff
Fix: Adds a warning to the user if their secret file includes a trailing newline...
authorTrenton H <797416+stumpylog@users.noreply.github.com>
Wed, 9 Apr 2025 21:05:26 +0000 (14:05 -0700)
committerGitHub <noreply@github.com>
Wed, 9 Apr 2025 21:05:26 +0000 (21:05 +0000)
docker/rootfs/etc/s6-overlay/s6-rc.d/init-env-file/run

index 08b7635f856d5e0f32236a60f0db6b1e5bf541f0..9b3e2964f983e3aca3ca6eacc865d05e0bd85db1 100755 (executable)
@@ -17,6 +17,9 @@ if find /run/s6/container_environment/*"_FILE" -maxdepth 1 > /dev/null 2>&1; the
                        if [[ -f ${SECRETFILE} ]]; then
                                # Trim off trailing _FILE
                                FILESTRIP=${FILENAME//_FILE/}
+                               if [[ $(tail -n1 "${SECRETFILE}" | wc -l) != 0 ]]; then
+                                       echo "${log_prefix} Your secret: ${FILENAME##*/} contains a trailing newline and may not work as expected"
+                               fi
                                # Set environment variable
                                cat "${SECRETFILE}" > "${FILESTRIP}"
                                echo "${log_prefix} ${FILESTRIP##*/} set from ${FILENAME##*/}"