gitlab service: fix database creation
Providing custom a username and database name was broken. They were hardcoded to "gitlab".
This commit is contained in:
parent
2495065351
commit
f5a82e4714
@ -528,8 +528,8 @@ in {
|
||||
|
||||
if [ "${cfg.databaseHost}" = "127.0.0.1" ]; then
|
||||
if ! test -e "${cfg.statePath}/db-created"; then
|
||||
psql postgres -c "CREATE ROLE gitlab WITH LOGIN NOCREATEDB NOCREATEROLE NOCREATEUSER ENCRYPTED PASSWORD '${cfg.databasePassword}'"
|
||||
${config.services.postgresql.package}/bin/createdb --owner gitlab gitlab || true
|
||||
psql postgres -c "CREATE ROLE ${cfg.databaseUsername} WITH LOGIN NOCREATEDB NOCREATEROLE NOCREATEUSER ENCRYPTED PASSWORD '${cfg.databasePassword}'"
|
||||
${config.services.postgresql.package}/bin/createdb --owner ${cfg.databaseUsername} ${cfg.databaseName} || true
|
||||
touch "${cfg.statePath}/db-created"
|
||||
fi
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user