devbox icon indicating copy to clipboard operation
devbox copied to clipboard

Configurable plugins

Open jacobat opened this issue 1 year ago • 1 comments

What problem are you trying to solve?

I tried using the postgres plugin, but I was unable to start the postgres server as I was already running another postgres server on the machine, and so there was a port conflict. On a devbox I don't need the server to listen on a port, the postgres plugin is already configured to connect on a unix socket, so the doesn't need to open a network port.

What solution would you like?

It would be nice if the plugin could be passed a configuration that would either allow it to disable network connectivity entirely or to configure the server to listen on a different port.

Alternatives you've considered

There is the option to put a configuration in devbox.d - I'm not sure how a solution using that would work though.

jacobat avatar May 31 '24 19:05 jacobat

There kind is a way, but the plugin code needs to be modified. You can use an initialization script to check the value of an environment variable like PG_PORT which could hold the value "none" in your case to not bind to the port. Then you set the value of that variable in devbox.json.

It's a bit confusing at first, but the execution order of env/plugin init allow for that. Check the plugin lifecycle

svallory avatar Aug 15 '24 23:08 svallory