nixos/prometheus-postfix-exporter: set default group
The postfix exporter needs to access postfix's `queue/public/` directory to read the `showq` socket inside. Instead of making the public directory world accessible, this sets the postfix exporter's group to `postdrop` by default, when the postfix service is enabled.
This commit is contained in:
parent
1179840f9a
commit
f412df1f6b
@ -229,6 +229,8 @@ in
|
|||||||
})] ++ [(mkIf config.services.nginx.enable {
|
})] ++ [(mkIf config.services.nginx.enable {
|
||||||
systemd.services.prometheus-nginx-exporter.after = [ "nginx.service" ];
|
systemd.services.prometheus-nginx-exporter.after = [ "nginx.service" ];
|
||||||
systemd.services.prometheus-nginx-exporter.requires = [ "nginx.service" ];
|
systemd.services.prometheus-nginx-exporter.requires = [ "nginx.service" ];
|
||||||
|
})] ++ [(mkIf config.services.postfix.enable {
|
||||||
|
services.prometheus.exporters.postfix.group = mkDefault config.services.postfix.setgidGroup;
|
||||||
})] ++ (mapAttrsToList (name: conf:
|
})] ++ (mapAttrsToList (name: conf:
|
||||||
mkExporterConf {
|
mkExporterConf {
|
||||||
inherit name;
|
inherit name;
|
||||||
|
@ -8,6 +8,15 @@ in
|
|||||||
{
|
{
|
||||||
port = 9154;
|
port = 9154;
|
||||||
extraOpts = {
|
extraOpts = {
|
||||||
|
group = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
description = ''
|
||||||
|
Group under which the postfix exporter shall be run.
|
||||||
|
It should match the group that is allowed to access the
|
||||||
|
<literal>showq</literal> socket in the <literal>queue/public/</literal> directory.
|
||||||
|
Defaults to <literal>services.postfix.setgidGroup</literal> when postfix is enabled.
|
||||||
|
'';
|
||||||
|
};
|
||||||
telemetryPath = mkOption {
|
telemetryPath = mkOption {
|
||||||
type = types.str;
|
type = types.str;
|
||||||
default = "/metrics";
|
default = "/metrics";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user