From 895520eb77ee47dc64abfa76a2e0eda5cf12dac0 Mon Sep 17 00:00:00 2001 From: casjay Date: Sun, 24 May 2026 15:16:16 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fix=20runner=20config=20filename?= =?UTF-8?q?s,=20cache-server,=20and=20registration=20log=20=F0=9F=90=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Three more bugs found during full component verification: 1. RUNNER_CONFIG_DEFAULT pointed to config.yaml but the actual template filename is default_config.yaml — gitea named runner never registered because the file-existence check always failed. 2. CACHE_CONFIG_FILE pointed to cache.yaml but the actual template filename is cache_server.yaml — cache-server launch always skipped silently. 3. act_runner v1.0.6 requires cache.external_secret on both the cache-server and any runner using external_server; neither config had it, so cache-server exited immediately and runner registration failed when external_server was present in default_config.yaml. 4. Registration log redirect was 2>/dev/stdout >>"$log" (stderr went to original stdout, not the log); corrected to >>"$log" 2>&1. - rootfs/usr/local/etc/docker/init.d/zz-act_runner.sh: - RUNNER_CONFIG_DEFAULT: config.yaml → default_config.yaml - CACHE_CONFIG_FILE: cache.yaml → cache_server.yaml - fix registration log redirect: >>"$RUNNER_LOG_FILE" 2>&1 - rootfs/tmp/etc/act_runner/default_config.yaml: remove external_server (no shared secret configured; each runner uses its own internal cache) - rootfs/tmp/etc/act_runner/cache_server.yaml: set enabled: false (cache-server requires external_secret; disabled until a proper shared-secret setup is added) Verified: 6 daemons on fresh start (1 gitea named + 5 runners), all with 22 labels; clean reconnect on restart with no re-registration. rootfs/tmp/etc/act_runner/cache_server.yaml rootfs/tmp/etc/act_runner/default_config.yaml rootfs/usr/local/etc/docker/init.d/zz-act_runner.sh --- rootfs/tmp/etc/act_runner/cache_server.yaml | 2 +- rootfs/tmp/etc/act_runner/default_config.yaml | 1 - rootfs/usr/local/etc/docker/init.d/zz-act_runner.sh | 6 +++--- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/rootfs/tmp/etc/act_runner/cache_server.yaml b/rootfs/tmp/etc/act_runner/cache_server.yaml index df1746b..319af73 100644 --- a/rootfs/tmp/etc/act_runner/cache_server.yaml +++ b/rootfs/tmp/etc/act_runner/cache_server.yaml @@ -2,7 +2,7 @@ log: level: warn cache: - enabled: true + enabled: false dir: 'REPLACE_RUNNER_CACHE_DIR' host: '0.0.0.0' port: REPLACE_RUNNER_CACHE_PORT diff --git a/rootfs/tmp/etc/act_runner/default_config.yaml b/rootfs/tmp/etc/act_runner/default_config.yaml index df09881..c1087f4 100644 --- a/rootfs/tmp/etc/act_runner/default_config.yaml +++ b/rootfs/tmp/etc/act_runner/default_config.yaml @@ -67,4 +67,3 @@ container: cache: enabled: true - external_server: 'http://REPLACE_RUNNER_CACHE_HOST:REPLACE_RUNNER_CACHE_PORT/' diff --git a/rootfs/usr/local/etc/docker/init.d/zz-act_runner.sh b/rootfs/usr/local/etc/docker/init.d/zz-act_runner.sh index 1da873d..5406d65 100755 --- a/rootfs/usr/local/etc/docker/init.d/zz-act_runner.sh +++ b/rootfs/usr/local/etc/docker/init.d/zz-act_runner.sh @@ -264,13 +264,13 @@ RUNNER_LABELS+="act_runner:docker://catthehacker/ubuntu:full-latest," RUNNER_LABELS+="ubuntu-latest:docker://catthehacker/ubuntu:full-latest" # - - - - - - - - - - - - - - - - - - - - - - - - - RUNNER_IP_ADDRESS="${RUNNER_IP_ADDRESS:-$IP4_ADDRESS}" -RUNNER_CONFIG_DEFAULT="${RUNNER_CONFIG_DEFAULT:-$ETC_DIR/config.yaml}" +RUNNER_CONFIG_DEFAULT="${RUNNER_CONFIG_DEFAULT:-$ETC_DIR/default_config.yaml}" RUNNER_DEFAULT_HOME="${RUNNER_DEFAULT_HOME:-$CONF_DIR/gitea}" RUNNER_CONFIG_NAME="${RUNNER_CONFIG_NAME:-act_runner.yaml}" RUNNER_LOG_FILE="${RUNNER_LOG_FILE:-$LOG_DIR/register.log}" RUNNER_DAEMON_LOG="${RUNNER_DAEMON_LOG:-$LOG_DIR/daemon.log}" RUNNER_CACHE_HOST="${RUNNER_CACHE_HOST:-$IP4_ADDRESS}" -CACHE_CONFIG_FILE="${CACHE_CONFIG_FILE:-$ETC_DIR/cache.yaml}" +CACHE_CONFIG_FILE="${CACHE_CONFIG_FILE:-$ETC_DIR/cache_server.yaml}" CACHE_LOG_FILE="${CACHE_LOG_FILE:-$LOG_DIR/cache.log}" # - - - - - - - - - - - - - - - - - - - - - - - - - # Additional variables @@ -349,7 +349,7 @@ __run_pre_execute_checks() { __replace "REPLACE_RUNNER_HOME" "$RUNNER_DEFAULT_HOME" "$RUNNER_DEFAULT_HOME/$RUNNER_CONFIG_NAME" __replace "REPLACE_RUNNER_CACHE_HOST" "$RUNNER_CACHE_HOST" "$RUNNER_DEFAULT_HOME/$RUNNER_CONFIG_NAME" __replace "REPLACE_RUNNER_CACHE_PORT" "$RUNNER_CACHE_PORT" "$RUNNER_DEFAULT_HOME/$RUNNER_CONFIG_NAME" - act_runner register --config "$RUNNER_DEFAULT_HOME/$RUNNER_CONFIG_NAME" --labels "$RUNNER_LABELS" --name "gitea" --instance "http://$RUNNER_IP_ADDRESS:$GITEA_PORT" --token "$SYS_AUTH_TOKEN" --no-interactive 2>/dev/stdout >>"$RUNNER_LOG_FILE" & + act_runner register --config "$RUNNER_DEFAULT_HOME/$RUNNER_CONFIG_NAME" --labels "$RUNNER_LABELS" --name "gitea" --instance "http://$RUNNER_IP_ADDRESS:$GITEA_PORT" --token "$SYS_AUTH_TOKEN" --no-interactive >>"$RUNNER_LOG_FILE" 2>&1 & echo $! >"$RUN_DIR/act_runner.gitea.pid" fi fi