Strip newline when reading password files

This commit is contained in:
niten 2023-11-26 17:52:15 -08:00
parent 191429b307
commit 58558577b7
1 changed files with 4 additions and 2 deletions

View File

@ -12,6 +12,8 @@ let
hostSecrets = config.fudo.secrets.host-secrets."${config.instance.hostname}"; hostSecrets = config.fudo.secrets.host-secrets."${config.instance.hostname}";
removeNewline = removeSuffix "\n";
frigateCfg = let frigateCfg = let
content = builtins.toJSON { content = builtins.toJSON {
mqtt = { mqtt = {
@ -188,8 +190,8 @@ in {
fudo.secrets.host-secrets."${config.instance.hostname}" = { fudo.secrets.host-secrets."${config.instance.hostname}" = {
frigateEnv = { frigateEnv = {
source-file = let source-file = let
camPasswd = readFile cfg.camera-password-file; camPasswd = removeNewline (readFile cfg.camera-password-file);
mqttPasswd = readFile cfg.mqtt.password-file; mqttPasswd = removeNewline (readFile cfg.mqtt.password-file);
in makeEnvFile { in makeEnvFile {
FRIGATE_RTSP_PASSWORD = camPasswd; FRIGATE_RTSP_PASSWORD = camPasswd;
FRIGATE_MQTT_PASSWORD = mqttPasswd; FRIGATE_MQTT_PASSWORD = mqttPasswd;