docs(infra): add space-booking deploy guide and Gitea LXC 106 docs
- Add proxmox/lxc106-gitea/README.md: app.ini editing, Docker restart, webhook ALLOWED_HOST_LIST fix (hairpin NAT), troubleshooting - Add proxmox/lxc103-dokploy/docs/space-booking-app.md: full deploy guide with env vars, auto-seed accounts, SMTP, troubleshooting - Update proxmox/README.md: add LXC 106 entry and quick start - Update lxc103-dokploy/README.md: add space.roa.romfast.ro in domains table, ASCII architecture, and docs links Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
221
proxmox/lxc106-gitea/README.md
Normal file
221
proxmox/lxc106-gitea/README.md
Normal file
@@ -0,0 +1,221 @@
|
||||
# LXC 106 - Gitea (Git Server)
|
||||
|
||||
## Informații Generale
|
||||
|
||||
- **CTID:** 106
|
||||
- **IP:** 10.0.20.165
|
||||
- **Rol:** Git server self-hosted pentru toate repo-urile ROMFAST
|
||||
- **Host Proxmox:** pvemini (10.0.20.201)
|
||||
- **Status:** Running (onboot: enabled)
|
||||
- **URL public:** https://gitea.romfast.ro
|
||||
|
||||
---
|
||||
|
||||
## Arhitectură
|
||||
|
||||
Gitea rulează în Docker Compose pe LXC 106. Datele sunt persistate în volume locale.
|
||||
|
||||
```
|
||||
Internet → 188.26.14.103 → VM 201 IIS (SSL) → LXC 106 :3000 (Gitea)
|
||||
:222 (SSH git)
|
||||
```
|
||||
|
||||
### Containere Docker
|
||||
|
||||
| Container | Image | Port | Rol |
|
||||
|-----------|-------|------|-----|
|
||||
| `gitea` | docker.gitea.com/gitea:1.24.3 | 3000 (web), 222 (SSH) | Git server |
|
||||
| `gitea-db-1` | postgres:14 | 5432 (intern) | Bază de date |
|
||||
|
||||
### Volume (pe LXC 106)
|
||||
|
||||
| Cale pe LXC | Montat în container | Conținut |
|
||||
|-------------|--------------------|----|
|
||||
| `/opt/gitea/gitea/` | `/data` | Repo-uri, configurație, avatare, LFS |
|
||||
| `/opt/gitea/postgres/` | `/var/lib/postgresql/data` | Baza de date PostgreSQL |
|
||||
| `/opt/gitea/docker-compose.yml` | — | Definție servicii Docker |
|
||||
|
||||
### Fișier configurație principal
|
||||
|
||||
```
|
||||
/opt/gitea/gitea/gitea/conf/app.ini ← pe LXC 106 (host)
|
||||
/data/gitea/conf/app.ini ← în interiorul containerului
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Acces
|
||||
|
||||
### Web UI
|
||||
```
|
||||
https://gitea.romfast.ro (public, prin IIS)
|
||||
http://10.0.20.165:3000 (intern LAN)
|
||||
```
|
||||
|
||||
### SSH (operații git)
|
||||
```bash
|
||||
# Clone repo
|
||||
git clone git@gitea.romfast.ro:romfast/<repo>.git
|
||||
|
||||
# SSH config recomandat (~/.ssh/config)
|
||||
Host gitea.romfast.ro
|
||||
HostName 10.0.20.165
|
||||
Port 222
|
||||
User git
|
||||
IdentityFile ~/.ssh/gitea_ed25519
|
||||
```
|
||||
|
||||
### Shell pe LXC (din pvemini)
|
||||
```bash
|
||||
ssh root@10.0.20.201 "pct exec 106 -- sh -c '<comandă>'"
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Operații Frecvente
|
||||
|
||||
### Status containere
|
||||
```bash
|
||||
ssh root@10.0.20.201 "pct exec 106 -- docker ps"
|
||||
```
|
||||
|
||||
### Restart Gitea (după modificări app.ini)
|
||||
```bash
|
||||
ssh root@10.0.20.201 "pct exec 106 -- docker restart gitea"
|
||||
```
|
||||
|
||||
### Restart complet (Gitea + PostgreSQL)
|
||||
```bash
|
||||
ssh root@10.0.20.201 "pct exec 106 -- sh -c 'cd /opt/gitea && docker compose restart'"
|
||||
```
|
||||
|
||||
### Logs Gitea
|
||||
```bash
|
||||
ssh root@10.0.20.201 "pct exec 106 -- docker logs gitea -f --tail 50"
|
||||
```
|
||||
|
||||
### Logs PostgreSQL
|
||||
```bash
|
||||
ssh root@10.0.20.201 "pct exec 106 -- docker logs gitea-db-1 --tail 20"
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Modificare Configurație (app.ini)
|
||||
|
||||
**Fișier:** `/opt/gitea/gitea/gitea/conf/app.ini` pe LXC 106
|
||||
|
||||
### Vizualizare configurație curentă
|
||||
```bash
|
||||
ssh root@10.0.20.201 "pct exec 106 -- docker exec gitea cat /data/gitea/conf/app.ini"
|
||||
```
|
||||
|
||||
### Editare directă pe LXC
|
||||
```bash
|
||||
# Intră în LXC
|
||||
ssh root@10.0.20.201 "pct enter 106"
|
||||
|
||||
# Editează
|
||||
nano /opt/gitea/gitea/gitea/conf/app.ini
|
||||
|
||||
# Restart după modificare
|
||||
docker restart gitea
|
||||
```
|
||||
|
||||
### Adăugare secțiune nouă (non-interactiv)
|
||||
```bash
|
||||
ssh root@10.0.20.201 "pct exec 106 -- sh -c 'printf \"\n[sectiune]\nCHEIE = VALOARE\n\" >> /opt/gitea/gitea/gitea/conf/app.ini'"
|
||||
ssh root@10.0.20.201 "pct exec 106 -- docker restart gitea"
|
||||
```
|
||||
|
||||
> **Important:** `bash` nu este disponibil în LXC 106 — folosește `sh`.
|
||||
|
||||
---
|
||||
|
||||
## Configurații Notabile din app.ini
|
||||
|
||||
### Webhook — ALLOWED_HOST_LIST
|
||||
|
||||
Implicit Gitea blochează webhook-urile spre IP-uri private (protecție SSRF).
|
||||
Pentru a permite webhook-uri spre LXC-uri interne (ex: Dokploy pe 10.0.20.167):
|
||||
|
||||
```ini
|
||||
[webhook]
|
||||
ALLOWED_HOST_LIST = 10.0.20.0/24
|
||||
```
|
||||
|
||||
**Context:** Gitea nu poate accesa `dokploy.romfast.ro` din LAN (hairpin NAT).
|
||||
Webhook-urile spre Dokploy trebuie configurate cu IP intern:
|
||||
```
|
||||
http://10.0.20.167:3000/api/deploy/compose/<token>
|
||||
```
|
||||
|
||||
### Mailer (SMTP)
|
||||
|
||||
```ini
|
||||
[mailer]
|
||||
ENABLED = true
|
||||
SMTP_ADDR = mail.romfast.ro
|
||||
SMTP_PORT = 465
|
||||
FROM = gitea@romfast.ro
|
||||
USER = gitea@romfast.ro
|
||||
```
|
||||
|
||||
### Server
|
||||
|
||||
```ini
|
||||
[server]
|
||||
DOMAIN = gitea.romfast.ro
|
||||
ROOT_URL = https://gitea.romfast.ro/
|
||||
SSH_LISTEN_PORT = 22 ; intern în container
|
||||
SSH_PORT = 222 ; expus pe LXC
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Upgrade Gitea
|
||||
|
||||
```bash
|
||||
# Editează versiunea în docker-compose.yml
|
||||
ssh root@10.0.20.201 "pct exec 106 -- sh -c 'cd /opt/gitea && nano docker-compose.yml'"
|
||||
|
||||
# Pull imagine nouă și recreează containerul
|
||||
ssh root@10.0.20.201 "pct exec 106 -- sh -c 'cd /opt/gitea && docker compose pull && docker compose up -d'"
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Backup
|
||||
|
||||
Datele importante sunt în `/opt/gitea/` pe LXC 106:
|
||||
- `/opt/gitea/gitea/` — repo-uri, configurație, LFS, avatare
|
||||
- `/opt/gitea/postgres/` — baza de date PostgreSQL
|
||||
|
||||
Proxmox face backup automat al întregului LXC 106 zilnic la 02:00.
|
||||
|
||||
---
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Gitea nu pornește
|
||||
```bash
|
||||
ssh root@10.0.20.201 "pct exec 106 -- docker logs gitea --tail 50"
|
||||
```
|
||||
|
||||
### Webhook timeout din Gitea
|
||||
Cauză: hairpin NAT — Gitea nu poate accesa domenii publice care pointează spre LAN.
|
||||
Fix: folosește IP intern în URL webhook (ex: `http://10.0.20.167:3000/...`).
|
||||
Vezi secțiunea **Webhook — ALLOWED_HOST_LIST** de mai sus.
|
||||
|
||||
### Port 222 SSH nu răspunde
|
||||
```bash
|
||||
ssh root@10.0.20.201 "pct exec 106 -- docker ps | grep gitea"
|
||||
# Dacă containerul e oprit:
|
||||
ssh root@10.0.20.201 "pct exec 106 -- sh -c 'cd /opt/gitea && docker compose up -d'"
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
**Ultima actualizare:** 2026-03-04
|
||||
**Autor:** Marius Mutu
|
||||
**Proiect:** ROMFASTSQL - LXC 106 Gitea
|
||||
Reference in New Issue
Block a user