Explain rejected notifications.
And run as a dynamic user.
This commit is contained in:
parent
5fc207e38a
commit
b266cf9746
|
@ -50,6 +50,8 @@ in {
|
||||||
path = [ tattler ];
|
path = [ tattler ];
|
||||||
wantedBy = [ "default.target" ];
|
wantedBy = [ "default.target" ];
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
|
DynamicUser = true;
|
||||||
|
LoadCredential = [ "mqtt.passwd:${cfg.mqtt.password-file}" ];
|
||||||
ExecStart = pkgs.writeShellScript "tattler.sh" (concatStringsSep " " ([
|
ExecStart = pkgs.writeShellScript "tattler.sh" (concatStringsSep " " ([
|
||||||
"tattler"
|
"tattler"
|
||||||
"--mqtt-host=${cfg.mqtt.host}"
|
"--mqtt-host=${cfg.mqtt.host}"
|
||||||
|
@ -59,7 +61,8 @@ in {
|
||||||
] ++ (optional cfg.verbose "--verbose")
|
] ++ (optional cfg.verbose "--verbose")
|
||||||
++ (optional (cfg.mqtt.user != null) "--mqtt-user=${cfg.mqtt.user}")
|
++ (optional (cfg.mqtt.user != null) "--mqtt-user=${cfg.mqtt.user}")
|
||||||
++ (optional (cfg.mqtt.password-file != null)
|
++ (optional (cfg.mqtt.password-file != null)
|
||||||
"--mqtt-user=${cfg.mqtt.password-file}")));
|
"--mqtt-user=$CREDENTIALS_DIRECTORY/mqtt.passwd")));
|
||||||
|
Restart = "always";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -26,6 +26,7 @@
|
||||||
:body (:body note)
|
:body (:body note)
|
||||||
:urgency (-> note :urgency (keyword))
|
: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)))
|
(recur (<! note-chan)))
|
||||||
(log/info! logger "stopping")))))
|
(log/info! logger "stopping")))))
|
||||||
|
|
Loading…
Reference in New Issue