setup.sh: ask Caddy location first in site wizard, skip network prompt if not local

Reorders the site defaults wizard so 'Where does Caddy run?' comes before
timezone/domain, since it's the more fundamental choice and the answer
context matters when explaining the other prompts. Also skips the Caddy
Docker network prompt entirely when Caddy isn't running locally — that
setting is only relevant to services joining a local Caddy container's
bridge network; remote/none mode proxies via localhost:PORT + snippet
files instead.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LQJBvqzXeyuhhAcAA3Q5Wq
This commit is contained in:
Claude
2026-07-01 16:45:47 +00:00
parent 83293f61cd
commit a9446190da
+11 -5
View File
@@ -131,11 +131,6 @@ run_site_configure() {
[ -z "$_cur_mode" ] && [ -n "${CADDY_REMOTE_HOST:-}" ] && _cur_mode="remote"
[ -z "$_cur_mode" ] && _cur_mode="local"
prompt_text " Timezone [${_cur_tz}]:" "$_cur_tz" SITE_TZ
prompt_text " Base domain (e.g., example.com) [${_cur_dom:-<not set>}]:" "$_cur_dom" SITE_DOMAIN
prompt_text " Caddy Docker network [${_cur_net}]:" "$_cur_net" SITE_CADDY_NET
echo ""
echo " Where does Caddy run?"
echo " [1] This machine — Caddy installed here (default)"
echo " [2] Remote machine — different server, VPN node, or Netbird peer"
@@ -152,6 +147,17 @@ run_site_configure() {
*) CADDY_MODE="local" ;;
esac
CADDY_REMOTE_HOST="" # clear legacy value; CADDY_MODE is authoritative now
echo ""
prompt_text " Timezone [${_cur_tz}]:" "$_cur_tz" SITE_TZ
prompt_text " Base domain (e.g., example.com) [${_cur_dom:-<not set>}]:" "$_cur_dom" SITE_DOMAIN
# Caddy Docker network only matters when Caddy runs locally — it's the
# shared bridge network services join to reach a local Caddy container
# by name. Remote/none Caddy proxies via localhost:PORT instead.
if [ "$CADDY_MODE" = "local" ]; then
prompt_text " Caddy Docker network [${_cur_net}]:" "$_cur_net" SITE_CADDY_NET
fi
export SITE_TZ SITE_DOMAIN SITE_CADDY_NET CADDY_MODE CADDY_REMOTE_HOST
mkdir -p "$DOCKER_DIR"