set shell := ["bash", "-euo", "pipefail", "-c"]
set positional-arguments
default:
    @just --list
version:
    @cat VERSION
join:
    bash scripts/join.sh
status:
    docker compose -f compose.yaml -f compose.peer.yaml ps
    curl --fail --silent --show-error http://127.0.0.1:18080/health
wallet *args:
    docker compose run --rm toolbox scripts/wallet.mjs "$@"
node-proof *args:
    docker compose run --rm toolbox scripts/node-proof.mjs "$@"
light-up:
    python3 scripts/light-init.py
light-wallet *args:
    docker compose -f compose.wallet.yaml run --rm wallet scripts/wallet.mjs "$@"
http-wallet *args:
    python3 scripts/http-wallet.py "$@"
site-build:
    python3 scripts/site_build.py
site-preview:
    python3 scripts/site_build.py --output dist/site --base-url http://localhost:49944
    docker compose -f compose.preview.yaml up -d
web-plan:
    python3 scripts/web_deploy.py plan
web-check:
    python3 scripts/web_deploy.py check
web-dns *args:
    python3 scripts/web_dns.py "$@"
web-deploy:
    python3 scripts/web_deploy.py deploy
cloudflare-install:
    npm ci --prefix web --cache .cache/npm --no-audit --no-fund
cloudflare-plan:
    python3 scripts/cloudflare.py plan
cloudflare-infrastructure:
    python3 scripts/cloudflare.py infrastructure
cloudflare-publish:
    python3 scripts/cloudflare.py publish
cloudflare-status:
    python3 scripts/cloudflare.py status
backup:
    docker compose run --rm toolbox scripts/backup.mjs create
    docker compose run --rm toolbox scripts/backup.mjs verify
test:
    python3 scripts/test.py
