Skip to content
This repository has been archived by the owner on Jun 27, 2023. It is now read-only.

Non-standard port for database #38

Open
counterpoint opened this issue Oct 7, 2019 · 1 comment
Open

Non-standard port for database #38

counterpoint opened this issue Oct 7, 2019 · 1 comment

Comments

@counterpoint
Copy link

Is there a way to access the database using a port other than the default? I tried changing .env with a line:
MAILMAN_HOST=127.0.0.1:4002
but that seemed to break the system, as no login was then possible. Is there a way to do this, or could I request some way to do it? I want to access a remote database via an SSH tunnel.

@counterpoint
Copy link
Author

counterpoint commented Oct 12, 2019

Seems like an additional parameter is essential to make this work. Something along the lines of this from a different application that uses knex:
{
name: 'global',
client: 'pg',
debug: false,
connection: {
multipleStatements: true,
host: url.parse(process.env.DB_PORT).hostname,
user: process.env.DB_USER,
port: parseInt(url.parse(process.env.DB_PORT).port, 10),
password: process.env.DB_PASSWORD,
database: process.env.DB_DATABASE,
},
migrations: {
directory:${__dirname}/../db/migrations,
},
}
Or simply set the port from an additional definition in .env. Simple enough to change the source code, but I'm using the docker package, and don't know enough to rebuild it with the change.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant