Switch Caddy to hardened non-root image
This commit is contained in:
1 parent
887668dde9
commit
3de3c867b9
4 files changed
+22
-7
No files matched your search
@@ -3,7 +3,7 @@
|
|||||||
"workspaceMount": "source=${localWorkspaceFolder},target=/workspace,type=bind,Z",
|
"workspaceMount": "source=${localWorkspaceFolder},target=/workspace,type=bind,Z",
|
||||||
"remoteUser": "dev",
|
"remoteUser": "dev",
|
||||||
"mounts": [
|
"mounts": [
|
||||||
"source=${localEnv:HOME}/.ssh,target=/root/.ssh,type=bind,readonly"
|
"source=${localEnv:HOME}/.ssh,target=/home/dev/.ssh,type=bind,readonly"
|
||||||
],
|
],
|
||||||
"build": {
|
"build": {
|
||||||
"dockerfile": "Dockerfile",
|
"dockerfile": "Dockerfile",
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
{
|
{
|
||||||
|
http_port 8080
|
||||||
|
https_port 8443
|
||||||
servers {
|
servers {
|
||||||
metrics
|
metrics
|
||||||
}
|
}
|
||||||
@@ -8,27 +10,37 @@
|
|||||||
admin :2019
|
admin :2019
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Fix pour le http3
|
||||||
|
(alt_svc) {
|
||||||
|
header Alt-Svc `h3=":443"; ma=2592000`
|
||||||
|
}
|
||||||
|
|
||||||
qpismont.fr {
|
qpismont.fr {
|
||||||
redir https://www.qpismont.fr
|
redir https://www.qpismont.fr
|
||||||
}
|
}
|
||||||
|
|
||||||
www.qpismont.fr {
|
www.qpismont.fr {
|
||||||
|
import alt_svc
|
||||||
root * /www/html
|
root * /www/html
|
||||||
file_server
|
file_server
|
||||||
}
|
}
|
||||||
|
|
||||||
gitea.qpismont.fr {
|
gitea.qpismont.fr {
|
||||||
|
import alt_svc
|
||||||
reverse_proxy gitea:3000
|
reverse_proxy gitea:3000
|
||||||
}
|
}
|
||||||
|
|
||||||
git.qpismont.fr {
|
git.qpismont.fr {
|
||||||
|
import alt_svc
|
||||||
reverse_proxy gitea:3000
|
reverse_proxy gitea:3000
|
||||||
}
|
}
|
||||||
|
|
||||||
woodpecker.qpismont.fr {
|
woodpecker.qpismont.fr {
|
||||||
|
import alt_svc
|
||||||
reverse_proxy woodpecker_server:8000
|
reverse_proxy woodpecker_server:8000
|
||||||
}
|
}
|
||||||
|
|
||||||
ntfy.qpismont.fr {
|
ntfy.qpismont.fr {
|
||||||
|
import alt_svc
|
||||||
reverse_proxy ntfy:80
|
reverse_proxy ntfy:80
|
||||||
}
|
}
|
||||||
@@ -28,7 +28,7 @@ Cette infrastructure héberge l'ensemble des services nécessaires pour le déve
|
|||||||
|
|
||||||
| Service | Image | Description | Exposition |
|
| Service | Image | Description | Exposition |
|
||||||
|---------|-------|-------------|------------|
|
|---------|-------|-------------|------------|
|
||||||
| **reverse_caddy** | `caddy:2.11-alpine` | Reverse proxy, HTTPS auto, HTTP/3 | `80`, `443/tcp`, `443/udp` |
|
| **reverse_caddy** | `dhi.io/caddy:2.11` | Reverse proxy, HTTPS auto, HTTP/3 (non-root, ports internes 8080/8443) | `80→8080`, `443→8443/tcp`, `443→8443/udp` |
|
||||||
| **wireguard_server** | `linuxserver/wireguard:latest` | VPN d'accès distant + CoreDNS | `51820/udp` |
|
| **wireguard_server** | `linuxserver/wireguard:latest` | VPN d'accès distant + CoreDNS | `51820/udp` |
|
||||||
|
|
||||||
### Stack `git`
|
### Stack `git`
|
||||||
@@ -156,7 +156,7 @@ Cette infrastructure héberge l'ensemble des services nécessaires pour le déve
|
|||||||
- **VPN** : WireGuard pour services internes
|
- **VPN** : WireGuard pour services internes
|
||||||
|
|
||||||
### Storage
|
### Storage
|
||||||
- **Volumes Docker** : `reversecaddydata`, `reversecaddyconfig` (core) · `giteadata`, `woodpeckerdata` (git) · `prometheusdata`, `tempodata`, `persesdata`, `alertmanagerdata`, `ntfydata` (observability)
|
- **Volumes Docker** : `reversecaddydata`, `reversecaddyconfig` (core, propriété UID 65532) · `giteadata`, `woodpeckerdata` (git) · `prometheusdata`, `tempodata`, `persesdata`, `alertmanagerdata`, `ntfydata` (observability)
|
||||||
- **Host mounts** : `/home/user/wireguard-config`, `/lib/modules` (WireGuard) · `/var/run/docker.sock` (Woodpecker agent, Herald, `docker-proxy-otel`) · `/` en lecture seule (OTel Collector)
|
- **Host mounts** : `/home/user/wireguard-config`, `/lib/modules` (WireGuard) · `/var/run/docker.sock` (Woodpecker agent, Herald, `docker-proxy-otel`) · `/` en lecture seule (OTel Collector)
|
||||||
|
|
||||||
### Monitoring
|
### Monitoring
|
||||||
@@ -203,6 +203,9 @@ Cette infrastructure héberge l'ensemble des services nécessaires pour le déve
|
|||||||
- Renouvellement automatique des certificats
|
- Renouvellement automatique des certificats
|
||||||
- Métriques Prometheus exposées
|
- Métriques Prometheus exposées
|
||||||
- Configuration simple (Caddyfile)
|
- Configuration simple (Caddyfile)
|
||||||
|
- Image hardened `dhi.io/caddy:2.11` : non-root (UID 65532), sans shell
|
||||||
|
- Écoute interne sur `8080`/`8443`, mappée depuis `80`/`443` (ports privilégiés)
|
||||||
|
- `Alt-Svc` forcé sur `:443` pour conserver HTTP/3 vu de l'extérieur
|
||||||
|
|
||||||
### WireGuard
|
### WireGuard
|
||||||
- VPN moderne et rapide
|
- VPN moderne et rapide
|
||||||
|
|||||||
@@ -2,11 +2,11 @@ version: "3"
|
|||||||
|
|
||||||
services:
|
services:
|
||||||
reverse_caddy:
|
reverse_caddy:
|
||||||
image: caddy:2.11-alpine
|
image: dhi.io/caddy:2.11
|
||||||
ports:
|
ports:
|
||||||
- "80:80"
|
- "80:8080"
|
||||||
- "443:443"
|
- "443:8443"
|
||||||
- "443:443/udp"
|
- "443:8443/udp"
|
||||||
configs:
|
configs:
|
||||||
- source: caddy_config
|
- source: caddy_config
|
||||||
target: /etc/caddy/Caddyfile
|
target: /etc/caddy/Caddyfile
|
||||||
|
|||||||
Reference in new issue
Block a user