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 = '' preStart = ''
cat ${configFile} > ${runConfig} cat ${configFile} > ${runConfig}
${optionalString (cfg.static-auth-secret-file != null) '' ${optionalString (cfg.static-auth-secret-file != null) ''
STATIC_AUTH_SECRET="$(head -n1 ${cfg.static-auth-secret-file} || :)" ${pkgs.replace-secret}/bin/replace-secret \
sed -e "s,#static-auth-secret#,$STATIC_AUTH_SECRET,g" \ "#static-auth-secret#" \
-i ${runConfig} ${cfg.static-auth-secret-file} \
${runConfig}
'' } '' }
chmod 640 ${runConfig} chmod 640 ${runConfig}
''; '';