feat: rework runner config to INI format with full field support

Replace pipe-delimited runners.conf with INI-style sections supporting
host resolution, container images, repo-scoped tokens, resource limits,
capacity, and SSH key passthrough. All defaults pulled from .env.

- Add INI parsing helpers (ini_list_sections, ini_get, ini_set) to common.sh
- Add SSH key support (UNRAID_SSH_KEY, FEDORA_SSH_KEY) to ssh_exec/scp_to
- Add .env vars: RUNNER_DEFAULT_IMAGE, RUNNER_DEFAULT_CAPACITY,
  RUNNER_DEFAULT_DATA_PATH, LOCAL_RUNNER_DATA_PATH, LOCAL_REGISTRY
- Rewrite manage_runner.sh with host/image/token resolution and resource limits
- Rewrite configure_runners.sh wizard for INI format with all 9 fields
- Update phase3 scripts to use ini_list_sections instead of pipe parsing
- Add runners.conf INI validation to preflight.sh (check 5b)
- Update templates to use resolved labels, capacity, and deploy resources

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
S
2026-02-28 23:14:46 -05:00
parent fcd966f97d
commit f4a6b04d14
12 changed files with 1000 additions and 329 deletions

View File

@@ -36,13 +36,9 @@ API_RUNNERS=$(gitea_api GET "/admin/runners" 2>/dev/null || echo "[]")
# Check each runner: exists in API response AND status is online/idle/active
# A runner that registered but is not running will show as "offline".
# ---------------------------------------------------------------------------
while IFS='|' read -r name rest; do
# Skip comments and blank lines
[[ "$name" =~ ^[[:space:]]*# ]] && continue
while IFS= read -r name; do
[[ -z "$name" ]] && continue
name=$(echo "$name" | xargs)
# Look up runner by name in the API response
local_status=$(printf '%s' "$API_RUNNERS" | jq -r --arg n "$name" '.[] | select(.name == $n) | .status' 2>/dev/null || true)
@@ -56,12 +52,12 @@ while IFS='|' read -r name rest; do
log_success "Runner '${name}' is ${local_status}"
PASS=$((PASS + 1))
fi
done < "$RUNNERS_CONF"
done < <(ini_list_sections "$RUNNERS_CONF")
# ---------------------------------------------------------------------------
# Check: runner count matches runners.conf
# ---------------------------------------------------------------------------
EXPECTED_COUNT=$(grep -Evc '^[[:space:]]*($|#)' "$RUNNERS_CONF")
EXPECTED_COUNT=$(ini_list_sections "$RUNNERS_CONF" | wc -l | xargs)
ACTUAL_COUNT=$(printf '%s' "$API_RUNNERS" | jq 'length' 2>/dev/null || echo 0)
if [[ "$ACTUAL_COUNT" -ge "$EXPECTED_COUNT" ]]; then