#!/usr/bin/env bash set -euo pipefail REPO_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" ENV_FILE="$REPO_DIR/.env" if [ -f "$ENV_FILE" ]; then echo "♻️ Found existing $ENV_FILE β€” reusing." else echo "πŸ” Generating new $ENV_FILE…" # ── Database defaults DB_USER="postgres" DB_PASS="$(openssl rand -hex 16)" DB_NAME="lnbitsdb" DATABASE_URL="postgresql://${DB_USER}:${DB_PASS}@db:5432/${DB_NAME}" # ── Flask UI secret FLASK_SECRET="$(openssl rand -hex 32)" # ── Blank placeholders for the Web UI to fill later cat > "$ENV_FILE" <