WIP: wip-entrypoint #2

Draft
merith-tk wants to merge 18 commits from wip-entrypoint into main
Showing only changes of commit 95fb2cafff - Show all commits

View file

@ -4,7 +4,7 @@ set -e
# Technically not nessecary but it cleans up the logs from having token/secret values
run_command() {
local cmd="$1"
local cmd="$@"
# Replace any --token <value> or --secret <value> with [REDACTED]
local safe_cmd=$(echo "$cmd" | sed -E 's/--(token|secret) [^ ]+/--\1 [REDACTED]/g')
decho "Running command: $safe_cmd"
@ -23,6 +23,12 @@ if [[ $(id -u) -eq 0 ]]; then
decho "[WARNING] Running as root user"
fi
# Handle if `command` is passed, as command appends arguments to the entrypoint
if [ "$#" -gt 0 ]; then
run_command "$@"
exit
fi
# Handle and alter the config file
if [[ -z "${CONFIG_FILE}" ]]; then
echo "CONFIG_FILE is not set"