Compare commits

..
Author SHA1 Message Date
fauno 488777367f feat: trusted ips
continuous-integration/drone/pr Build is failing
when traefik is behind a reverse proxy, we need to tell it which
networks to trust with x-real-ip headers
2026-07-28 17:09:57 -03:00
5 changed files with 7 additions and 44 deletions
+2 -2
View File
@@ -226,5 +226,5 @@ WRITE_TIMEOUT=0s
## Enable onion service support
#ONION_ENABLED=1
## Access logs
#COMPOSE_FILE="$COMPOSE_FILE:compose.access-log.yml"
# YAML array of trusted subnets
TRUSTED_IPS=
-16
View File
@@ -77,19 +77,3 @@ protection your apps.**
Uncomment the line in the config setting `ONION_ENABLED=1`. This will create a new entrypoint on port 9052 which can be used to bypass forced SSL. For more details, see the [onion recipe](https://recipes.coopcloud.tech/onion).
[`abra`]: https://git.autonomic.zone/autonomic-cooperative/abra
## Access logs
To keep access logs on a volume, uncomment the "Access logs" section.
You'll need to setup rotation yourself and send the USR1 signal to
Traefik for reloading. For instance, with `logrotate:
```
# /etc/logrotate.d/traefik.conf
/var/lib/docker/volumes/traefik_SERVICE_NAME_access-logs/_data/access_log.jsonl {
postrotate
pkill -USR1 traefik
endscript
}
```
+1 -1
View File
@@ -1,3 +1,3 @@
export TRAEFIK_YML_VERSION=v33
export TRAEFIK_YML_VERSION=v32a
export FILE_PROVIDER_YML_VERSION=v12
export ENTRYPOINT_VERSION=v5
-10
View File
@@ -1,10 +0,0 @@
---
version: "3.8"
services:
app:
environment:
ACCESS_LOG_ENABLED: "true"
volumes:
- "access-logs:/var/log/"
volumes:
access-logs:
+4 -15
View File
@@ -6,21 +6,6 @@ log:
level: {{ env "LOG_LEVEL" }}
maxAge: {{ env "LOG_MAX_AGE" }}
{{ if eq (env "ACCESS_LOG_ENABLED") "true" }}
accessLog:
format: "json"
filePath: "/var/log/access_log.jsonl"
fields:
defaultMode: "keep"
headers:
defaultMode: "keep"
names:
Authorization: "drop"
Cookie: "drop"
queryParameters:
defaultMode: "keep"
{{ end }}
providers:
swarm:
endpoint: "tcp://socket-proxy:2375"
@@ -48,6 +33,10 @@ entrypoints:
to: web-secure
web-secure:
address: ":443"
{{ if ne (env "TRUSTED_IPS") "" }}
forwardedHeaders:
trustedIPs: {{ env "TRUSTED_IPS" }}
{{ end }}
transport:
respondingTimeouts:
readTimeout: {{ env "READ_TIMEOUT" }}