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:
Claus Lohmar 2026-05-30 15:08:26 +00:00
parent c0d3002e22
commit 1aa5ec456e

View file

@ -171,12 +171,25 @@ fi
# ── 6. General settings ──────────────────────────────────────────
echo ""
echo " ── General ──"
ask " Public URL [http://localhost:8080]: "
read -r BASE_URL
BASE_URL="${BASE_URL:-http://localhost:8080}"
echo " If the app is behind a proxy (e.g. dev.lohmar.co.uk), enter the domain."
echo " Otherwise leave blank to use localhost."
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]: "
read -r PORT
PORT="${PORT:-8080}"
if [ "$DOMAIN" = "localhost" ]; then
BASE_URL="http://localhost:${PORT}"
fi
# ── 7. Write .env ────────────────────────────────────────────────
info "Creating .env..."