mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-14 14:10:33 +03:00

This avoids restarting the postgresql server, when only ensureDatabases or ensureUsers have been changed. It will also allow to properly wait for recovery to finish later. To wait for "postgresql is ready" in other services, we now provide a postgresql.target. Resolves #400018 Co-authored-by: Marcel <me@m4rc3l.de>
34 lines
996 B
Nix
34 lines
996 B
Nix
{ pkgs, ... }:
|
|
{
|
|
name = "postfixadmin";
|
|
meta = with pkgs.lib.maintainers; {
|
|
maintainers = [ globin ];
|
|
};
|
|
|
|
nodes = {
|
|
postfixadmin =
|
|
{ config, pkgs, ... }:
|
|
{
|
|
services.postfixadmin = {
|
|
enable = true;
|
|
hostName = "postfixadmin";
|
|
setupPasswordFile = pkgs.writeText "insecure-test-setup-pw-file" "$2y$10$r0p63YCjd9rb9nHrV9UtVuFgGTmPDLKu.0UIJoQTkWCZZze2iuB1m";
|
|
};
|
|
services.nginx.virtualHosts.postfixadmin = {
|
|
forceSSL = false;
|
|
enableACME = false;
|
|
};
|
|
};
|
|
};
|
|
|
|
testScript = ''
|
|
postfixadmin.start
|
|
postfixadmin.wait_for_unit("postgresql.target")
|
|
postfixadmin.wait_for_unit("phpfpm-postfixadmin.service")
|
|
postfixadmin.wait_for_unit("nginx.service")
|
|
postfixadmin.succeed(
|
|
"curl -sSfL http://postfixadmin/setup.php -X POST -F 'setup_password=not production'"
|
|
)
|
|
postfixadmin.succeed("curl -sSfL http://postfixadmin/ | grep 'Mail admins login here'")
|
|
'';
|
|
}
|