1
0
mirror of git://f0xx.org/ac/ac-deploy synced 2026-07-29 04:38:48 +03:00

cluster0: lab seeds, Gitea mirrors, compose mail, verify tooling

Freeze lab-seeds backend for COMPOSE_SKIP_MONOLITH; fix Gitea mirror scripts
for 1.25 API; add secrets.lab.env template, verify-mail-lab, LAB_PUBLIC_ORIGIN,
and credentials pointers for mirror token recovery.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Anton Afanasyeu
2026-06-23 17:07:46 +02:00
parent 98f30786b7
commit c554dc761d
209 changed files with 31249 additions and 6 deletions

View File

@@ -0,0 +1,55 @@
#!/bin/sh
# Verify lab Gitea org ac mirrors vs ac-repos.list (cast01).
set -eu
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
# shellcheck source=/dev/null
. "$ROOT/scripts/lib/common.sh"
load_cluster_env
REPOS_FILE="${ROOT}/gitea/ac-repos.list"
DB="${GITEA_APP_DATA:-/var/lib/gitea}/gitea.db"
ORG="${GITEA_ORG:-ac}"
if [ "${GITEA_ENABLE:-0}" != "1" ]; then
log "GITEA_ENABLE!=1 — skip"
exit 0
fi
if ! is_primary_node; then
log "verify-gitea-mirrors: skip on $(host_short)"
exit 0
fi
FAIL=0
rc-service gitea status 2>/dev/null | grep -qi started || { log "FAIL gitea not running"; FAIL=1; }
curl -fsS -m 5 -o /dev/null http://127.0.0.1:3000/ || { log "FAIL gitea http"; FAIL=1; }
GITEA_COUNT="$(sqlite3 "$DB" "SELECT COUNT(*) FROM repository r JOIN user u ON r.owner_id=u.id WHERE u.lower_name='$(printf '%s' "$ORG" | tr '[:upper:]' '[:lower:]')';" 2>/dev/null || echo 0)"
log "gitea_org_${ORG}_repos=${GITEA_COUNT}"
while IFS= read -r _line || [ -n "$_line" ]; do
_line="$(printf '%s' "$_line" | sed 's/#.*//;s/^[ \t]*//;s/[ \t]*$//')"
[ -n "$_line" ] || continue
_repo="${_line%%|*}"
_url="${_line#*|}"
[ "$_url" = "$_repo" ] && _url="${AC_GIT_BASE:-git://f0xx.org/ac}/${_repo}"
if ! git ls-remote "$_url" HEAD >/dev/null 2>&1 && \
! git ls-remote "$_url" refs/heads/next >/dev/null 2>&1 && \
! git ls-remote "$_url" 2>/dev/null | grep -q refs/heads/; then
log "WARN git_missing $_url (not exported on git server)"
FAIL=1
continue
fi
if sqlite3 "$DB" "SELECT 1 FROM repository r JOIN user u ON r.owner_id=u.id WHERE u.lower_name='$(printf '%s' "$ORG" | tr '[:upper:]' '[:lower:]')' AND r.lower_name='$(printf '%s' "$_repo" | tr '[:upper:]' '[:lower:]')' LIMIT 1;" 2>/dev/null | grep -q 1; then
log "OK gitea_mirror ${ORG}/${_repo}"
else
log "FAIL gitea_missing ${ORG}/${_repo} (git remote OK)"
FAIL=1
fi
done < "$REPOS_FILE"
if [ "$FAIL" -eq 0 ]; then
log "verify-gitea-mirrors_ok"
exit 0
fi
log "verify-gitea-mirrors_WARN (see git_missing / gitea_missing above)"
exit 1