hydra-module.nix: Don't use a password

[?]
Nov 6, 2013, 4:07 PM
V4R3SIRMYTN4CVYWPFPFT34N3PCGVTGNWUSX4VE4B4FT5EEVWJFAC

Dependencies

  • [2] 7XOH2DGH hydra-module.nix: Give types to options
  • [3] KMPLMG7T hydra-module.nix: Cleanup
  • [4] ZVGQP2SX hydra-module: Add a `logo' option.
  • [5] 3PNG7NIB Remove trailing whitespace
  • [6] D3MDJONY
  • [7] ASPNI2AO hydra-module.nix: Automatically create postgres db user for hydra and an admin hydra account
  • [8] T4DBPQOF hydra-module: Run hydra-init during hydra-init.service

Change contents

  • replacement in hydra-module.nix at line 43
    [2.57][3.122:190](),[3.1082][3.122:190]()
    default = "dbi:Pg:dbname=hydra;host=localhost;user=hydra;";
    [2.57]
    [3.1149]
    default = "dbi:Pg:dbname=hydra;user=hydra;";
    example = "dbi:Pg:dbname=hydra;host=postgres.example.org;user=foo;";
  • replacement in hydra-module.nix at line 183
    [3.195][3.88:345]()
    pass=$(HOME=/root ${pkgs.openssl}/bin/openssl rand -base64 32)
    if [ ! -f ${baseDir}/.pgpass ]; then
    ${config.services.postgresql.package}/bin/psql postgres << EOF
    CREATE USER hydra PASSWORD '$pass';
    EOF
    [3.195]
    [3.345]
    ${optionalString (cfg.dbi == "dbi:Pg:dbname=hydra;user=hydra;") ''
    if ! [ -e ${baseDir}/.db-created ]; then
    ${config.services.postgresql.package}/bin/createuser hydra
  • replacement in hydra-module.nix at line 187
    [3.425][3.425:697]()
    cat > ${baseDir}/.pgpass-tmp << EOF
    localhost:*:hydra:hydra:$pass
    EOF
    chown hydra ${baseDir}/.pgpass-tmp
    chmod 600 ${baseDir}/.pgpass-tmp
    mv ${baseDir}/.pgpass-tmp ${baseDir}/.pgpass
    fi
    [3.425]
    [2.655]
    touch ${baseDir}/.db-created
    fi
    ''}