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

Support of unix socket for access to mysql/mariadb database #41

Open
casswarry0 opened this issue Mar 4, 2020 · 0 comments
Open

Support of unix socket for access to mysql/mariadb database #41

casswarry0 opened this issue Mar 4, 2020 · 0 comments

Comments

@casswarry0
Copy link

To support unix sockets for database access I had to change the file:
/opt/mailman/build/main.js

where it was:
const db = __WEBPACK_IMPORTED_MODULE_0_knex___default()({
client: process.env.MAILMAN_DB_ENGINE || "maria",
connection: {
host: process.env.MAILMAN_DB_HOST || "127.0.0.1",
user: process.env.MAILMAN_DB_USER,
password: process.env.MAILMAN_DB_PASSWORD,
db: process.env.MAILMAN_DB_DATABASE
}
});

I made:
const db = __WEBPACK_IMPORTED_MODULE_0_knex___default()({
client: process.env.MAILMAN_DB_ENGINE || "maria",
connection: {
unixSocket: process.env.MAILMAN_DB_SOCKET,
host: process.env.MAILMAN_DB_HOST,
user: process.env.MAILMAN_DB_USER,
password: process.env.MAILMAN_DB_PASSWORD,
db: process.env.MAILMAN_DB_DATABASE
}
});

I added the unixSocket and removed the default from host. It would be nice to add port too, for issue #38. After the change, there has to be either MAILMAN_DB_SOCKET or MAILMAN_DB_HOST in the .env file but not both.

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