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:
@@ -64,7 +64,7 @@ done < "$ENV_FILE"
|
||||
# ---------------------------------------------------------------------------
|
||||
# Prompt function
|
||||
# ---------------------------------------------------------------------------
|
||||
TOTAL_PROMPTS=50
|
||||
TOTAL_PROMPTS=59
|
||||
CURRENT_PROMPT=0
|
||||
LAST_SECTION=""
|
||||
|
||||
@@ -122,6 +122,11 @@ prompt_var() {
|
||||
continue
|
||||
fi
|
||||
|
||||
# Optional fields accept any value including empty
|
||||
if [[ "$validation" == "optional" ]]; then
|
||||
break
|
||||
fi
|
||||
|
||||
case "$validation" in
|
||||
ip)
|
||||
if validate_ip "$value"; then break; fi
|
||||
@@ -151,6 +156,10 @@ prompt_var() {
|
||||
if validate_integer "$value"; then break; fi
|
||||
printf '%b Invalid: must be a number%b\n' "$C_RED" "$C_RESET"
|
||||
;;
|
||||
positive_integer)
|
||||
if validate_positive_integer "$value"; then break; fi
|
||||
printf '%b Invalid: must be a positive integer (>= 1)%b\n' "$C_RED" "$C_RESET"
|
||||
;;
|
||||
password)
|
||||
if validate_password "$value"; then break; fi
|
||||
printf '%b Invalid: password must be at least 8 characters%b\n' "$C_RED" "$C_RESET"
|
||||
@@ -218,6 +227,7 @@ prompt_var "UNRAID_SSH_PORT" "SSH port"
|
||||
prompt_var "UNRAID_GITEA_PORT" "Port Gitea web UI will listen on" port "3000" "UNRAID SERVER"
|
||||
prompt_var "UNRAID_GITEA_SSH_PORT" "Port for git-over-SSH" port "2222" "UNRAID SERVER"
|
||||
prompt_var "UNRAID_GITEA_DATA_PATH" "Absolute path on NVMe for Gitea data" path "" "UNRAID SERVER"
|
||||
prompt_var "UNRAID_SSH_KEY" "Path to SSH private key (empty = ssh-agent)" optional "" "UNRAID SERVER"
|
||||
|
||||
# --- FEDORA SERVER ---
|
||||
prompt_var "FEDORA_IP" "Static IP of Fedora server" ip "" "FEDORA SERVER"
|
||||
@@ -226,6 +236,7 @@ prompt_var "FEDORA_SSH_PORT" "SSH port"
|
||||
prompt_var "FEDORA_GITEA_PORT" "Port Gitea web UI will listen on" port "3000" "FEDORA SERVER"
|
||||
prompt_var "FEDORA_GITEA_SSH_PORT" "Port for git-over-SSH" port "2222" "FEDORA SERVER"
|
||||
prompt_var "FEDORA_GITEA_DATA_PATH" "Absolute path on NVMe for Gitea data" path "" "FEDORA SERVER"
|
||||
prompt_var "FEDORA_SSH_KEY" "Path to SSH private key (empty = ssh-agent)" optional "" "FEDORA SERVER"
|
||||
|
||||
# --- GITEA SHARED CREDENTIALS ---
|
||||
prompt_var "GITEA_ADMIN_USER" "Admin username (same on both instances)" nonempty "" "GITEA SHARED CREDENTIALS"
|
||||
@@ -258,6 +269,14 @@ prompt_var "MIGRATE_LABELS" "Migrate GitHub labels" bool
|
||||
prompt_var "MIGRATE_MILESTONES" "Migrate GitHub milestones" bool "false" "REPOSITORIES"
|
||||
prompt_var "MIGRATE_WIKI" "Migrate GitHub wiki" bool "false" "REPOSITORIES"
|
||||
|
||||
# --- RUNNERS ---
|
||||
prompt_var "RUNNER_DEFAULT_IMAGE" "Default container image for docker runners" nonempty "catthehacker/ubuntu:act-latest" "RUNNERS"
|
||||
prompt_var "RUNNER_DEFAULT_CAPACITY" "Default max concurrent jobs per runner" positive_integer "1" "RUNNERS"
|
||||
prompt_var "RUNNER_DEFAULT_DATA_PATH" "Default data path for remote (docker) runners" nonempty "/mnt/nvme/gitea-runner" "RUNNERS"
|
||||
# shellcheck disable=SC2088 # tilde intentionally stored as literal (expanded at runtime)
|
||||
prompt_var "LOCAL_RUNNER_DATA_PATH" "Data path for native macOS runner" nonempty "~/gitea-runner" "RUNNERS"
|
||||
prompt_var "LOCAL_REGISTRY" "Local registry prefix (empty = Docker Hub)" optional "" "RUNNERS"
|
||||
|
||||
# --- GITHUB MIRROR ---
|
||||
prompt_var "GITHUB_MIRROR_TOKEN" "GitHub PAT with repo write scope" nonempty "" "GITHUB MIRROR"
|
||||
prompt_var "GITHUB_MIRROR_INTERVAL" "How often Gitea pushes to GitHub" nonempty "8h" "GITHUB MIRROR"
|
||||
|
||||
Reference in New Issue
Block a user