Merge pull request #195190 from Ma27/coturn-replace-secret

nixos/coturn: refactor secret injection
This commit is contained in:
Franz Pletz 2022-10-09 13:48:49 +02:00 committed by GitHub
commit 8a86d9d4aa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -335,9 +335,10 @@ in {
preStart = ''
cat ${configFile} > ${runConfig}
${optionalString (cfg.static-auth-secret-file != null) ''
STATIC_AUTH_SECRET="$(head -n1 ${cfg.static-auth-secret-file} || :)"
sed -e "s,#static-auth-secret#,$STATIC_AUTH_SECRET,g" \
-i ${runConfig}
${pkgs.replace-secret}/bin/replace-secret \
"#static-auth-secret#" \
${cfg.static-auth-secret-file} \
${runConfig}
'' }
chmod 640 ${runConfig}
'';