2022-06-12 15:39:15 +00:00
|
|
|
{pkgs, ...}: {
|
2022-05-03 09:31:27 +00:00
|
|
|
systemd.services."prometheus-statsd-exporter" = {
|
|
|
|
enable = true;
|
2022-06-12 15:39:15 +00:00
|
|
|
wantedBy = ["multi-user.target" "mastodon-web.service" "mastodon-sidekiq.service" "mastodon-streaming.service"];
|
|
|
|
after = ["network.target"];
|
2022-05-03 09:31:27 +00:00
|
|
|
serviceConfig = {
|
|
|
|
Restart = "always";
|
|
|
|
PrivateTmp = true;
|
|
|
|
WorkingDirectory = "/tmp";
|
|
|
|
DynamicUser = true;
|
2022-06-12 15:39:15 +00:00
|
|
|
CapabilityBoundingSet = [""];
|
|
|
|
DeviceAllow = [""];
|
2022-05-03 09:31:27 +00:00
|
|
|
LockPersonality = true;
|
|
|
|
MemoryDenyWriteExecute = true;
|
|
|
|
NoNewPrivileges = true;
|
|
|
|
PrivateDevices = true;
|
|
|
|
ProtectClock = true;
|
|
|
|
ProtectControlGroups = true;
|
|
|
|
ProtectHome = true;
|
|
|
|
ProtectHostname = true;
|
|
|
|
ProtectKernelLogs = true;
|
|
|
|
ProtectKernelModules = true;
|
|
|
|
ProtectKernelTunables = true;
|
|
|
|
ProtectSystem = "strict";
|
|
|
|
RemoveIPC = true;
|
2022-06-12 15:39:15 +00:00
|
|
|
RestrictAddressFamilies = ["AF_INET" "AF_INET6"];
|
2022-05-03 09:31:27 +00:00
|
|
|
RestrictNamespaces = true;
|
|
|
|
RestrictRealtime = true;
|
|
|
|
RestrictSUIDSGID = true;
|
|
|
|
SystemCallArchitectures = "native";
|
|
|
|
UMask = "0077";
|
|
|
|
ExeStart = ''
|
|
|
|
${pkgs.prometheus-statsd-exporter}/bin/prometheus-statsd-exporter --web-listen-adress="[::]:9102" --statsd.listen-upd="127.0.0.1:9125"
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
2022-06-12 15:39:15 +00:00
|
|
|
networking.firewall.interfaces."wg0".allowedTCPPorts = [9102];
|
2022-05-03 09:31:27 +00:00
|
|
|
}
|