authentik
authentik copied to clipboard
Support HA postgresql
When using a HA installation of postgresql connection problems with the api server arise during initial load of the user dashboard.
Pgbouncer in transaction pooling mode requires custom settings in order to function correctly. It would be nice if the user could specify that a HA installation is used and the settings are then adjusted automatically.
# https://docs.djangoproject.com/en/4.0/ref/databases/#transaction-pooling-server-side-cursors
DATABASES['default']['DISABLE_SERVER_SIDE_CURSORS'] = True
# https://docs.djangoproject.com/en/4.0/ref/databases/#persistent-connections
DATABASES['default']['CONN_MAX_AGE'] = None # persistent
Currently the settings do not include these options: https://github.com/goauthentik/authentik/blob/89c84f10d0e6e70e51444a9fbf18980ba25008de/authentik/root/settings.py#L279-L288
I can confirm that changing the settings according to above instructions enables authentik to work flawlessly with pgbouncer.