forge
Explore
Log in

Don't you dare go Hollow

📝 deploy: trusted proxies behind Ferron, tighter systemd unit

Browse files at this commit

dbbbc05c831791d28a9070bf25e8f8bf11a925b2Ahmet Kaan GümüşParent: c8c15ec
README.mdmodified+1 -1
@@ -39,7 +39,7 @@ Keys:
39 | `data_dir` | Directory for `iz.key`, the lock file, attachments and other local files. |39 | `data_dir` | Directory for `iz.key`, the lock file, attachments and other local files. |
40 | `listen` | HTTP listen address. Keep it on `127.0.0.1` behind the reverse proxy. |40 | `listen` | HTTP listen address. Keep it on `127.0.0.1` behind the reverse proxy. |
41 | `base_url` | Public URL used in links and mail. `https://` or `http://`, no trailing slash. |41 | `base_url` | Public URL used in links and mail. `https://` or `http://`, no trailing slash. |
42-| `trusted_proxies` | Peers whose `X-Forwarded-For` is trusted for client IPs. IPs or CIDR networks. |42+| `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. |
43 | `[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. |43 | `[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. |
44 | `[in_store]` | `enabled`. Stores attachments in the `in` Files service instead of local disk. Off by default. |44 | `[in_store]` | `enabled`. Stores attachments in the `in` Files service instead of local disk. Off by default. |
45 | `[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. |45 | `[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. |
config/iz.example.tomlmodified+1 -0
@@ -10,6 +10,7 @@ listen = "127.0.0.1:7654"
10 # Public base URL used in links and mail. No trailing slash.10 # Public base URL used in links and mail. No trailing slash.
11 base_url = "http://127.0.0.1:7654"11 base_url = "http://127.0.0.1:7654"
12 # Peers whose X-Forwarded-For is trusted for client IPs. Addresses or CIDR networks.12 # Peers whose X-Forwarded-For is trusted for client IPs. Addresses or CIDR networks.
13+# Behind Ferron on the same host, set ["127.0.0.1/32"]; left empty there, every visitor counts as 127.0.0.1.
13 trusted_proxies = []14 trusted_proxies = []
14 15
15 # Identity provider (OpenID Connect). Uncomment to enable sign-in.16 # Identity provider (OpenID Connect). Uncomment to enable sign-in.
deploy/iz.servicemodified+9 -0
@@ -17,6 +17,8 @@ User=iz
17 Group=iz17 Group=iz
18 ExecStart=/usr/local/bin/iz --config /etc/iz/iz.toml serve18 ExecStart=/usr/local/bin/iz --config /etc/iz/iz.toml serve
19 WorkingDirectory=/var/lib/iz19 WorkingDirectory=/var/lib/iz
20+StateDirectory=iz
21+StateDirectoryMode=0700
20 Restart=on-failure22 Restart=on-failure
21 RestartSec=523 RestartSec=5
22 UMask=007724 UMask=0077
@@ -43,6 +45,13 @@ LockPersonality=yes
43 MemoryDenyWriteExecute=yes45 MemoryDenyWriteExecute=yes
44 SystemCallArchitectures=native46 SystemCallArchitectures=native
45 SystemCallFilter=@system-service47 SystemCallFilter=@system-service
48+SystemCallFilter=~@privileged
49+ProtectProc=invisible
50+ProcSubset=pid
51+RemoveIPC=yes
52+PrivateMounts=yes
53+KeyringMode=private
54+MemoryMax=1G
46 SystemCallErrorNumber=EPERM55 SystemCallErrorNumber=EPERM
47 CapabilityBoundingSet=56 CapabilityBoundingSet=
48 AmbientCapabilities=57 AmbientCapabilities=