- Parse Melee matches exports (one round per file, byes, null GameWins); one import form detects matches vs standings exports. Re-importing a round replaces just that round and keeps entered decks. - Per-player deck entry for sessions scored from matches. - node:test suite with anonymised fixtures; lockfile. - scripts/local.sh runs the compose stack under podman with its own .env.local, project name and volume. - README and CLAUDE.md docs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
34 lines
1.0 KiB
Bash
Executable File
34 lines
1.0 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Run the docker compose stack locally with podman, isolated from the real .env and data.
|
|
# usage: scripts/local.sh up | down | reset | logs | ps
|
|
# First run writes .env.local (random secrets, bound to 127.0.0.1). Set BASE_PATH or COOKIE_SECURE there to test them.
|
|
set -euo pipefail
|
|
cd "$(dirname "$0")/.."
|
|
|
|
if [[ ! -f .env.local ]]; then
|
|
cat > .env.local <<EOF
|
|
DB_PASSWORD=$(openssl rand -hex 16)
|
|
SECRET_KEY=$(openssl rand -hex 32)
|
|
ADMIN_PASSWORD=local-$(openssl rand -hex 6)
|
|
COOKIE_SECURE=false
|
|
BIND_ADDR=127.0.0.1
|
|
HOST_PORT=8889
|
|
BASE_PATH=
|
|
EOF
|
|
echo "wrote .env.local"
|
|
fi
|
|
|
|
compose() { podman compose --env-file .env.local -p mtg-local "$@"; }
|
|
case "${1:-up}" in
|
|
up)
|
|
compose up -d --build --wait
|
|
set -a; source .env.local; set +a
|
|
echo "http://127.0.0.1:${HOST_PORT}${BASE_PATH}/ admin password: ${ADMIN_PASSWORD}"
|
|
;;
|
|
down) compose down ;;
|
|
reset) compose down -v ;; # also deletes the local database volume
|
|
logs) compose logs -f ;;
|
|
ps) compose ps ;;
|
|
*) echo "usage: $0 up|down|reset|logs|ps" >&2; exit 1 ;;
|
|
esac
|