mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-09-11 07:15:54 +03:00
nixos/smokeping: Don't show 413 Forbidden
on thttpd /
. Fixes #197704
This commit is contained in:
parent
ac6cf8a78b
commit
f5c5386870
@ -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 = {
|
||||
|
@ -28,6 +28,8 @@ import ./make-test-python.nix ({ pkgs, ...} : {
|
||||
sm.wait_for_unit("thttpd")
|
||||
sm.wait_for_file("/var/lib/smokeping/data/Local/LocalMachine.rrd")
|
||||
sm.succeed("curl -s -f localhost:8081/smokeping.fcgi?target=Local")
|
||||
# Check that there's a helpful page without explicit path as well.
|
||||
sm.succeed("curl -s -f localhost:8081")
|
||||
sm.succeed("ls /var/lib/smokeping/cache/Local/LocalMachine_mini.png")
|
||||
sm.succeed("ls /var/lib/smokeping/cache/index.html")
|
||||
'';
|
||||
|
Loading…
Reference in New Issue
Block a user