Commit Graph

210 Commits

Author SHA1 Message Date
S
0c4da57136 fix: remove GITHUB_MIRROR_TOKEN from preflight required vars
Consolidated into GITHUB_TOKEN.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 10:00:57 -05:00
S
0f7a20c450 fix: use GITHUB_TOKEN instead of GITHUB_MIRROR_TOKEN for push mirrors
Single PAT with repo scope handles both migration and push mirroring.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 10:00:45 -05:00
S
eabc961139 fix: remove GITHUB_MIRROR_TOKEN from env validation arrays
Consolidated into GITHUB_TOKEN — single PAT handles both migration
and push mirroring. GITHUB_MIRROR_INTERVAL remains as its own var.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 10:00:18 -05:00
S
0aee01c3f3 fix: update .env.example versions, token consolidation, and descriptions
- GITEA_VERSION 1.23 → 1.25, ACT_RUNNER_VERSION 0.2.11 → 0.3.0
- Consolidate GITHUB_MIRROR_TOKEN into GITHUB_TOKEN (single PAT with repo scope)
- Move GITHUB_MIRROR_INTERVAL into REPOSITORIES section
- Fix GITHUB_TOKEN description: "repo read" → "repo scope (read+write)"
- Fix BACKUP_STORAGE_PATH description: clarify "Absolute path on Fedora"

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 09:59:57 -05:00
S
c90a7a6db6 feat: add unzip installation check for backup/restore scripts on Unraid 2026-03-01 08:59:04 -05:00
S
ba5aa6816b feat: add unzip installation check for backup/restore scripts on Fedora 2026-03-01 08:59:00 -05:00
S
10b155da74 fix: correct total prompts count in configure_env.sh 2026-03-01 08:58:56 -05:00
S
52765a6626 refactor: replace mapfile with compatible loop for reading manifest entries 2026-03-01 08:58:53 -05:00
S
61d58790b1 fix: update sed escape pattern to handle pipe delimiter in save_env_var function 2026-03-01 08:58:49 -05:00
S
135a0b7c0c refactor: replace DNS resolution method with Python for improved compatibility 2026-03-01 08:58:44 -05:00
S
24d7df0a0b feat: add idempotent token deletion before generating new Gitea backup admin token 2026-03-01 08:58:39 -05:00
S
83f706c6b8 feat: add idempotent token deletion before generating new Gitea admin token 2026-03-01 08:58:34 -05:00
S
5bdf72063e refactor: replace associative array with Bash 3.2 compatible key-value store for collected runner data 2026-03-01 08:45:13 -05:00
S
a34cc69681 refactor: streamline environment variable loading with dedicated function 2026-03-01 08:40:25 -05:00
S
6100d482d2 docs: update usage guide with boot-mode native runner details and sudo requirements 2026-03-01 08:28:49 -05:00
S
b120ef2e0e docs: add details about native runner boot mode and sudo requirements 2026-03-01 08:28:46 -05:00
S
8896d89078 feat: add boot option to runner configuration output 2026-03-01 08:28:28 -05:00
S
611c377bb1 fix: improve native runner removal process by handling missing plist files 2026-03-01 08:28:22 -05:00
S
debf89971a feat: add boot option for native runners in configuration example 2026-03-01 08:24:54 -05:00
S
b62996795c feat: validate boot option in runners configuration for native runners 2026-03-01 08:24:47 -05:00
S
dec895ca46 docs: update comments in plist template to clarify boot options and variables 2026-03-01 08:24:42 -05:00
S
457b9f82db feat: add boot option for native runners configuration 2026-03-01 08:24:38 -05:00
S
5341447acb feat: add support for boot flag in native runner configuration 2026-03-01 08:24:33 -05:00
S
dd0014b335 fix: update PATH in Gitea Actions runner plist template for compatibility 2026-03-01 08:17:21 -05:00
S
d74e40d596 feat: add newsyslog configuration template for Gitea Actions runner 2026-03-01 08:17:14 -05:00
S
e9940b75ee feat: enhance Docker Compose template with healthcheck and improved comments 2026-03-01 08:17:08 -05:00
S
cf72f9cd9f fix: enhance comments for clarity in Docker Compose runner template 2026-03-01 08:17:04 -05:00
S
c2a9ab1506 fix: update comments for clarity in runner configuration template 2026-03-01 08:16:57 -05:00
S
2f63b65d0d feat: expand API documentation for repository settings and GitHub Actions management 2026-03-01 08:16:42 -05:00
S
8403ea47c0 feat: enhance cleanup and setup_git_auth functions for improved security 2026-03-01 08:16:37 -05:00
S
924401a387 feat: add log rotation configuration for native runners on macOS 2026-03-01 08:16:32 -05:00
S
66febf69bb Persist configure_runners values incrementally 2026-03-01 08:15:32 -05:00
S
f4a6b04d14 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>
2026-02-28 23:14:46 -05:00
S
fcd966f97d feat: add interactive runners.conf configuration wizard
Replaces manual pipe-delimited file editing with a guided setup
script matching the configure_env.sh UX pattern.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 22:21:14 -05:00
S
5ce3a234f3 fix: harden phase auth and failure handling 2026-02-28 22:09:21 -05:00
S
0e0aeda658 feat: extract .env validators to common.sh and add validate_env()
Move 10 validation functions from configure_env.sh to lib/common.sh as
shared utilities. Define variable-to-validator mapping using parallel
arrays (bash 3.2 compatible). validate_env() checks all ~50 .env
variables against their expected format and reports all failures at once.

Wired into preflight.sh (Check 6b) and bitwarden_to_env.sh (post-restore).
configure_env.sh now sources validators from common.sh instead of
defining its own copies.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 22:08:01 -05:00
S
743f1281e6 chore: fix shellcheck findings across migration scripts 2026-02-28 21:39:23 -05:00
S
572e4c151c chore: snapshot current workspace changes 2026-02-28 21:35:03 -05:00
S
088e355962 docs: add README.md and USAGE_GUIDE.md
README covers architecture, 9-phase pipeline, file structure, design
decisions with rationale (bash over Ansible, single control plane,
envsubst templates, check-before-act idempotency, SQLite, mirror
marking vs archiving), and compromises (shared credentials, 3-repo
limit, syntactic workflow migration, no automatic rollback, timeout
polling, unencrypted backups, Docker socket exposure).

USAGE_GUIDE covers the happy path (automated and manual), resuming
after failure, edge cases (rate limits, token expiry, large repos,
port conflicts, DNS, Certbot, SSH, runner offline, invalid YAML),
rollback procedures (full, partial, single-phase, with cleanup),
verification commands for each rollback scenario, day-to-day ops
(version updates, token rotation, adding repos, mirror sync, SSL
renewal), backup/restore, runner management, and troubleshooting.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 21:06:36 -05:00
S
316d318b5e feat: add cross-host SSH trust, state-aware teardown, and configurable migration polling
- Add setup/cross_host_ssh.sh to establish ed25519 SSH trust between
  Unraid and Fedora (required by backup/restore scripts for direct SCP)
- Add ssh_key and authorized_key cleanup handlers to setup/cleanup.sh
- Rewrite phase8 cutover to mark GitHub repos as mirrors instead of
  archiving them (archived repos reject push mirror writes), with a
  JSON state snapshot of pre-cutover settings (description, homepage,
  wiki, projects, Pages) for exact restoration on teardown
- Rewrite phase8 teardown to restore from state snapshot with fallback
  to legacy "— was:" description parsing
- Make migration polling configurable via MIGRATION_POLL_INTERVAL_SEC
  and MIGRATION_POLL_TIMEOUT_SEC in .env (was hardcoded 120s/3s)
- Fix preflight SSL validation: check SSL_MODE instead of always
  requiring SSL_EMAIL, add conditional checks per SSL_MODE
- Add preflight checks 23-24: cross-host SSH connectivity
- Add --start-from range validation and cross_host_ssh.sh to run_all.sh

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 20:50:41 -05:00
S
dc08375ad0 fix: address multiple bugs from code review
- teardown_all.sh: replace `yes |` pipeline with `< <(yes)` process
  substitution to avoid SIGPIPE (exit 141) false failures under pipefail
- phase6_teardown.sh: extract push mirror `.id` instead of `.remote_name`
  to match the DELETE /push_mirrors/{id} API contract
- phase5_migrate_pipelines.sh: expand sed regex from `[a-z_]*` to
  `[a-z_.]*` to handle nested GitHub contexts like
  `github.event.pull_request.number`
- lib/common.sh: render_template now requires explicit variable list to
  prevent envsubst from eating Nginx variables ($host, $proxy_add_...)
- backup scripts: remove MacBook relay, use direct Unraid↔Fedora SCP;
  fix dump path to write to /data/ (mounted volume) instead of /tmp/
  (container-only); add unzip -t integrity verification
- preflight.sh: add --skip-port-checks flag for resuming with
  --start-from (ports already bound by earlier phases)
- run_all.sh: update run_step to pass extra args; use --skip-port-checks
  when --start-from > 1
- post-checks (phase4/7/9): wrap API calls in helper functions with
  >/dev/null redirection instead of passing -o /dev/null as API data
- phase8: replace GitHub archiving with [MIRROR] description marking
  and disable wiki/projects/Pages (archived repos reject push mirrors)
- restore_to_primary.sh: add require_vars for Fedora SSH variables

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 20:18:35 -05:00
S
07d27f7a9c feat: add version checking and install manifest tracking
Add minimum version validation for all dependencies across local and
remote machines (jq>=1.6, curl>=7.70, git>=2.30, docker>=20.0,
compose>=2.0, shellcheck>=0.8, gh>=2.0). Setup scripts now record
every install action to .manifests/<host>.manifest files, enabling
full rollback via setup/cleanup.sh. teardown_all.sh gains --cleanup
flag to chain prerequisite removal after phase teardowns.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 19:35:09 -06:00
S
720197bb10 feat: add OS compatibility checks before running platform-specific logic
- lib/common.sh: add require_local_os, require_remote_os, require_remote_pkg_manager
- setup/macbook.sh: require macOS (Darwin)
- setup/unraid.sh: require remote is Linux
- setup/fedora.sh: require remote is Linux + has dnf (RPM-based)
- manage_runner.sh: native runner add/remove requires macOS
- run_all.sh: control plane must be macOS
- preflight.sh: 3 new checks (1: local=macOS, 2: Unraid=Linux, 3: Fedora=Linux+dnf)
- phase5_migrate_pipelines.sh: fix sed -i to be portable (no macOS-only syntax)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 19:00:13 -06:00
S
40fe847755 feat: add orchestration (run_all.sh, teardown_all.sh)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 15:33:51 -06:00
S
e643caa0b0 feat: add backup and restore scripts
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 15:32:34 -06:00
S
ea5524949a feat: add Phase 9 — Security Scanning
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 15:30:38 -06:00
S
9379b95a41 feat: add Phase 8 — Cutover (HTTPS + Archive GitHub)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 15:29:14 -06:00
S
3179390af9 feat: add Phase 7 — Branch Protection
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 15:27:14 -06:00
S
058b85e146 feat: add Phase 6 — GitHub Push Mirrors
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 15:27:13 -06:00
S
6e3b4c66d1 feat: add Phase 5 — Migrate Pipelines (GitHub → Gitea Actions)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 15:25:04 -06:00