#Authentik not attempting to connect to remote postgres DB

1 messages · Page 1 of 1 (latest)

silk hatch
#

Hi, I'm having an issue where it seems like Authentik might not be using the postgresql settings in my environment file. I initially left the .env file alone after following the initial steps for the PG_PASS and secret key but I later created a Postgres VM that I want Authentik to use. My .env file now looks like this:

AUTHENTIK_POSTGRESQL__HOST=x.x.x.x
AUTHENTIK_POSTGRESQL__USER=user
AUTHENTIK_POSTGRESQL__PASSWORD=passwd
AUTHENTIK_POSTGRESQL__NAME=dbname
AUTHENTIK_SECRET_KEY=Secret_Key
PG_PASS=PG_PASSWD

I then started authentik and dumped the config. However, the result I still get is still

"postgresql": {
        "host": "postgresql",
        "name": "authentik",
        "user": "authentik",
        "port": 5432,
        "password": "PG_PASSWD",
        "use_pgbouncer": false,
        "use_pgpool": false
    },

I can see that it's pulling the PG_PASS variable, but everything else seems like it's using the default options (unless dump_config is hiding those). To check if it was using the external postgres instance, I shut down that VM, but was still able to log into Authentik.

I assumed the proper way to set this is through the .env file, but should I just edit the compose file instead? Is there something I'm misunderstanding? Is there a way for me to confirm authentik is using my instance of postgres?

silk hatch
#

Authentik not attempting to connect to remote postgres DB

dense geyser
#

If the variables are not set withtin the .env file, the docker compose files uses the default values. To connect to your external postgres set the following variables within your .env file

PG_HOST=your-vm-host
PG_DB=authentik (should exist in the database)
PG_USER=postgres-user
PG_PASS=PG_PASSWD
AUTHENTIK_POSTGRESQL__PORT=1234 (if your postgres port on the vm differs from 5432)