From 2060606adc580fc8ef0dbf1a7987e551ceb71ca4 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 20 Mar 2026 10:21:35 +0000 Subject: [PATCH] Consolidate to single .env at repo root Add ACME_EMAIL to root .env.example. start.sh now reads root .env and passes it to docker compose. Removed infra/.env.example. --- .env.example | 3 +++ infra/.env.example | 7 ------- infra/start.sh | 9 +++++---- 3 files changed, 8 insertions(+), 11 deletions(-) delete mode 100644 infra/.env.example diff --git a/.env.example b/.env.example index 7eb549e..4258e32 100644 --- a/.env.example +++ b/.env.example @@ -16,5 +16,8 @@ CADDY_API_URL=http://localhost:2019 # Use "localhost" for local dev, your real domain on the Pi. DOMAIN_SUFFIX=localhost +# Email for Let's Encrypt registration (production only; ignored for localhost). +ACME_EMAIL=you@yourdomain.com + # Rust log filter. RUST_LOG=hiy_server=debug,tower_http=info diff --git a/infra/.env.example b/infra/.env.example deleted file mode 100644 index fd0c922..0000000 --- a/infra/.env.example +++ /dev/null @@ -1,7 +0,0 @@ -# Copy to infra/.env and fill in before running ./start.sh - -# Your domain — subdomains will be: .yourdomain.com -DOMAIN_SUFFIX=yourdomain.com - -# Email for Let's Encrypt registration (not public, just for cert renewal notices). -ACME_EMAIL=you@yourdomain.com diff --git a/infra/start.sh b/infra/start.sh index e020d54..a7eca68 100755 --- a/infra/start.sh +++ b/infra/start.sh @@ -2,11 +2,12 @@ set -euo pipefail SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" +REPO_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)" cd "$SCRIPT_DIR" -# ── Load .env ────────────────────────────────────────────────────────────────── -if [ -f .env ]; then - set -a; source .env; set +a +# ── Load .env from repo root ─────────────────────────────────────────────────── +if [ -f "$REPO_ROOT/.env" ]; then + set -a; source "$REPO_ROOT/.env"; set +a fi DOMAIN_SUFFIX="${DOMAIN_SUFFIX:-}" @@ -62,4 +63,4 @@ echo "[hiy] Generated proxy/caddy.json for ${DOMAIN_SUFFIX}" make build # ── Start services (detached) ────────────────────────────────────────────────── -docker compose up -d +docker compose --env-file "$REPO_ROOT/.env" up -d