Revert "ci: use GitHub Container Registry"

This reverts commit b29b017341.
This commit is contained in:
2026-09-16 20:37:12 +02:00
parent b29b017341
commit caf586f1ad
10 changed files with 321 additions and 64 deletions
+18 -18
View File
@@ -1,16 +1,16 @@
#!/usr/bin/env bash
# ANOUMA — production server installer.
#
# git clone https://github.com/whitehai11/anouma.git && cd anouma
# git clone https://git.maro.run/maro/anouma.git && cd anouma
# chmod +x setup.sh && ./setup.sh
#
# Prepares a fresh Ubuntu/Debian server for ANOUMA: installs Docker if
# needed, creates /opt/anouma, writes a production .env with generated
# secrets, creates a restricted `anouma-deploy` SSH user for GitHub Actions,
# secrets, creates a restricted `anouma-deploy` SSH user for Gitea Actions,
# and installs the server-side deploy.sh + docker-compose.yml.
#
# From then on, GitHub Actions owns all deployments (see
# .github/workflows/release.yml) — there is no update.sh. Pushing a release
# From then on, Gitea Actions owns all deployments (see
# .gitea/workflows/release.yml) — there is no update.sh. Pushing a release
# tag (vX.Y.Z) is the only way production gets updated.
#
# Safe to re-run: never regenerates an existing secret or SSH key, never
@@ -151,7 +151,7 @@ command -v wget >/dev/null 2>&1 || log_info "wget nicht gefunden — wird hier n
if systemctl is-active --quiet ssh 2>/dev/null || systemctl is-active --quiet sshd 2>/dev/null; then
log_success "SSH-Server läuft."
else
log_warn "Kein laufender SSH-Server erkannt (ssh/sshd) — GitHub Actions kann ohne einen laufenden SSH-Server nicht deployen. Installiere/starte z. B. 'openssh-server'."
log_warn "Kein laufender SSH-Server erkannt (ssh/sshd) — Gitea Actions kann ohne einen laufenden SSH-Server nicht deployen. Installiere/starte z. B. 'openssh-server'."
fi
# ---------------------------------------------------------------------------
@@ -317,8 +317,8 @@ GOOGLE_SITE_VERIFICATION=
DOCKER_NETWORK=anouma-network
NPM_NETWORK=
BACKUP_RETENTION_DAYS=14
REGISTRY=ghcr.io
REGISTRY_REPO=whitehai11/anouma
REGISTRY=git.maro.run
REGISTRY_REPO=maro/anouma
REGISTRY_USERNAME=
REGISTRY_PASSWORD=
ANOUMA_IMAGE=
@@ -380,7 +380,7 @@ if [ -z "$(env_get NPM_NETWORK)" ] && [ "$NPM_DETECTED" = true ]; then
fi
# --- registry --------------------------------------------------------------
REGISTRY_HOST="$(env_get REGISTRY)"; REGISTRY_HOST="${REGISTRY_HOST:-ghcr.io}"
REGISTRY_HOST="$(env_get REGISTRY)"; REGISTRY_HOST="${REGISTRY_HOST:-git.maro.run}"
log_info "Prüfe Registry-Erreichbarkeit ($REGISTRY_HOST) …"
REGISTRY_REACHABLE=false
REGISTRY_HTTP_CODE="$(curl -fsS -o /dev/null -w '%{http_code}' --max-time 5 "https://${REGISTRY_HOST}/v2/" 2>/dev/null || echo "000")"
@@ -405,7 +405,7 @@ if [ -z "$(env_get REGISTRY_USERNAME)" ]; then
NEED_REGISTRY_AUTH="$(ask_yn "Werden Zugangsdaten für die Container Registry benötigt (privates Repository)?" "Y")"
if [ "$NEED_REGISTRY_AUTH" = true ]; then
REG_USER="$(ask "Registry Username" "" "REGISTRY_USERNAME")"
REG_PASS="$(ask_secret "Registry Password/Token (GitHub Token mit read:packages)" "REGISTRY_PASSWORD")"
REG_PASS="$(ask_secret "Registry Password/Token (Gitea Personal Access Token empfohlen)" "REGISTRY_PASSWORD")"
if [ -z "$REG_USER" ] || [ -z "$REG_PASS" ]; then
if [ "$NON_INTERACTIVE" = true ]; then
fail "Registry-Zugangsdaten fehlen." "Setze die Umgebungsvariablen REGISTRY_USERNAME und REGISTRY_PASSWORD und starte setup.sh erneut, oder führe es interaktiv aus."
@@ -421,7 +421,7 @@ else
fi
if [ -z "$(env_get AUTO_DEPLOY)" ] || [ "$FRESH_INSTALL" = true ]; then
AUTO_DEPLOY_ANSWER="$(ask_yn "Enable automatic deployment (GitHub Actions deployt automatisch bei neuen Releases)?" "Y")"
AUTO_DEPLOY_ANSWER="$(ask_yn "Enable automatic deployment (Gitea Actions deployt automatisch bei neuen Releases)?" "Y")"
env_set AUTO_DEPLOY "$AUTO_DEPLOY_ANSWER"
fi
@@ -590,7 +590,7 @@ if [ -n "$EXISTING_IMAGE" ]; then
log_warn "Anwendung konnte nicht (neu) gestartet werden — prüfe: $COMPOSE logs app"
fi
else
log_info "Noch kein Release deployt — die Anwendung wird beim ersten Git-Tag automatisch über GitHub Actions gestartet."
log_info "Noch kein Release deployt — die Anwendung wird beim ersten Git-Tag automatisch über Gitea Actions gestartet."
if [ "$SKIP_SEED" = false ]; then
log_info "Hinweis: Inhalte können nach dem ersten Deploy mit 'docker compose run --rm app npm run seed' eingespielt werden."
fi
@@ -635,7 +635,7 @@ echo ""
echo "Registry:"
if [ "$REGISTRY_REACHABLE" = true ]; then echo " ✓ ($(env_get REGISTRY))"; else echo " ⚠ nicht erreichbar geprüft ($(env_get REGISTRY))"; fi
echo ""
echo "GitHub Actions:"
echo "Gitea Actions:"
echo " Ready"
echo ""
echo "Automatic Deployment:"
@@ -643,11 +643,11 @@ if [ "$(env_get AUTO_DEPLOY)" = "true" ]; then echo " Enabled"; else echo " Di
echo ""
echo "========================================"
echo "GITHUB DEPLOY SECRETS"
echo "GITEA SECRETS"
echo "========================================"
echo ""
if [ "$SSH_KEY_FRESH" = true ]; then
echo "Trage folgende Werte EINMALIG unter GitHub → whitehai11/anouma → Settings → Secrets and variables → Actions ein."
echo "Trage folgende Werte EINMALIG unter Gitea → maro/anouma → Settings → Secrets → Actions ein."
echo "Der private Key wird nach diesem Lauf nicht erneut angezeigt."
echo ""
echo "DEPLOY_HOST:"
@@ -664,13 +664,13 @@ if [ "$SSH_KEY_FRESH" = true ]; then
$SUDO cat "$KEY_PATH"
echo "----------------------------------------"
echo ""
echo "GHCR SERVER USERNAME (not a GitHub Secret):"
echo "REGISTRY_USERNAME:"
echo " $(env_get REGISTRY_USERNAME)"
echo ""
echo "GHCR SERVER TOKEN (not a GitHub Secret):"
echo "REGISTRY_PASSWORD:"
echo " $(env_get REGISTRY_PASSWORD)"
else
echo "Existing deployment key found — GitHub Secrets wurden bereits bei der ersten Einrichtung ausgegeben."
echo "Existing deployment key found — Gitea Secrets wurden bereits bei der ersten Einrichtung ausgegeben."
echo "Falls sie nicht mehr vorliegen: DEPLOY_SSH_KEY kann sicher eingesehen werden mit:"
echo " sudo cat $KEY_PATH"
fi
@@ -681,7 +681,7 @@ echo "NEXT STEP"
echo "========================================"
echo ""
echo "Add these values to:"
echo " GitHub → whitehai11/anouma → Settings → Secrets and variables → Actions"
echo " Gitea → maro/anouma → Settings → Secrets → Actions"
echo ""
echo "Danach reicht für jedes zukünftige Deployment:"
echo " git tag v1.0.0 && git push origin v1.0.0"