diff --git a/scripts/dev.sh b/scripts/dev.sh index c2daf1b..5645cb2 100755 --- a/scripts/dev.sh +++ b/scripts/dev.sh @@ -1,13 +1,10 @@ #!/usr/bin/env bash -# Native dev loop: Postgres in Docker, everything else compiled on the host and -# served from the Gleam server on :8080 so the OAuth origin stays consistent. -# -# Browse http://127.0.0.1:8080, NOT localhost: the atproto localhost client +# Everything is served from the Gleam server on :8080 so the OAuth origin stays +# consistent. Browse 127.0.0.1, NOT localhost: the atproto localhost client # redirects to the loopback IP and the session cookie is host-specific. set -uo pipefail cd "$(dirname "${BASH_SOURCE[0]}")/.." -# Gitignored; the same file compose reads. if [ -f .env ]; then set -a . ./.env @@ -17,7 +14,7 @@ fi log() { printf '\033[36m[dev]\033[0m %s\n' "$*"; } # Stable secret so sessions survive the frequent restarts this loop does. export SECRET_KEY_BASE="${SECRET_KEY_BASE:-dev-only-change-me-to-a-long-random-string}" -# At-rest encryption key for stored tokens (required; base64, 32 bytes). +# Required, base64, 32 bytes. export STORE_KEY="${STORE_KEY:-ZGV2LW9ubHktMzItYnl0ZS1zdG9yZS1rZXktISEhISE=}" # BASE_URL left unset => http://localhost:8080 => OAuth redirect to 127.0.0.1:8080. @@ -61,7 +58,6 @@ cleanup() { } trap cleanup INT TERM -# --- boot ------------------------------------------------------------------- log "starting postgres (docker); stopping any dockerized server on :8080" docker compose up -d db docker compose stop server >/dev/null 2>&1 || true @@ -113,7 +109,6 @@ make vendor build_web start_server -# --- poll watcher ----------------------------------------------------------- SENT="$(mktemp -d)" touch "$SENT/web" "$SENT/server" "$SENT/lex"