docs: add CLAUDE.md and docs/ configuration reference
This commit is contained in:
1 parent
d4a390388c
commit
74feb21b01
12 files changed
+497
No files matched your search
@@ -0,0 +1,41 @@
|
||||
# Reverse proxy Caddy
|
||||
|
||||
`Caddyfile` attuale:
|
||||
```
|
||||
your-domain.com {
|
||||
reverse_proxy gitea:3000
|
||||
}
|
||||
```
|
||||
Caddy gestisce da solo certificato Let's Encrypt, rinnovi, redirect HTTP→HTTPS e WebSocket (`/-/ws`, aggiornamenti in tempo reale) con `reverse_proxy`. Passa `Host` e `X-Forwarded-Proto` correttamente.
|
||||
|
||||
## Requisiti in Gitea
|
||||
```ini
|
||||
[server]
|
||||
ROOT_URL = https://your-domain.com/
|
||||
DOMAIN = your-domain.com
|
||||
[security]
|
||||
REVERSE_PROXY_LIMIT = 1
|
||||
REVERSE_PROXY_TRUSTED_PROXIES = 172.16.0.0/12 ; subnet rete docker compose (verificare)
|
||||
```
|
||||
Senza trusted proxies corretto Gitea (e fail2ban/log) vede l'IP del container Caddy invece del client.
|
||||
|
||||
## Sub-path (sconsigliato)
|
||||
```
|
||||
git.example.com {
|
||||
route /git/* {
|
||||
uri strip_prefix /git
|
||||
reverse_proxy gitea:3000
|
||||
}
|
||||
}
|
||||
```
|
||||
`ROOT_URL = https://git.example.com/git/`. Il proxy non deve decodificare `%2F`. Il registry container richiede `/v2` alla radice del dominio.
|
||||
|
||||
## Comandi
|
||||
```bash
|
||||
docker compose exec caddy caddy reload --config /etc/caddy/Caddyfile
|
||||
docker compose logs caddy
|
||||
```
|
||||
Il certificato non viene emesso se 80/443 non sono raggiungibili o il DNS non punta all'IP pubblico. Per test senza rate limit, usare in `Caddyfile` la direttiva globale `{ acme_ca https://acme-staging-v02.api.letsencrypt.org/directory }`.
|
||||
|
||||
## Limiti upload
|
||||
Caddy non limita il body di default; i limiti sono in Gitea (`[attachment] MAX_SIZE`, `[repository.upload]`, `[packages] LIMIT_SIZE_*`).
|
||||
Reference in new issue
Block a user