mirror of
https://github.com/SebastianWendel/nixpkgs.git
synced 2024-09-21 04:49:01 +02:00
nixos/roundcube: read only first line of password file
Only read the first line of the password file, if has multiple lines. Mention that behaviour in options documentation.
This commit is contained in:
parent
78fb35ce39
commit
9d5dba7170
|
@ -73,7 +73,8 @@ in
|
|||
description = lib.mdDoc ''
|
||||
Password file for the postgresql connection.
|
||||
Must be formated according to PostgreSQL .pgpass standard (see https://www.postgresql.org/docs/current/libpq-pgpass.html)
|
||||
and readable by user `nginx`. Ignored if `database.host` is set to `localhost`, as peer authentication will be used.
|
||||
but only one line, no comments and readable by user `nginx`.
|
||||
Ignored if `database.host` is set to `localhost`, as peer authentication will be used.
|
||||
'';
|
||||
};
|
||||
dbname = mkOption {
|
||||
|
@ -128,7 +129,7 @@ in
|
|||
<?php
|
||||
|
||||
${lib.optionalString (!localDB) ''
|
||||
$password = file_get_contents('${cfg.database.passwordFile}');
|
||||
$password = file('${cfg.database.passwordFile}')[0];
|
||||
$password = preg_split('~\\\\.(*SKIP)(*FAIL)|\:~s', $password);
|
||||
$password = end($password);
|
||||
$password = str_replace("\\:", ":", $password);
|
||||
|
|
Loading…
Reference in a new issue