From 849ec008f14c20919e2d9f832fa443f896337787 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20Kaan=20G=C3=BCm=C3=BC=C5=9F?= Date: Wed, 28 Oct 2026 19:50:25 +0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=9D=20deploy:=20Ferron=20example=20in?= =?UTF-8?q?=20ferron.conf=20form=20with=20buffering=20off?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- deploy/ferron.conf | 20 ++++++++++++++++++++ deploy/ferron.kdl | 9 --------- 3 files changed, 21 insertions(+), 10 deletions(-) create mode 100644 deploy/ferron.conf delete mode 100644 deploy/ferron.kdl diff --git a/README.md b/README.md index dc8609b..9e0045d 100644 --- a/README.md +++ b/README.md @@ -183,7 +183,7 @@ systemctl daemon-reload systemctl enable --now im ``` -Put a TLS-terminating reverse proxy in front of it. `deploy/ferron.kdl` is an example Ferron site that +Put a TLS-terminating reverse proxy in front of it. `deploy/ferron.conf` is an example Ferron site that forwards to `127.0.0.1:7650`; `base_url` must be the same public origin. Three things matter in the proxy: - Redirect plain HTTP to HTTPS. `im` sends HSTS itself when `base_url` is `https://`. diff --git a/deploy/ferron.conf b/deploy/ferron.conf new file mode 100644 index 0000000..fb0c295 --- /dev/null +++ b/deploy/ferron.conf @@ -0,0 +1,20 @@ +# Ferron reverse proxy for im. Same format as the forge and iz examples (ferron.conf, not KDL). +# Replace im.example.com with the public host name (base_url in /etc/im/im.toml must match it). +# A bare host block gets automatic TLS. +# +# The proxy sends X-Forwarded-For for the client. im reads that header only from peers listed in +# trusted_proxies; with Ferron on the same machine the peer is 127.0.0.1, so set +# trusted_proxies = ["127.0.0.1/32"] in im.toml. Left empty, every visitor counts as 127.0.0.1 and one +# visitor's failures throttle everyone. +# +# Buffering is off because the live update streams (server-sent events) must reach the browser +# as they are written. +# +# Keep /reset/, /invite/ and /email/ out of the access log: those paths carry tokens that grant access. +im.example.com { + buffer_request 0 + buffer_response 0 + proxy { + upstream http://127.0.0.1:7650 + } +} diff --git a/deploy/ferron.kdl b/deploy/ferron.kdl deleted file mode 100644 index 6485726..0000000 --- a/deploy/ferron.kdl +++ /dev/null @@ -1,9 +0,0 @@ -// Example Ferron site for `im`. Ferron terminates TLS and forwards to the loopback listener of `im`. -// Check the directive names against the Ferron version you run; this file shows the shape, it has not been -// run against a live Ferron here. `base_url` in im.toml must be this same origin, and `trusted_proxies` -// must be ["127.0.0.1/32"]. In the real site also: redirect HTTP to HTTPS, do not buffer responses (the -// live streams need it), append the client to X-Forwarded-For, and keep /reset/, /invite/ and /email/ paths -// out of the access log: they carry one-time tokens. -im.example.com { - proxy http://127.0.0.1:7650 -}