From dbbbc05c831791d28a9070bf25e8f8bf11a925b2 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:=20trusted=20proxies=20be?= =?UTF-8?q?hind=20Ferron,=20tighter=20systemd=20unit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- config/iz.example.toml | 1 + deploy/iz.service | 9 +++++++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 19f1a69..f55e3fd 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ Keys: | `data_dir` | Directory for `iz.key`, the lock file, attachments and other local files. | | `listen` | HTTP listen address. Keep it on `127.0.0.1` behind the reverse proxy. | | `base_url` | Public URL used in links and mail. `https://` or `http://`, no trailing slash. | -| `trusted_proxies` | Peers whose `X-Forwarded-For` is trusted for client IPs. IPs or CIDR networks. | +| `trusted_proxies` | Peers whose `X-Forwarded-For` is trusted for client IPs. IPs or CIDR networks. Behind Ferron on the same host, `["127.0.0.1/32"]`; left empty there, every visitor counts as the proxy. | | `[oidc]` | `issuer` (the `im` origin, no trailing slash; `https://` outside a local test), `client_id`, `client_secret_file`. Remove the section to run without sign-in. | | `[in_store]` | `enabled`. Stores attachments in the `in` Files service instead of local disk. Off by default. | | `[backup]` | `dir` (backup sets go here), `interval_hours` (1 to 720, default 24), `keep` (1 to 365, default 14), `healthcheck_url` (optional, pinged after each good backup). Remove the section to turn scheduled backups off. | diff --git a/config/iz.example.toml b/config/iz.example.toml index 9b2e39e..5d74d75 100644 --- a/config/iz.example.toml +++ b/config/iz.example.toml @@ -10,6 +10,7 @@ listen = "127.0.0.1:7654" # Public base URL used in links and mail. No trailing slash. base_url = "http://127.0.0.1:7654" # Peers whose X-Forwarded-For is trusted for client IPs. Addresses or CIDR networks. +# Behind Ferron on the same host, set ["127.0.0.1/32"]; left empty there, every visitor counts as 127.0.0.1. trusted_proxies = [] # Identity provider (OpenID Connect). Uncomment to enable sign-in. diff --git a/deploy/iz.service b/deploy/iz.service index 506390c..98fb11e 100644 --- a/deploy/iz.service +++ b/deploy/iz.service @@ -17,6 +17,8 @@ User=iz Group=iz ExecStart=/usr/local/bin/iz --config /etc/iz/iz.toml serve WorkingDirectory=/var/lib/iz +StateDirectory=iz +StateDirectoryMode=0700 Restart=on-failure RestartSec=5 UMask=0077 @@ -43,6 +45,13 @@ LockPersonality=yes MemoryDenyWriteExecute=yes SystemCallArchitectures=native SystemCallFilter=@system-service +SystemCallFilter=~@privileged +ProtectProc=invisible +ProcSubset=pid +RemoveIPC=yes +PrivateMounts=yes +KeyringMode=private +MemoryMax=1G SystemCallErrorNumber=EPERM CapabilityBoundingSet= AmbientCapabilities=