Commit Graph

182 Commits

Author SHA1 Message Date
S
e737128028 docs: update USAGE_GUIDE.md — Nginx→Caddy, ports→IPs, dynamic repos
- Prerequisites: Nginx container→Cloudflare API token, ports→macvlan IPs
- Edge cases: replaced Nginx/Certbot troubleshooting with Caddy/TLS_MODE
- Rollback: Nginx config removal→Caddy container/config removal
- Day-to-day: replaced certbot renewal with Caddy auto-renewal
- Adding repos: REPO_4_NAME→append to REPO_NAMES

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 11:08:10 -05:00
S
4ec30ca3e6 docs: update PLAN.md — Nginx→Caddy, SSL_MODE→TLS_MODE, port→IP checks
- Added note that plan describes original architecture with diffs noted
- Architecture table: Nginx+Certbot→Caddy+Cloudflare DNS-01
- File structure: nginx-gitea.conf.tpl→Caddyfile.tpl + caddy compose
- Variable table: NGINX_*/SSL_MODE/SSL_EMAIL→TLS_MODE/CADDY_*/CLOUDFLARE_*
- Preflight checks: port checks→container IP availability, Nginx→Caddy path
- Phase 8: complete rewrite from 10-step Nginx flow to 6-step Caddy flow
- Template section: replaced nginx template spec with Caddy template spec
- Removed stale port variables from "Not checked" list

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 11:06:53 -05:00
S
f87acc5664 docs: update README.md — Nginx→Caddy, dynamic repos, macvlan networking
- Architecture diagram: Gitea+Nginx→Gitea+Caddy, Let's Encrypt→macvlan
- Phase 8 description: Nginx→Caddy with Cloudflare DNS-01
- Template listing: nginx-gitea.conf.tpl→Caddyfile.tpl + caddy compose
- Design rationale: replaced "Why Nginx" with "Why Caddy"
- Compromises: replaced SSL cron section with Caddy auto-renewal
- Prerequisites: removed "existing Nginx container", added Cloudflare
- Removed hardcoded "3 repos" references throughout

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 11:04:11 -05:00
S
89bfc8a70f docs: update CLAUDE.md — Nginx→Caddy, 3 repos→dynamic, ssl_mode→tls_mode
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 11:02:29 -05:00
S
f15ab8c18c fix: remove stale RUNNER_DEFAULT_IMAGE_ENV fallback in manage_runner.sh
RUNNER_DEFAULT_IMAGE_ENV was never defined anywhere in the codebase.
The nested default was dead code left from a prior refactor.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 11:01:56 -05:00
S
16892d633f fix: correct case-sensitive host match in runner capacity defaults
The case statement matched uppercase UNRAID/FEDORA but $r_host is always
lowercase from validate_runner_host(). Unraid and Fedora runners were
silently falling through to the default capacity of 1 instead of 2.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 11:01:50 -05:00
S
d2e5a62510 fix: resolve shellcheck warnings (SC2168, SC2089, SC2090, SC2016, SC2329)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 10:39:38 -05:00
S
a037f22dcd fix: correct TOTAL_PROMPTS base count to 62 (including TLS conditional slots)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 10:37:13 -05:00
S
07d2d5ffdd chore: fix stale SSL_MODE comments in configure_env.sh
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 10:35:07 -05:00
S
01e67eb5c0 chore: remove stale validate_ssl_mode() and ssl_mode hint from common.sh
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 10:35:02 -05:00
S
734bfa8b3a feat: replace Nginx/SSL checks with Caddy/TLS checks in preflight.sh
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 10:34:28 -05:00
S
f46773a264 chore: remove obsolete nginx-gitea.conf.tpl (replaced by Caddyfile.tpl)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 10:33:44 -05:00
S
e8000a2f4f feat: replace Nginx/SSL prompts with Caddy/TLS prompts in configure_env.sh
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 10:33:36 -05:00
S
9f8822bc62 feat: replace Nginx/Certbot teardown with Caddy teardown in phase8_teardown.sh
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 10:32:51 -05:00
S
391c07a2de feat: rewrite phase8_cutover.sh from Nginx to Caddy reverse proxy
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 10:32:07 -05:00
S
cbfbff1447 feat: replace Nginx/SSL validation with TLS/Caddy in common.sh
Add validate_tls_mode() (cloudflare|existing). Replace
NGINX_CONTAINER_NAME, NGINX_CONF_PATH, SSL_MODE in validation arrays
with TLS_MODE, CADDY_DOMAIN, CADDY_DATA_PATH. Update conditional
arrays from SSL_MODE-based to TLS_MODE-based (CLOUDFLARE_API_TOKEN
for cloudflare, SSL_CERT_PATH/SSL_KEY_PATH for existing).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 10:28:41 -05:00
S
76ac854d65 feat: replace Nginx vars with Caddy/TLS vars in .env.example
Remove NGINX_CONTAINER_NAME, NGINX_CONF_PATH, SSL_MODE, SSL_EMAIL.
Add TLS_MODE (cloudflare|existing), CADDY_DOMAIN, CADDY_DATA_PATH,
CLOUDFLARE_API_TOKEN. Keep SSL_CERT_PATH/SSL_KEY_PATH for existing
cert mode.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 10:27:38 -05:00
S
744c70b534 feat: add docker-compose-caddy template
Caddy reverse proxy container using slothcroissant/caddy-cloudflaredns
image for DNS-01 TLS. Joins the macvlan gitea_net network with a
static IP. CADDY_ENV_VARS and CADDY_EXTRA_VOLUMES are populated by
phase8 based on TLS_MODE (cloudflare vs existing cert paths).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 10:27:13 -05:00
S
0555c8d8e9 feat: add Caddyfile template for reverse proxy
Template uses TLS_BLOCK placeholder that phase8 populates based on
TLS_MODE: cloudflare (DNS-01 wildcard via Cloudflare API) or
existing (manual cert/key paths). Reverse proxies to Gitea container
on its macvlan IP.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 10:26:53 -05:00
S
df297334ff feat: replace port prompts with macvlan networking in configure_env.sh
Remove UNRAID_GITEA_PORT, UNRAID_GITEA_SSH_PORT, FEDORA_GITEA_PORT,
FEDORA_GITEA_SSH_PORT prompts. Add DOCKER NETWORKING section with 14
macvlan prompts (parent NIC, subnet, gateway, IP range, container
IPs for gitea/db/caddy on each host). Update TOTAL_PROMPTS to 59.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 10:26:31 -05:00
S
3b98844973 feat: update preflight for macvlan networking
Add macvlan vars to REQUIRED_VARS. Replace port-free checks (13/14)
with container IP availability check that pings requested IPs to
verify they're not already in use on the LAN.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 10:25:15 -05:00
S
d202f75d87 feat: switch phase2 to macvlan networking
Replace host port vars with macvlan vars in require_vars. Add Step 2
to create macvlan gitea_net network on Fedora. Update docker-compose
rendering to use GITEA_CONTAINER_IP and DB_CONTAINER_IP. Use
FEDORA_GITEA_IP as domain for backup instance app.ini. Renumber steps.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 10:24:25 -05:00
S
64e7fd1bff feat: switch phase1 to macvlan networking
Replace host port vars with macvlan vars in require_vars. Add Step 2
to create the macvlan gitea_net network on Unraid. Update
docker-compose rendering to use GITEA_CONTAINER_IP and
DB_CONTAINER_IP instead of port mapping. Renumber steps accordingly.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 10:23:17 -05:00
S
54eab1bf89 feat: switch docker-compose template from port mapping to macvlan
Remove ports: section (no more host port mapping). Add networks:
with static ipv4_address for gitea and db containers. Reference
external gitea_net network (macvlan created by phase scripts).
Add DB_CONTAINER_IP for database service networking.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 10:22:02 -05:00
S
6ed1cff3f6 feat: update validation arrays for macvlan networking in common.sh
Remove UNRAID_GITEA_PORT, UNRAID_GITEA_SSH_PORT, FEDORA_GITEA_PORT,
FEDORA_GITEA_SSH_PORT from required validation. Add macvlan vars
(parent, subnet, gateway, ip_range, gitea_ip, caddy_ip) for both
hosts. Add UNRAID_DB_IP and FEDORA_DB_IP as optional validated vars.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 10:21:39 -05:00
S
927ba37661 feat: add macvlan networking vars, remove host port mapping from .env.example
Remove UNRAID_GITEA_PORT, UNRAID_GITEA_SSH_PORT, FEDORA_GITEA_PORT,
FEDORA_GITEA_SSH_PORT — containers now use their own LAN IPs on
standard ports. Add DOCKER NETWORKING section with macvlan config
(parent interface, subnet, gateway, IP range) and per-container
static IPs (gitea, db, caddy) for both hosts. Update internal URL
comments to reference container IPs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 10:21:06 -05:00
S
2a89c49733 docs: update README database section for multi-DB support
Replace single-DB rationale with description of all four supported
backends (sqlite3, mysql, postgres, mssql) and how the toolkit
handles each.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 10:20:03 -05:00
S
ba1a373ec9 feat: add conditional DB vars check to preflight.sh
When GITEA_DB_TYPE is not sqlite3, validate that GITEA_DB_HOST,
GITEA_DB_PORT, GITEA_DB_NAME, GITEA_DB_USER, and GITEA_DB_PASSWD
are set in the required vars check.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 10:19:45 -05:00
S
a44b49283b feat: add external database import to restore_to_primary.sh
After extracting the archive, import gitea-db.sql into the running
DB container for postgres/mysql/mssql. Each DB type uses its native
CLI tool inside the container. SQLite restores remain unchanged.
Add GITEA_DB_TYPE to require_vars.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 10:19:22 -05:00
S
f098abbe55 feat: add conditional database prompts to configure_env.sh wizard
Add db_type validation case. After GITEA_DB_TYPE prompt, conditionally
show 5 database connection prompts (host, port, name, user, passwd)
when DB type is not sqlite3. Auto-suggest default port per DB type
(mysql=3306, postgres=5432, mssql=1433). Update TOTAL_PROMPTS
dynamically.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 10:18:52 -05:00
S
b4b0d1b056 feat: add database support to phase2_gitea_fedora.sh
Mirror phase1 DB support: add _set_db_vars() and _strip_block()
helpers, conditional require_vars for DB connection, DB data directory
creation, and conditional template rendering for docker-compose and
app.ini based on GITEA_DB_TYPE.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 10:18:27 -05:00
S
2c900b7e4f feat: add database support to phase1_gitea_unraid.sh
Add _set_db_vars() helper to configure DB-specific docker-compose
vars (image, env, healthcheck, data dir) for postgres/mysql/mssql.
Add _strip_block() to remove conditional template markers. Update
docker-compose and app.ini rendering to strip/populate DB blocks
based on GITEA_DB_TYPE. Conditionally require DB connection vars.
Create DB data directory for external databases.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 10:17:37 -05:00
S
35aeb504c4 feat: add DB service block to docker-compose-gitea template
Add DB_SERVICE_START/END markers for the database container and
DB_DEPENDS_START/END for the gitea service depends_on. Phase scripts
strip these blocks for sqlite3 and populate DB-specific vars
(image, env, healthcheck, data dir) for mysql/postgres/mssql.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 10:16:37 -05:00
S
5be95ff98a feat: add conditional SQLITE/EXTDB blocks to app.ini template
Phase scripts strip the irrelevant block after render_template:
sqlite3 removes EXTDB_BLOCK, external DBs remove SQLITE_BLOCK.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 10:16:05 -05:00
S
02ffddf072 feat: add conditional database connection vars to .env.example
Add GITEA_DB_HOST, GITEA_DB_PORT, GITEA_DB_NAME, GITEA_DB_USER, and
GITEA_DB_PASSWD. These are only required when GITEA_DB_TYPE is not
sqlite3. Update DB_TYPE comment to list all valid options.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 10:15:53 -05:00
S
5cc8d14a29 feat: add database type validation and conditional DB vars to common.sh
Add validate_db_type() accepting sqlite3/mysql/postgres/mssql. Update
GITEA_DB_TYPE validator from nonempty to db_type. Add conditional DB
validation arrays (host, port, name, user, passwd) required when DB
type is not sqlite3. Rename SSL conditional arrays for clarity.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 10:15:35 -05:00
S
b32f5dc999 docs: update runners.conf.example for renamed vars and smart defaults
- data_path default: RUNNER_DATA_BASE_PATH/name
- capacity default: 2 (server), 1 (macOS) — no longer from .env

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 10:12:10 -05:00
S
18b9264343 refactor: remove RUNNER_DEFAULT_CAPACITY reference from manage_runner.sh
Capacity is now always set per-runner in runners.conf (smart defaults
applied during configure_runners.sh wizard).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 10:11:48 -05:00
S
74fdd3df8e refactor: update runner var names in preflight.sh required vars
- RUNNER_DEFAULT_DATA_PATH → RUNNER_DATA_BASE_PATH
- LOCAL_RUNNER_DATA_PATH → LOCAL_RUNNER_DATA_BASE_PATH

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 10:11:33 -05:00
S
c68c387091 feat: smart capacity defaults and per-runner data paths in runner wizard
- Capacity defaults: Unraid=2, Fedora=2, macOS=1 (based on host type)
- Data path appends runner name to base path to prevent collisions
- RUNNER_DEFAULT_DATA_PATH → RUNNER_DATA_BASE_PATH
- LOCAL_RUNNER_DATA_PATH → LOCAL_RUNNER_DATA_BASE_PATH

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 10:11:16 -05:00
S
567f507d05 refactor: update runner var names in configure_env.sh wizard
- Remove RUNNER_DEFAULT_CAPACITY prompt (smart defaults in runner wizard)
- RUNNER_DEFAULT_DATA_PATH → RUNNER_DATA_BASE_PATH
- LOCAL_RUNNER_DATA_PATH → LOCAL_RUNNER_DATA_BASE_PATH
- TOTAL_PROMPTS 53 → 52

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 10:10:41 -05:00
S
7ce562bc1c refactor: update runner var names in env validation arrays
- RUNNER_DEFAULT_DATA_PATH → RUNNER_DATA_BASE_PATH
- LOCAL_RUNNER_DATA_PATH → LOCAL_RUNNER_DATA_BASE_PATH
- Remove RUNNER_DEFAULT_CAPACITY from validation

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 10:10:20 -05:00
S
5b11af955c refactor: rename runner data path vars, remove RUNNER_DEFAULT_CAPACITY
- RUNNER_DEFAULT_DATA_PATH → RUNNER_DATA_BASE_PATH (clarify it's a host path)
- LOCAL_RUNNER_DATA_PATH → LOCAL_RUNNER_DATA_BASE_PATH
- Remove RUNNER_DEFAULT_CAPACITY (now smart defaults per host type in wizard)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 10:09:56 -05:00
S
768701004d docs: update PLAN.md for REPO_NAMES
Replace REPO_1/2/3_NAME references with REPO_NAMES.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 10:09:20 -05:00
S
3d0532ca40 docs: update README.md for dynamic repo list
Replace "hardcoded 3-repo limit" section with dynamic REPO_NAMES docs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 10:08:42 -05:00
S
6c193eb4b5 feat: dynamic repo count in configure_env.sh wizard
Replace 3 hardcoded REPO_N_NAME prompts with:
- "How many repos?" prompt
- Loop for each repo name
- Saves as space-delimited REPO_NAMES in .env
TOTAL_PROMPTS computed dynamically after repo count is known.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 10:08:28 -05:00
S
e564a99937 refactor: use REPO_NAMES in configure_runners.sh
- Update validate_runner_repos() to check against words in REPO_NAMES
- Update repos hint builder to iterate REPO_NAMES

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 10:06:48 -05:00
S
93aff03b19 refactor: use REPO_NAMES in preflight.sh
- Replace REPO_1/2/3_NAME in required vars with REPO_NAMES
- Update GitHub repos existence check to iterate REPO_NAMES
- Update runner repos validation to check against REPO_NAMES words

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 10:06:24 -05:00
S
a4e20ab4f1 refactor: use REPO_NAMES in phase9_teardown.sh
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 10:05:45 -05:00
S
2ba32d4bc8 refactor: use REPO_NAMES in phase9_post_check.sh
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 10:05:45 -05:00