Initial commit: Gitea Docker Setup für Proxmox

- Docker-Compose Konfiguration
- Setup-Script für LXC Container
- Backup-Script mit Rotation
- Installationsanleitung

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Martin Eckardt
2025-12-28 14:01:12 +01:00
commit 4bf2207dcf
5 changed files with 339 additions and 0 deletions

173
docs/INSTALL.md Normal file
View File

@@ -0,0 +1,173 @@
# Gitea Installation auf Proxmox
## Voraussetzungen
- Proxmox VE Server
- Netzwerkzugang zum Proxmox Host
## 1. LXC Container erstellen
### Via Proxmox Web-UI:
1. **Container erstellen** → "Create CT"
2. **Template**: Debian 12 (bookworm)
3. **Ressourcen**:
- CPU: 1-2 Cores
- RAM: 1024 MB (min. 512 MB)
- Disk: 10 GB (erweiterbar)
4. **Netzwerk**:
- Bridge: vmbr0
- IP: Statische IP empfohlen (z.B. 192.168.1.50/24)
5. **Features**:
- ✅ Nesting aktivieren (für Docker)
### Via CLI:
```bash
pct create 200 local:vztmpl/debian-12-standard_12.2-1_amd64.tar.zst \
--hostname gitea \
--memory 1024 \
--cores 2 \
--rootfs local-lvm:10 \
--net0 name=eth0,bridge=vmbr0,ip=192.168.1.50/24,gw=192.168.1.1 \
--features nesting=1 \
--unprivileged 1 \
--start 1
```
## 2. Container vorbereiten
```bash
# In den Container einloggen
pct enter 200
# Oder via SSH
ssh root@192.168.1.50
```
## 3. Setup-Script ausführen
Die Dateien aus diesem Repository auf den Container kopieren:
```bash
# Vom lokalen Rechner (Git Bash/PowerShell):
scp -r docker scripts root@192.168.1.50:/root/
# Auf dem Container:
cd /root
chmod +x scripts/*.sh
./scripts/setup.sh
```
## 4. Gitea konfigurieren
1. **Browser öffnen**: `http://192.168.1.50:3000`
2. **Initiale Konfiguration**:
- Database: SQLite3 (bereits konfiguriert)
- Site Title: "Gitea"
- Server Domain: `git.local` oder IP
- SSH Port: 2222
3. **Admin-Account erstellen**:
- Username: admin
- E-Mail: deine@email.de
- Passwort: sicheres Passwort
## 5. DNS/Hosts konfigurieren (Optional)
### Windows (als Admin):
```
notepad C:\Windows\System32\drivers\etc\hosts
```
Hinzufügen:
```
192.168.1.50 git.local
```
### Linux/Mac:
```bash
echo "192.168.1.50 git.local" | sudo tee -a /etc/hosts
```
## 6. Repository verbinden
### Neues Repository in Gitea erstellen:
1. "+" → "New Repository"
2. Name: `glueckskonserve`
3. "Create Repository"
### Lokales Projekt verbinden:
```bash
cd ~/Documents/Projekte/glueckskonserve
# Remote hinzufügen
git remote add origin ssh://git@git.local:2222/deinuser/glueckskonserve.git
# Oder via HTTP
git remote add origin http://git.local:3000/deinuser/glueckskonserve.git
# Pushen
git push -u origin master
```
## 7. SSH-Key einrichten (empfohlen)
```bash
# Key generieren (falls nicht vorhanden)
ssh-keygen -t ed25519 -C "deine@email.de"
# Public Key anzeigen
cat ~/.ssh/id_ed25519.pub
```
Den Public Key in Gitea hinzufügen:
- Settings → SSH/GPG Keys → Add Key
## Wartung
### Backup manuell ausführen:
```bash
/opt/gitea/backup.sh
```
### Logs anzeigen:
```bash
docker logs gitea -f
```
### Gitea updaten:
```bash
cd /opt/gitea
docker compose pull
docker compose up -d
```
### Container-Status:
```bash
docker ps
docker stats gitea
```
## Troubleshooting
### Port bereits belegt:
```bash
# Ports prüfen
ss -tlnp | grep -E '3000|2222'
# docker-compose.yml anpassen falls nötig
```
### Gitea startet nicht:
```bash
docker logs gitea
docker compose -f /opt/gitea/docker-compose.yml down
docker compose -f /opt/gitea/docker-compose.yml up -d
```
### Berechtigungsprobleme:
```bash
# Volume-Berechtigungen prüfen
docker exec gitea ls -la /data
```