mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-14 14:10:33 +03: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
1 changed files with 3 additions and 2 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue