Ask about HTTPS on a fresh install

A fresh install asks whether to serve HTTPS, with the reasons, before
touching anything. --yes keeps the default, --no-https answers it, and an
update keeps the saved mode. The prompt reads /dev/tty so `curl | bash`
still works; without a terminal the default is explained instead.

Also state why a production process is serving plain HTTP (no TLS vars),
instead of only giving that hint in development.
This commit is contained in:
2026-10-20 10:24:38 +01:00
parent e859bab294
commit 8c20c9a7ed
4 changed files with 86 additions and 10 deletions
+4 -2
View File
@@ -86,9 +86,11 @@ if (
bunext.bunextLog.info(`Using the development certificate in certs/`);
}
if (!cert_file && !key_file && process.env.NODE_ENV != "production") {
if (!cert_file && !key_file) {
bunext.bunextLog.info(
"Serving plain HTTP (run `bun run dev:phone`, or `bun run gen:certs` then restart, for HTTPS)",
process.env.NODE_ENV == "production"
? "Serving plain HTTP (set TLS_CERT_FILE and TLS_KEY_FILE for HTTPS)"
: "Serving plain HTTP (run `bun run dev:phone`, or `bun run gen:certs` then restart, for HTTPS)",
);
}