nixos

NixOS server files. Mirror from https://git.nordgedanken.dev/kubernetes/nixos
git clone git://archive.git.mtrnord.blog/MTRNord/nixos.git
Log | Files | Refs | README

commit 809aa1e18c9563126f135e827c03e0bd06272465
parent b98371fcb641674fd05ebfd798017a44401509f6
Author: MTRNord <mtrnord1@gmail.com>
Date:   Tue,  5 Sep 2023 19:27:44 +0200

Fix pg_hba perms

Diffstat:
Mnixos/common/lib/pgbouncer.nix | 52+++++++++++++++++++++++++++++++++-------------------
1 file changed, 33 insertions(+), 19 deletions(-)

diff --git a/nixos/common/lib/pgbouncer.nix b/nixos/common/lib/pgbouncer.nix @@ -31,27 +31,41 @@ }; }; - environment.etc."pgbouncer/pgbouncer.ini" = { - user = config.users.users.pgbouncer.name; - group = config.users.users.pgbouncer.group; - text = '' - [databases] - db2 = host=10.100.0.2 port=5432 - db = host=10.100.0.1 port=5432 + environment.etc = { + "pgbouncer/pg_hba.conf" = { - [pgbouncer] - listen_addr = :: - listen_port = 5000 + user = config.users.users.pgbouncer.name; + group = config.users.users.pgbouncer.group; + text = '' + host all all 10.100.12.1/32 md5 + host replication all 10.100.12.1/32 md5 + host all all 10.100.0.0/10 md5 + host replication all 10.100.0.0/10 md5 + host all all 10.244.0.0/10 md5 + ''; + }; + "pgbouncer/pgbouncer.ini" = { + user = config.users.users.pgbouncer.name; + group = config.users.users.pgbouncer.group; + text = '' + [databases] + db2 = host=10.100.0.2 port=5432 + db = host=10.100.0.1 port=5432 + + [pgbouncer] + listen_addr = :: + listen_port = 5000 - ; Define your PgBouncer user and password here (replace with your actual values) - auth_type = hba - auth_hba_file = ${config.services.patroni.postgresqlDataDir}/pg_hba.conf + ; Define your PgBouncer user and password here (replace with your actual values) + auth_type = hba + auth_hba_file = /etc/pgbouncer/pg_hba.conf - ; Connection Pooling Settings - pool_mode = transaction - max_client_conn = 200 - min_pool_size = 5 - reserve_pool_size = 5 - ''; + ; Connection Pooling Settings + pool_mode = transaction + max_client_conn = 200 + min_pool_size = 5 + reserve_pool_size = 5 + ''; + }; }; }