chore: install.sh asks for domain name instead of raw URL
- Prompts for domain and HTTPS preference - Builds proper BASE_URL from domain + protocol - Defaults to http://localhost:8080
This commit is contained in:
parent
c0d3002e22
commit
1aa5ec456e
1 changed files with 16 additions and 3 deletions
19
install.sh
19
install.sh
|
|
@ -171,12 +171,25 @@ fi
|
||||||
# ── 6. General settings ──────────────────────────────────────────
|
# ── 6. General settings ──────────────────────────────────────────
|
||||||
echo ""
|
echo ""
|
||||||
echo " ── General ──"
|
echo " ── General ──"
|
||||||
ask " Public URL [http://localhost:8080]: "
|
echo " If the app is behind a proxy (e.g. dev.lohmar.co.uk), enter the domain."
|
||||||
read -r BASE_URL
|
echo " Otherwise leave blank to use localhost."
|
||||||
BASE_URL="${BASE_URL:-http://localhost:8080}"
|
echo ""
|
||||||
|
ask " Domain name [localhost]: "
|
||||||
|
read -r DOMAIN
|
||||||
|
DOMAIN="${DOMAIN:-localhost}"
|
||||||
|
ask " HTTPS? (y/N): "
|
||||||
|
read -r USE_HTTPS
|
||||||
|
if [[ "$USE_HTTPS" =~ ^[Yy]$ ]]; then
|
||||||
|
BASE_URL="https://${DOMAIN}"
|
||||||
|
else
|
||||||
|
BASE_URL="http://${DOMAIN}"
|
||||||
|
fi
|
||||||
ask " Web server port [8080]: "
|
ask " Web server port [8080]: "
|
||||||
read -r PORT
|
read -r PORT
|
||||||
PORT="${PORT:-8080}"
|
PORT="${PORT:-8080}"
|
||||||
|
if [ "$DOMAIN" = "localhost" ]; then
|
||||||
|
BASE_URL="http://localhost:${PORT}"
|
||||||
|
fi
|
||||||
|
|
||||||
# ── 7. Write .env ────────────────────────────────────────────────
|
# ── 7. Write .env ────────────────────────────────────────────────
|
||||||
info "Creating .env..."
|
info "Creating .env..."
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue