summary refs log tree commit diff
path: root/nixos/modules/services/networking
diff options
context:
space:
mode:
authorNiklas Hambüchen <mail@nh2.me>2022-10-25 15:53:43 +0200
committerKerstin <kerstin@erictapen.name>2022-10-25 23:11:50 +0200
commitf5c53868700881084a0d132aa18e24d3b71698a3 (patch)
treeb07e9d002016b8876e268afa521b1872d2debb0f /nixos/modules/services/networking
parentac6cf8a78b688fdae6e4f6c3008a0b3925d3f22d (diff)
nixos/smokeping: Don't show `413 Forbidden` on thttpd `/`. Fixes #197704
Diffstat (limited to 'nixos/modules/services/networking')
-rw-r--r--nixos/modules/services/networking/smokeping.nix11
1 files changed, 11 insertions, 0 deletions
diff --git a/nixos/modules/services/networking/smokeping.nix b/nixos/modules/services/networking/smokeping.nix
index df4f8905ec6f8..3a5fb7dfb9e24 100644
--- a/nixos/modules/services/networking/smokeping.nix
+++ b/nixos/modules/services/networking/smokeping.nix
@@ -318,6 +318,17 @@ in
       description = "smokeping daemon user";
       home = smokepingHome;
       createHome = true;
+      # When `cfg.webService` is enabled, `thttpd` makes SmokePing available
+      # under `${cfg.host}:${cfg.port}/smokeping.fcgi` as per the `ln -s` below.
+      # We also want that going to `${cfg.host}:${cfg.port}` without `smokeping.fcgi`
+      # makes it easy for the user to find SmokePing.
+      # However `thttpd` does not seem to support easy redirections from `/` to `smokeping.fcgi`
+      # and only allows directory listings or `/` -> `index.html` resolution if the directory
+      # has `chmod 755` (see https://acme.com/software/thttpd/thttpd_man.html#PERMISSIONS,
+      # " directories should be 755 if you want to allow indexing").
+      # Otherwise it shows `403 Forbidden` on `/`.
+      # Thus, we need to make `smokepingHome` (which is given to `thttpd -d` below) `755`.
+      homeMode = "755";
     };
     users.groups.${cfg.user} = {};
     systemd.services.smokeping = {