mirror of
https://github.com/Dvorinka/Primora.git
synced 2026-10-28 07:41:23 +00:00
fix(install): prompt on /dev/tty so it works under curl|bash
stdin is the script pipe when run as `curl ... | bash`, so the -t 0 check silently skipped the domain question. Read from the controlling terminal instead; no tty (CI/cron) still defaults to localhost. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
1 parent
ac4ca9a3ae
commit
1226d44872
2 files changed
+7
-6
No files matched your search
+1
-1
@@ -6,7 +6,7 @@ All notable changes to Primora. Format follows [Keep a Changelog](https://keepac
|
|||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|
||||||
- **Install script asks for the public URL** — `install.sh` now prompts for where you'll open the app and accepts a full URL: `https://primora.example.com` (TLS at your proxy, hints printed at the end), `primora.example.com`, or `192.168.1.50:8085` (the port becomes `NGINX_PORT`). The answer rewrites every public URL var in `.env` and `COOKIE_DOMAIN` for real DNS names. Non-interactive via `PUBLIC_URL=`; legacy `DOMAIN`/`NGINX_PORT` envs still work; reruns over an existing `.env` skip the question.
|
- **Install script asks for the public URL** — `install.sh` now prompts for where you'll open the app and accepts a full URL: `https://primora.example.com` (TLS at your proxy, hints printed at the end), `primora.example.com`, or `192.168.1.50:8085` (the port becomes `NGINX_PORT`). The answer rewrites every public URL var in `.env` and `COOKIE_DOMAIN` for real DNS names. The prompt reads the controlling terminal so it appears under `curl | bash`; no tty (CI, cron) falls back to `localhost`. Non-interactive via `PUBLIC_URL=`; legacy `DOMAIN`/`NGINX_PORT` envs still work; reruns over an existing `.env` skip the question.
|
||||||
|
|
||||||
## [0.8.2] - 2026-09-28
|
## [0.8.2] - 2026-09-28
|
||||||
|
|
||||||
|
|||||||
+6
-5
@@ -57,12 +57,13 @@ else
|
|||||||
if [ -z "$PUBLIC_URL" ]; then
|
if [ -z "$PUBLIC_URL" ]; then
|
||||||
DEFAULT_URL="http://localhost"
|
DEFAULT_URL="http://localhost"
|
||||||
[ "$NGINX_PORT" != "80" ] && DEFAULT_URL="http://localhost:$NGINX_PORT"
|
[ "$NGINX_PORT" != "80" ] && DEFAULT_URL="http://localhost:$NGINX_PORT"
|
||||||
if [ -t 0 ]; then
|
# Under `curl | bash` stdin is the script pipe — prompt on the
|
||||||
read -rp "URL where you'll open Primora (domain or IP, e.g. https://primora.example.com) [$DEFAULT_URL]: " PUBLIC_URL
|
# controlling terminal instead. No tty (CI/cron) → default silently.
|
||||||
PUBLIC_URL="${PUBLIC_URL:-$DEFAULT_URL}"
|
if exec 9</dev/tty 2>/dev/null; then
|
||||||
else
|
read -rp "URL where you'll open Primora (domain or IP, e.g. https://primora.example.com) [$DEFAULT_URL]: " PUBLIC_URL <&9 || true
|
||||||
PUBLIC_URL="$DEFAULT_URL"
|
exec 9>&-
|
||||||
fi
|
fi
|
||||||
|
PUBLIC_URL="${PUBLIC_URL:-$DEFAULT_URL}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Normalize: default scheme http, strip trailing slash.
|
# Normalize: default scheme http, strip trailing slash.
|
||||||
|
|||||||
Reference in new issue
Block a user