88f252f5f4
logs the raw XFF on a failed login. Once traefik trusts the tunnel's fixed address (controller v0.286.0), the leftmost entry is what a stranger writes; with the chain removed the app reads traefik's X-Real-Ip or its peer, as before — never forgeable. Measured on 9202: a router with this middleware receives no X-Forwarded-For (felhom.eu audits/visitors-2026-10-01/A/P1). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS
53 lines
1.8 KiB
YAML
53 lines
1.8 KiB
YAML
# Code-Server - VS Code a böngészőben - kódolás bárhonnan
|
|
# Domain: ${SUBDOMAIN}.${DOMAIN}
|
|
# Database: None (file-based)
|
|
# RAM: ~200M (mem_limit: 1024M) | Pi-compatible: No
|
|
#
|
|
# Environment variables:
|
|
# DOMAIN - Your domain (e.g., demo-felhom.eu)
|
|
# PASSWORD - Hozzáférési jelszó (auto-generated)
|
|
|
|
services:
|
|
code-server:
|
|
image: lscr.io/linuxserver/code-server:4.129.0
|
|
container_name: code-server
|
|
restart: unless-stopped
|
|
environment:
|
|
- TZ=Europe/Budapest
|
|
- PUID=1000
|
|
- PGID=1000
|
|
- PASSWORD=${PASSWORD}
|
|
- DEFAULT_WORKSPACE=/config/workspace
|
|
volumes:
|
|
- codeserver_config:/config
|
|
networks:
|
|
- traefik-public
|
|
deploy:
|
|
resources:
|
|
limits:
|
|
memory: 1024M
|
|
healthcheck:
|
|
test: ["CMD", "curl", "-f", "http://127.0.0.1:8443/healthz"]
|
|
interval: 30s
|
|
timeout: 5s
|
|
retries: 3
|
|
start_period: 30s
|
|
labels:
|
|
- "traefik.enable=true"
|
|
- "traefik.http.routers.code-server.rule=Host(`${SUBDOMAIN}.${DOMAIN}`)"
|
|
# R-753: this app reads the LEFTMOST X-Forwarded-For entry, which a stranger writes once traefik keeps the
|
|
# tunnel's chain — so its chain is removed here (it then reads traefik's X-Real-Ip or peer; never forgeable).
|
|
- "traefik.http.middlewares.code-server-xff.headers.customrequestheaders.X-Forwarded-For="
|
|
- "traefik.http.routers.code-server.middlewares=code-server-xff"
|
|
- "traefik.http.routers.code-server.entrypoints=websecure"
|
|
- "traefik.http.routers.code-server.tls=true"
|
|
- "traefik.http.routers.code-server.tls.certresolver=letsencrypt"
|
|
- "traefik.http.services.code-server.loadbalancer.server.port=8443"
|
|
|
|
volumes:
|
|
codeserver_config:
|
|
|
|
networks:
|
|
traefik-public:
|
|
external: true
|