[ANSWERED] Configuration migration for v1.0.0

Hi guys, I am the maintainer of the plausible AUR package. In the AUR package, there is a config file in the form of a systemd environment file.

Currently it looks like this

ENVIRONMENT=production
PORT=8080
SECRET_KEY_BASE=iYb1mP5cnmY+gUxo7C/h6XMigossPhzwd8/ic6LFnQ9Y58Fl1xduSWaPq0fHDdbn
SIGNING_SALT=PL/THF0VMOzuv1bOcldjDzYFBLryvXNs
HOST=localhost

DATABASE_URL=postgres://postgres:postgres@plausible_db:5432/plausible
DATABASE_TLS_ENABLED=false

ADMIN_USER_NAME=admin
ADMIN_USER_EMAIL=admin@plausible.local
ADMIN_USER_PWD=admin@1234!

APP_VERSION=test

MAILER_ADAPTER=Bamboo.SMTPAdapter
SMTP_HOST_ADDR=fakesmtp_server
SMTP_HOST_PORT=1025
SMTP_USER_NAME=fakeuser@plausible.local
SMTP_USER_PWD=password
SMTP_HOST_SSL_ENABLED=false
SMTP_MX_LOOKUPS_ENABLED=false

CLICKHOUSE_DATABASE_HOST=plausible_events_db
CLICKHOUSE_DATABASE_NAME=plausible_events_db
CLICKHOUSE_DATABASE_USER=default
CLICKHOUSE_DATABASE_PASSWORD=

DISABLE_AUTH=false
DISABLE_REGISTRATION=false

First of all, how exactly would I migrate this to be compatible with the config changes? Also, are there any things I am doing wrong that should be done differently?

Thanks for your help in advance

The main change is the clickhouse database URL pattern: https://github.com/RealOrangeOne/infrastructure/blob/master/ansible/roles/plausible/files/docker-compose.yml#L24

Besides that, this looks mostly fine, although best check the docs: https://docs.plausible.io/self-hosting/

(On a side note, best change those signing keys and salts!)

With those signing keys and salts I have them in the default config file. I don’t know what I was thinking at the time of creating the package, but that seems wrong. Should I just leave them blank as default?

Yeah, everyone should generate their own SECRET_KEY_BASE. I’m not sure how we ended up with SIGNING_SALT in the example configs but it’s not actually used by the plausible app.

Here’s my take on upgrading your config

ENVIRONMENT=production
BASE_URL=localhost:8080
SECRET_KEY_BASE={change-me}

DATABASE_URL=postgres://postgres:postgres@plausible_db:5432/plausible

ADMIN_USER_NAME=admin
ADMIN_USER_EMAIL=admin@plausible.local
ADMIN_USER_PWD=admin@1234!

APP_VERSION=test

MAILER_ADAPTER=Bamboo.SMTPAdapter
SMTP_HOST_ADDR=fakesmtp_server
SMTP_HOST_PORT=1025
SMTP_USER_NAME=fakeuser@plausible.local
SMTP_USER_PWD=password
SMTP_HOST_SSL_ENABLED=false
SMTP_MX_LOOKUPS_ENABLED=false

CLICKHOUSE_DATABASE_URL=https://plausible_events_db:8123/plausible_events_db

Thanks, I don’t know exactly what I was thinking when I originally wrote it so I wanted to ask you guys before I pushed something that broke things.