This repository has been archived on 2026-02-15. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
breakpilot-pwa/scripts/setup-gitea.sh
Benjamin Admin bfdaf63ba9 fix: Restore all files lost during destructive rebase
A previous `git pull --rebase origin main` dropped 177 local commits,
losing 3400+ files across admin-v2, backend, studio-v2, website,
klausur-service, and many other services. The partial restore attempt
(660295e2) only recovered some files.

This commit restores all missing files from pre-rebase ref 98933f5e
while preserving post-rebase additions (night-scheduler, night-mode UI,
NightModeWidget dashboard integration).

Restored features include:
- AI Module Sidebar (FAB), OCR Labeling, OCR Compare
- GPU Dashboard, RAG Pipeline, Magic Help
- Klausur-Korrektur (8 files), Abitur-Archiv (5+ files)
- Companion, Zeugnisse-Crawler, Screen Flow
- Full backend, studio-v2, website, klausur-service
- All compliance SDKs, agent-core, voice-service
- CI/CD configs, documentation, scripts

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 09:51:32 +01:00

103 lines
3.4 KiB
Bash
Executable File

#!/bin/bash
# =============================================================================
# Gitea Setup Script
# =============================================================================
# Dieses Script richtet Gitea und den Actions Runner für die SBOM Pipeline ein.
#
# Voraussetzungen:
# - Docker und Docker Compose installiert
# - Zugriff auf Mac Mini (ssh macmini)
#
# Verwendung:
# ./scripts/setup-gitea.sh
# =============================================================================
set -e
echo "=========================================="
echo "Gitea Setup für BreakPilot"
echo "=========================================="
# Farben für Output
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color
# Prüfen ob wir auf Mac Mini sind oder lokal
if [ "$(hostname)" = "macmini" ] || [ "$(hostname)" = "Mac-mini" ]; then
DOCKER_CMD="docker"
COMPOSE_CMD="docker compose"
PROJECT_DIR="/Users/benjaminadmin/Projekte/breakpilot-pwa"
else
# Remote execution auf Mac Mini
DOCKER_CMD="ssh macmini /usr/local/bin/docker"
COMPOSE_CMD="ssh macmini /usr/local/bin/docker compose -f /Users/benjaminadmin/Projekte/breakpilot-pwa/docker-compose.yml"
PROJECT_DIR="."
fi
echo ""
echo -e "${YELLOW}1. Starte Gitea Container...${NC}"
$COMPOSE_CMD up -d gitea
echo ""
echo -e "${YELLOW}2. Warte auf Gitea Startup (30 Sekunden)...${NC}"
sleep 30
echo ""
echo -e "${YELLOW}3. Prüfe Gitea Health...${NC}"
HEALTH_CHECK=$(curl -s -o /dev/null -w "%{http_code}" http://macmini:3003/api/healthz 2>/dev/null || echo "000")
if [ "$HEALTH_CHECK" = "200" ]; then
echo -e "${GREEN}✓ Gitea ist erreichbar!${NC}"
else
echo -e "${RED}✗ Gitea nicht erreichbar (HTTP $HEALTH_CHECK)${NC}"
echo " Bitte prüfen: docker logs breakpilot-pwa-gitea"
exit 1
fi
echo ""
echo -e "${GREEN}=========================================="
echo "Gitea ist bereit!"
echo "==========================================${NC}"
echo ""
echo "Nächste Schritte (manuell):"
echo ""
echo "1. Öffne Gitea im Browser:"
echo " http://macmini:3003"
echo ""
echo "2. Erstelle einen Admin-Account:"
echo " - Username: admin"
echo " - Email: admin@breakpilot.de"
echo " - Passwort: (sicheres Passwort wählen)"
echo ""
echo "3. Erstelle ein Repository:"
echo " - Name: breakpilot-pwa"
echo " - Visibility: Private"
echo ""
echo "4. Aktiviere Gitea Actions:"
echo " Repository Settings → Actions → Enable Repository Actions"
echo ""
echo "5. Erstelle einen Runner Token:"
echo " Repository Settings → Actions → Runners → Create new Runner"
echo " → Token kopieren"
echo ""
echo "6. Starte den Runner mit Token:"
echo " export GITEA_RUNNER_TOKEN=<dein-token>"
echo " docker compose up -d gitea-runner"
echo ""
echo "7. Push das Repository zu Gitea:"
echo " git remote add gitea http://macmini:3003/admin/breakpilot-pwa.git"
echo " git push gitea main"
echo ""
echo "8. Die SBOM Pipeline läuft automatisch bei jedem Push!"
echo ""
echo -e "${YELLOW}Hinweis: Die PostgreSQL-Datenbank 'gitea' wird automatisch erstellt.${NC}"
echo ""
# Optional: Gitea DB in PostgreSQL erstellen
echo -e "${YELLOW}Erstelle Gitea Datenbank in PostgreSQL (falls nicht vorhanden)...${NC}"
$DOCKER_CMD exec -i breakpilot-pwa-postgres psql -U breakpilot -d postgres -c "CREATE DATABASE gitea;" 2>/dev/null || echo " (Datenbank existiert bereits)"
echo ""
echo -e "${GREEN}Setup abgeschlossen!${NC}"