nixos/fcgiwrap: do not run as root by default

Use a dynamic user instead unless one is specified.
This commit is contained in:
euxane 2024-06-08 23:07:33 +02:00
parent c5dc3e2034
commit 51b246a1ac
2 changed files with 10 additions and 3 deletions

View File

@ -51,6 +51,8 @@
`services.fcgiwrap.*` to `services.fcgiwrap.some-instance.*`.
The ownership and mode of the UNIX sockets created by this service are now
configurable and private by default.
Processes also now run as a dynamically allocated user by default instead of
root.
- `nvimpager` was updated to version 0.13.0, which changes the order of user and
nvimpager settings: user commands in `-c` and `--cmd` now override the

View File

@ -21,7 +21,10 @@ in {
process.user = mkOption {
type = types.nullOr types.str;
default = null;
description = "User as which this instance of fcgiwrap will be run.";
description = ''
User as which this instance of fcgiwrap will be run.
Set to `null` (the default) to use a dynamically allocated user.
'';
};
process.group = mkOption {
@ -106,10 +109,12 @@ in {
s = "${cfg.socket.type}:${cfg.socket.address}";
}))}
'';
} // (if cfg.process.user != null && cfg.process.group != null then {
} // (if cfg.process.user != null then {
User = cfg.process.user;
Group = cfg.process.group;
} else { } );
} else {
DynamicUser = true;
});
});
systemd.sockets = forEachInstance (cfg: mkIf (cfg.socket.type == "unix") {