mirror of
https://github.com/nextcloud/all-in-one.git
synced 2026-09-20 18:20:23 +00:00
The `/api/auth/login` and `/api/auth/getlogin` endpoints are already blocked for the nextcloud container. However containers that reach the mastercontainer via the host use the gateway ip of the `nextcloud-aio` network as source address, so requests from them were not caught by the existing matcher. The gateway ip is now read in start.sh and exported as DOCKER_NETWORK_GATEWAY so that it can be used via `remote_ip` in both Caddyfiles. Note that this needs a second matcher block instead of an additional line in the existing one because matchers of different types inside one named matcher are AND'ed together, which would never match. Also `remote_host` only resolves host names, hence the built-in `remote_ip` matcher is used for the ip. If the `nextcloud-aio` network does not exist yet - it only gets created by the php code once the containers get started for the first time - the value falls back to localhost, which is a no-op for the matcher, and the actual gateway ip gets applied on the next restart of the mastercontainer. Signed-off-by: Simon L. <szaimen@e.mail.de>