Configurable trusted proxy (FORWARDED_ALLOW_IPS); named deploy targets
FORWARDED_ALLOW_IPS (default 127.0.0.1) lets the app sit behind a proxy that reaches it over a Docker network instead of loopback; README shows the compose.override.yml for that. deploy.sh <name> picks HOST_<NAME> from the gitignored .deploy.env and leaves a server's compose.override.yml alone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
21202c2ca3
commit
080fb451a6
4 changed files with 38 additions and 9 deletions
22
README.md
22
README.md
|
|
@ -75,7 +75,27 @@ HOST=root@<server> ./deploy.sh # or put HOST=… in .deploy.env (gitignored)
|
|||
|
||||
On the server: `/opt/tools/{compose.yml,app/,data/}`, container `tools`, listening on
|
||||
`127.0.0.1:8090` only, so put a reverse proxy or tunnel connector on the same host in front of it.
|
||||
It trusts `X-Forwarded-For` from loopback only, which is what makes the per-IP paste limit work.
|
||||
It trusts `X-Forwarded-For` only from `FORWARDED_ALLOW_IPS` (default loopback), which is what makes
|
||||
the per-IP paste limit work.
|
||||
|
||||
For a proxy that runs in Docker instead (reaching the app over a Docker network), add a
|
||||
`compose.override.yml` next to `compose.yml` on the server; `deploy.sh` leaves it alone:
|
||||
|
||||
```yaml
|
||||
services:
|
||||
tools:
|
||||
network_mode: !reset null
|
||||
networks: [proxy]
|
||||
environment:
|
||||
HOST: 0.0.0.0 # inside the container's own network namespace
|
||||
FORWARDED_ALLOW_IPS: 172.16.0.0/12 # the proxy's Docker network
|
||||
networks:
|
||||
proxy:
|
||||
external: true
|
||||
name: <the proxy's network>
|
||||
```
|
||||
|
||||
Each server keeps its own pastes; instances don't share data.
|
||||
|
||||
## Pastebin limits
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue