Explain rejected notifications.

And run as a dynamic user.
This commit is contained in:
niten 2023-05-18 12:00:32 -07:00
parent 5fc207e38a
commit b266cf9746
2 changed files with 6 additions and 2 deletions

View File

@ -50,6 +50,8 @@ in {
path = [ tattler ];
wantedBy = [ "default.target" ];
serviceConfig = {
DynamicUser = true;
LoadCredential = [ "mqtt.passwd:${cfg.mqtt.password-file}" ];
ExecStart = pkgs.writeShellScript "tattler.sh" (concatStringsSep " " ([
"tattler"
"--mqtt-host=${cfg.mqtt.host}"
@ -59,7 +61,8 @@ in {
] ++ (optional cfg.verbose "--verbose")
++ (optional (cfg.mqtt.user != null) "--mqtt-user=${cfg.mqtt.user}")
++ (optional (cfg.mqtt.password-file != null)
"--mqtt-user=${cfg.mqtt.password-file}")));
"--mqtt-user=$CREDENTIALS_DIRECTORY/mqtt.passwd")));
Restart = "always";
};
};
};

View File

@ -26,6 +26,7 @@
:body (:body note)
:urgency (-> note :urgency (keyword))
})
(log/error! logger (format "rejecting invalid notification: %s" note)))
(log/error! logger (format "rejecting invalid notification: %s"
(->> note (t/explain Notification) (t/humanize)))))
(recur (<! note-chan)))
(log/info! logger "stopping")))))