feat(stack-lxc): GITEA_TOKEN optional (Repos jetzt public)

Klont ohne Token solange alle Repos public sind; mit Token weiterhin
möglich (falls HOST/STACK wieder privat gestellt werden).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-05-31 14:47:26 +02:00
parent 90fb096ae5
commit b9b0c98d25
+12 -8
View File
@@ -49,8 +49,8 @@ echo -e "${BL}RAPPORT-STACK — Proxmox-LXC-Installer v${VERSION}${CL}"
[[ $EUID -eq 0 ]] || die "Bitte als root auf der Proxmox-Host-Shell ausführen."
command -v pct >/dev/null || die "pct nicht gefunden — Proxmox-VE-Host erwartet."
command -v pveam >/dev/null || die "pveam nicht gefunden — Proxmox-VE-Host erwartet."
[[ -n "$GITEA_TOKEN" ]] || die "GITEA_TOKEN fehlt. Private Repos (HOST/STACK) brauchen ihn.
Beispiel: GITEA_TOKEN=xxxx bash -c \"\$(curl -fsSL …/rapport-stack-lxc.sh)\""
# GITEA_TOKEN ist OPTIONAL: solange alle Repos public sind, klont es ohne.
# Falls RAPPORT-HOST/RAPPORT-STACK wieder privat sind, Token setzen.
# ═══ 1 · Debian-Template ════════════════════════════════════════════════════
info "Suche Debian-12-Template …"
@@ -105,16 +105,20 @@ pct exec "$CTID" -- bash -c '
msg "Docker + Node installiert."
# ═══ 5 · Repos klonen ═══════════════════════════════════════════════════════
# Token-URL nur für die privaten Repos; public über klare URL.
AUTH="${GITEA_USER}:${GITEA_TOKEN}@${GITEA#https://}"
# Klon-Präfix: mit Token (falls gesetzt, für private Repos), sonst plain.
if [[ -n "$GITEA_TOKEN" ]]; then
BASE="https://${GITEA_USER}:${GITEA_TOKEN}@${GITEA#https://}/${GITEA_USER}"
else
BASE="${GITEA}/${GITEA_USER}"
fi
info "Klone Repos nach /opt/rapport …"
pct exec "$CTID" -- bash -c "
set -euo pipefail
rm -rf /opt/rapport && mkdir -p /opt/rapport && cd /opt/rapport
git clone --depth 1 '${GITEA}/${GITEA_USER}/RAPPORT-SERVER.git' SERVER-CONTAINER
git clone --depth 1 '${GITEA}/${GITEA_USER}/RAPPORT-WEBSITE.git' RAPPORT-WEBSITE
git clone --depth 1 'https://${AUTH}/${GITEA_USER}/RAPPORT-HOST.git' RAPPORT-HOST
git clone --depth 1 'https://${AUTH}/${GITEA_USER}/RAPPORT-STACK.git' RAPPORT-STACK
git clone --depth 1 '${BASE}/RAPPORT-SERVER.git' SERVER-CONTAINER
git clone --depth 1 '${BASE}/RAPPORT-WEBSITE.git' RAPPORT-WEBSITE
git clone --depth 1 '${BASE}/RAPPORT-HOST.git' RAPPORT-HOST
git clone --depth 1 '${BASE}/RAPPORT-STACK.git' RAPPORT-STACK
"
msg "Repos geklont."