# Gitea Stack Self-hosted Git Server mit PostgreSQL Backend und Redis Cache. ## Features - Gitea Git Server - PostgreSQL 16 als Datenbank-Backend - Redis 7 für Cache und Sessions - Traefik Integration für SSL - Persistent Volumes für Daten ## Voraussetzungen - Traefik Stack muss laufen (für SSL) - Infrastructure Network muss existieren - DNS-Eintrag für `git.michaelschiemer.de` ## Setup ### 1. Infrastructure Network erstellen ```bash docker network create infrastructure ``` ### 2. Secrets erstellen ```bash # PostgreSQL Passwort für Gitea openssl rand -base64 32 > secrets/postgres_password.txt chmod 600 secrets/postgres_password.txt # Redis Passwort openssl rand -base64 32 > secrets/redis_password.txt chmod 600 secrets/redis_password.txt ``` ### 3. Stack deployen ```bash docker compose up -d ``` ### 4. Initial Setup Nach dem ersten Start: 1. Öffne https://git.michaelschiemer.de 2. Führe das Initial Setup durch 3. Erstelle Admin-User ## Networks **traefik-public:** - Externes Network (von Traefik erstellt) - Für externe Zugriffe via Traefik **infrastructure:** - Externes Network (muss vorher erstellt werden) - Für interne Kommunikation zwischen Gitea, PostgreSQL und Redis ## Volumes - `gitea-data` - Gitea-Daten (Repositories, Konfiguration) - `gitea-postgres-data` - PostgreSQL-Daten für Gitea - `gitea-redis-data` - Redis-Daten für Gitea ## Konfiguration Gitea-Konfiguration wird in `/data/gitea/conf/app.ini` gespeichert. Für Änderungen: ```bash docker compose exec gitea vi /data/gitea/conf/app.ini docker compose restart gitea ``` ## Troubleshooting ### Gitea startet nicht ```bash # Logs prüfen docker compose logs -f gitea # PostgreSQL-Verbindung prüfen docker compose exec postgres pg_isready -U gitea ``` ### SSL-Zertifikat wird nicht erstellt 1. Prüfe Traefik-Logs 2. Prüfe DNS-Eintrag für `git.michaelschiemer.de` 3. Prüfe Traefik Labels ### Redis-Verbindungsprobleme ```bash # Redis-Logs prüfen docker compose logs redis # Redis-Verbindung testen docker compose exec redis redis-cli -a $(cat secrets/redis_password.txt) ping ```