#23 m6/entrypoint-quote

closedfailopened
details
branches
master ← m6/entrypoint-quote
updated
id
c1de23b1-1f96-42ea-8661-9468abf6409a

Patch

entrypoint.sh+15 −17
diff --git a/entrypoint.sh b/entrypoint.shindex 6d4f149..191fbe9 100755--- a/entrypoint.sh+++ b/entrypoint.sh@@ -26,40 +26,39 @@ set -eu2626 # build below would misreport "branch not found".2727 git config --global --add safe.directory /data/repo2828 29-BUILD_ARGS=""29+# Build argv with "$@" (POSIX-safe: values with spaces/quotes survive).30+set -- /data/repo -o /srv/www3031 if [ -n "${HU13_BRANCH:-}" ]; then31-    BUILD_ARGS="$BUILD_ARGS --branch $HU13_BRANCH"32+    set -- "$@" --branch "$HU13_BRANCH"3233 fi3334 if [ -n "${HU13_CLONE_URL:-}" ]; then34-    BUILD_ARGS="$BUILD_ARGS --clone-url $HU13_CLONE_URL"35+    set -- "$@" --clone-url "$HU13_CLONE_URL"3536 fi3637 if [ -n "${HU13_REPO_NAME:-}" ]; then37-    BUILD_ARGS="$BUILD_ARGS --repo-name $HU13_REPO_NAME"38+    set -- "$@" --repo-name "$HU13_REPO_NAME"3839 fi3940 if [ -n "${HU13_DESCRIPTION:-}" ]; then40-    BUILD_ARGS="$BUILD_ARGS --description $HU13_DESCRIPTION"41+    set -- "$@" --description "$HU13_DESCRIPTION"4142 fi43+hu13 build "$@"4244 43-# shellcheck disable=SC208644-hu13 build /data/repo -o /srv/www $BUILD_ARGS45+set -- --www /srv/www --inbox-dir /data/inbox \46+    --listen "${HU13_LISTEN:-0.0.0.0:39313}"4547 46-SERVE_ARGS=""4748 if [ -n "${HU13_MAX_TITLE:-}" ]; then48-    SERVE_ARGS="$SERVE_ARGS --max-title $HU13_MAX_TITLE"49+    set -- "$@" --max-title "$HU13_MAX_TITLE"4950 fi5051 if [ -n "${HU13_MAX_BODY:-}" ]; then51-    SERVE_ARGS="$SERVE_ARGS --max-body $HU13_MAX_BODY"52+    set -- "$@" --max-body "$HU13_MAX_BODY"5253 fi5354 if [ -n "${HU13_MAX_BYTES:-}" ]; then54-    SERVE_ARGS="$SERVE_ARGS --max-bytes $HU13_MAX_BYTES"55+    set -- "$@" --max-bytes "$HU13_MAX_BYTES"5556 fi5657 if [ -n "${HU13_RATE_PER_HOUR:-}" ]; then57-    SERVE_ARGS="$SERVE_ARGS --rate-per-hour $HU13_RATE_PER_HOUR"58+    set -- "$@" --rate-per-hour "$HU13_RATE_PER_HOUR"5859 fi5960 if [ -n "${HU13_QUOTA:-}" ]; then60-    SERVE_ARGS="$SERVE_ARGS --quota $HU13_QUOTA"61+    set -- "$@" --quota "$HU13_QUOTA"6162 fi6263 63-# shellcheck disable=SC208664-exec hu13 serve --www /srv/www --inbox-dir /data/inbox \65-    --listen "${HU13_LISTEN:-0.0.0.0:39313}" $SERVE_ARGS64+exec hu13 serve "$@"66-- 2.55.0

Comments (0)

No comments yet.

Reviews (1)

all pulls