diff --git a/rapport-stack-lxc.sh b/rapport-stack-lxc.sh index 61f9fb7..0850c69 100755 --- a/rapport-stack-lxc.sh +++ b/rapport-stack-lxc.sh @@ -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."