nginx / unit

NGINX Unit - universal web app server - a lightweight and versatile open source server that simplifies the application stack by natively executing application code across eight different programming language runtimes.
https://unit.nginx.org
Apache License 2.0
5.25k stars 320 forks source link

CLI: deploy configuration to many instances #1318

Open ava-affine opened 1 week ago

ava-affine commented 1 week ago

unitctl import and unitctl execute should be able to send configuration snippets to a configurable list of Unit instances. Currently when multiple Unit instances exist on a host unitctl will ask for clarification on which control socket/endpoint to use. This should be extended to support a list. Under no circumstances should unitctl automatically broadcast to many Unit instances without a specific invocation from the user.

lcrilly commented 1 week ago

Does this apply to multiple instances on the host where unitctl is executed, or to multiple instances over a network?

avahahn commented 1 week ago

It should apply for any control socket that unitctl can reach. At the moment unitctl knows how to access control sockets over TCP and via a file socket. If the user sets up some number of proxies for instances over the network then we shouldn't refuse to operate on them.

avahahn commented 2 days ago

Just want to drop a quick note here on implementation:

Currently the CLI has a global flag for specifying a control socket when there are multiple Unit instances detected. This needs to be refactored to accept either a single socket or a list of sockets.

Additionally, code will be needed in main.rs to apply the specified cli command to each provided control socket. Perhaps socket should be an argument to each command in the cmd submodule. Existing commands should be checked to make sure that they arent manually handling the control socket flag.