phiilu / mailman

Mailman is a GUI to help you manage your email accounts stored in a MySQL/MariaDB database.
MIT License
70 stars 10 forks source link

Non-standard port for database #38

Open counterpoint opened 4 years ago

counterpoint commented 4 years ago

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 commented 4 years ago

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.