<#264 osctrl-tls doesn't use the defined user in `...
# osctrl
g
#264 osctrl-tls doesn't use the defined user in `db.json` Issue created by CptOfEvilMinions When osctrl-tls is started and passed a
db.json
config it doesn't use the username in the config (see error logs). I think the user
postgres
is hard coded. db.json:
Copy code
{
  "db": {
    "host": "127.0.0.1",
    "port": "5432",
    "name": "osctrl",
    "username": "osctrl",
    "password": "osctrl",
    "max_idle_conns": 20,
    "max_open_conns": 100,
    "conn_max_lifetime": 30
  }
}
Start osctrl-tls
Copy code
/usr/local/bin/osctrl-tls --config --config-file /etc/osctrl/osctrl-tls/service.json --redis --redis-file /etc/osctrl/redis.json --db --db-file /etc/osctrl/db.json
Error output:
Copy code
May 18 03:41:48 ubuntuvm osctrl-tls[6171]: main.go:124: Loading /etc/osctrl/osctrl-tls/service.json
May 18 03:41:48 ubuntuvm osctrl-tls[6171]: main.go:382: Initializing backend...
May 18 03:41:49 ubuntuvm osctrl-tls[6171]:
May 18 03:41:49 ubuntuvm osctrl-tls[6171]: 2022/05/18 03:41:49 /home/runner/work/osctrl/osctrl/backend/backend.go:64
May 18 03:41:49 ubuntuvm osctrl-tls[6171]: [error] failed to initialize database, got error failed to connect to `host=127.0.0.1 user=postgres database=osctrl`: failed SASL auth (FATAL: pass>
May 18 03:41:49 ubuntuvm osctrl-tls[6171]: main.go:391: Failed to connect to backend - Failed to get DB - failed to connect to `host=127.0.0.1 user=postgres database=osctrl`: failed SASL aut>
May 18 03:41:49 ubuntuvm systemd[1]: osctrl-tls.service: Main process exited, code=exited, status=1/FAILURE
jmpsec/osctrl