1
0
Fork 0
mirror of https://code.forgejo.org/forgejo/runner.git synced 2025-06-27 16:35:58 +00:00

fix: forgejo-runner-service.sh must not leak the env to the runner

This commit is contained in:
Earl Warren 2025-01-28 13:41:57 +01:00
parent 90ecfa1b29
commit 625965c739
No known key found for this signature in database
GPG key ID: 0579CB2928A78A00

View file

@ -159,6 +159,7 @@ EOF
function inside() { function inside() {
local name=$(lxc_name) local name=$(lxc_name)
# all exported variables must be --unset before running the daemon
lxc-helpers.sh lxc_container_run $name -- sudo --user $LXC_USER_NAME \ lxc-helpers.sh lxc_container_run $name -- sudo --user $LXC_USER_NAME \
INPUTS_SERIAL="$INPUTS_SERIAL" \ INPUTS_SERIAL="$INPUTS_SERIAL" \
INPUTS_LXC_CONFIG="$INPUTS_LXC_CONFIG" \ INPUTS_LXC_CONFIG="$INPUTS_LXC_CONFIG" \
@ -245,7 +246,16 @@ function daemon() {
rm -f stopped-* killed-* rm -f stopped-* killed-*
touch started-running touch started-running
set +e set +e
timeout --signal=SIGINT --kill-after=$KILL_AFTER $INPUTS_LIFETIME forgejo-runner --config config.yml daemon timeout --signal=SIGINT --kill-after=$KILL_AFTER $INPUTS_LIFETIME env \
--unset INPUTS_SERIAL \
--unset INPUTS_LXC_CONFIG \
--unset INPUTS_TOKEN \
--unset INPUTS_FORGEJO \
--unset INPUTS_LIFETIME \
--unset KILL_AFTER \
--unset VERBOSE \
--unset HOST \
/usr/local/bin/forgejo-runner --config config.yml daemon
case $? in case $? in
0) touch stopped-gracefully ;; 0) touch stopped-gracefully ;;
124) touch stopped-timeout ;; 124) touch stopped-timeout ;;