the script deploys [[Product Configurator]] from executor to coruscant.

# information

bin/deploy-configurator is written and does steps 1, 2 and 4: it copies the source to mini, asks for the settings and writes .env there, then builds and starts the container. I have not run it against mini; I tested every path against stand-ins for SSH, rsync and Docker on this machine.

Using it

From the project folder (it is on your PATH there):

``` bash
deploy-configurator                  # first time: asks for the settings
deploy-configurator                  # later: asks whether to keep them (Enter = keep)
deploy-configurator --keep-settings  # redeploy, ask nothing
deploy-configurator --new-settings   # ask again, current values offered as defaults
```

It targets mini and /Users/pierre-yvesgenot/Docker/configurator by default; --host and --dir change that, and --help lists everything.

What it asks for

- Host name: the name people will use, without https://.
- Email for Let's Encrypt: where certificate notices go.
- Mail server URL: optional, and typed hidden because it contains a password. Leave it empty and mails are printed to the container log.
- Sender of the mails: asked only if you gave a mail server.

It does not ask for the secret: it generates AUTH_SECRET on the first deployment and keeps it on every later one, so changing settings never signs anyone out. Before deploying it shows a summary and asks for a final yes.

Safeguards

- Wrong folder: if the target folder holds files that are not a deployment of this app, it stops before changing anything. This matters because the copy removes whatever is not in your checkout.
- Settings file: it is never overwritten by the copy, is written readable by you only, and the secret never appears in a command line.
- Preflight: it checks SSH, Docker with Compose and the nginx-proxy network on mini before touching anything.
- After starting: it waits for the container to report healthy; if it doesn't, it prints the last log lines and exits with an error.

On a first deployment it ends by printing the command to create the first Admin, since that step is not part of the script.

One thing to know: the script deploys your working folder as it is, including uncommitted changes. Right now that includes compose.proxy.yaml and the script itself, which are still uncommitted along with the proxy test, the .env.example and README updates, and the clearer upload-limit message.

## Creating the first admin user

``` bash
ssh mini "/usr/local/bin/docker exec configurator node_modules/.bin/tsx src/server/create-admin.ts you@example.com Your Name"
```
