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: subcommand for saving configuration #1317

Open ava-affine opened 1 week ago

ava-affine commented 1 week ago

unitctl should have an option to save the current running configuration, including NJS configuration and certificates.

Currently the closest analogue is for users to run unitctl edit and then to save the file, but this only works in interactive environments and even then does not include NJS configuration or certificates. Its also a weird path to take when all you want to do is save your configuration.

Consider the following: $ unitctl save golden-working-config.tar

Additionally, config saved with this subcommand should be immediately importable with unitctl import:

$ tar -xvf golden-working-config.tar
$ unitctl import golden-working-config
avahahn commented 1 week ago

A couple user stories that this work pertains to:

Per @lcrilly's comments in https://github.com/nginx/unit/pull/1321 I think it is worth using unitctl export for the subcommand here.

ac000 commented 6 days ago

Can this be closed?

avahahn commented 5 days ago

Not yet! We need to at least add support for js_modules. I would be in support of editing this ticket, closing it, and then making a new one for the remaining work if that is preferrable.