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>
This commit is contained in:
@@ -7,7 +7,7 @@ set -euo pipefail
|
||||
# 1. HTTPS works with valid cert
|
||||
# 2. HTTP redirects to HTTPS
|
||||
# 3. All repos accessible via HTTPS
|
||||
# 4. GitHub repos are archived
|
||||
# 4. GitHub repos are marked as offsite backup
|
||||
# Exits 0 only if ALL checks pass.
|
||||
# =============================================================================
|
||||
|
||||
@@ -64,14 +64,14 @@ for repo in "${REPOS[@]}"; do
|
||||
curl -sf -o /dev/null -H "Authorization: token ${GITEA_ADMIN_TOKEN}" "https://${GITEA_DOMAIN}/api/v1/repos/${GITEA_ORG_NAME}/${repo}"
|
||||
done
|
||||
|
||||
# Check 5: GitHub repos are archived
|
||||
# Check 5: GitHub repos are marked as offsite backup
|
||||
for repo in "${REPOS[@]}"; do
|
||||
check_archived() {
|
||||
local is_archived
|
||||
is_archived=$(github_api GET "/repos/${GITHUB_USERNAME}/$1" | jq -r '.archived')
|
||||
[[ "$is_archived" == "true" ]]
|
||||
check_mirror_marked() {
|
||||
local desc
|
||||
desc=$(github_api GET "/repos/${GITHUB_USERNAME}/$1" | jq -r '.description // ""')
|
||||
[[ "$desc" == "[MIRROR]"* ]]
|
||||
}
|
||||
run_check "GitHub repo ${repo} is archived" check_archived "$repo"
|
||||
run_check "GitHub repo ${repo} marked as mirror" check_mirror_marked "$repo"
|
||||
done
|
||||
|
||||
# Summary
|
||||
|
||||
Reference in New Issue
Block a user