mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2025-01-07 22:11:45 +03:00
nixos/uhub: fix plugins, set CAP_NET_BIND_SERVICE
Fix generation of the plugins configuration and allow binding to "privileged" ports.
This commit is contained in:
parent
bad676c7ed
commit
2d012163f2
@ -80,11 +80,12 @@ in {
|
||||
tls_enable = cfg.enableTLS;
|
||||
file_plugins = pkgs.writeText "uhub-plugins.conf"
|
||||
(lib.strings.concatStringsSep "\n" (map ({ plugin, settings }:
|
||||
"plugin ${plugin} ${
|
||||
toString
|
||||
(lib.attrsets.mapAttrsToList (key: value: ''"${key}=${value}"'')
|
||||
settings)
|
||||
}") cfg.plugins));
|
||||
''
|
||||
plugin ${plugin} "${
|
||||
toString
|
||||
(lib.attrsets.mapAttrsToList (key: value: "${key}=${value}")
|
||||
settings)
|
||||
}"'') cfg.plugins));
|
||||
};
|
||||
in {
|
||||
name = "uhub/${name}.conf";
|
||||
@ -104,6 +105,9 @@ in {
|
||||
ExecStart = "${pkg}/bin/uhub -c /etc/uhub/${name}.conf -L";
|
||||
ExecReload = "${pkgs.coreutils}/bin/kill -HUP $MAINPID";
|
||||
DynamicUser = true;
|
||||
|
||||
AmbientCapabilities = "CAP_NET_BIND_SERVICE";
|
||||
CapabilityBoundingSet = "CAP_NET_BIND_SERVICE";
|
||||
};
|
||||
};
|
||||
}) hubs;
|
||||
|
Loading…
Reference in New Issue
Block a user