-
Notifications
You must be signed in to change notification settings - Fork 284
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support UNIX sockets based on vibe.D's IO #2101
Comments
Is this what you are looking for? Your issue is pretty unspecific. Please clarify. |
The thing is we use the nodejs mysql package in production as the cloud db instance uses UNIX sockets (proxy) to connect to the database in as secure way when deployed. The docs there says under Connection options :
It works as if both server process and database are on the same host machine. Its kind of like this code found in the issue you reference though: // examples/unix_socket_server/source/app.d
auto settings = new HTTPServerSettings;
settings.bindAddresses = ["/tmp/vibe.sock"];
listenHTTP(settings, router); The the const config = {
user: process.env.SQL_USER,
password: process.env.SQL_PASSWORD,
database: process.env.SQL_DATABASE
};
if (process.env.INSTANCE_CONNECTION_NAME && process.env.NODE_ENV === 'production') {
config.socketPath = `/cloudsql/${process.env.INSTANCE_CONNECTION_NAME}`;
}
// Connect to the database
const knex = Knex({
client: 'mysql',
connection: config
}); I requested UNIX socket connection support in mysql-native dub package and the dev mentioned vibe.d's IO something... needs to support such unix socket before mysql-native can support Unix socket IO compatible with vibe.d. |
This looks like a duplicate of #500 which has been fixed (but not closed yet) AFAIK. |
UNIX sockets provide a way to securely connect in an enclosed/isolated environment without exposing connection externally. This is used in my our microservice infrastructure on: we connect to our db instance using a proxy and its the recommended approach in microservices.
Its a very common security practice. The default approach on Google Cloud. I would do the same for any db I want to prevent external access to. If vibe.d doesn't support it then its missing a big piece of a puzzle.
Database libs like mysql-native could benefit from vibe.D's implementation to support UNIX socket connection that integrates well with vibe.d
The text was updated successfully, but these errors were encountered: