Files
lanspread/justfile
T
ddidderr 60fd7ba0c2 feat(peer)!: cut over to authenticated catalog sharing
Replace address-only trust and pushed peer state with installation identities,
SPKI-pinned QUIC, candidate-only discovery, and bounded responder-owned
protocol-8 pulls. The runtime now owns each network generation and all admitted
work through shutdown.

Add exact bundled content identities, reproducible manifest publishing,
capability-confined downloads, streaming BLAKE3 verification, quarantine and
retry, and crash-recoverable download and install transactions. Ship generated
fixture catalogs and fail closed when production manifests are absent.

The Tauri backend exposes durable sharing policy, redacted identity state, and
attempt-keyed transfer snapshots. Frontend consumption follows in the next
commit. Repository-wide test certificates and protocol-7 paths are removed.

BREAKING CHANGE: peers must use protocol 8 and exact catalog content artifacts;
protocol-7 frames and shared-certificate identities are no longer accepted.

Test Plan:
- `just test` -- passed on the completed stack (708 workspace tests)
- `just clippy` -- passed on the completed stack
- `just build` -- passed with fixture catalogs on the completed stack
- `just catalog-check-production` -- failed closed because the external
  production manifest corpus is absent
- `git diff --cached --check` -- passed
2026-08-10 13:59:18 +02:00

197 lines
8.7 KiB
Makefile

export RUSTFLAGS := "-C target-cpu=native"
export WEBKIT_DISABLE_COMPOSITING_MODE := "1"
export DOCKER_CONFIG := env_var_or_default("DOCKER_CONFIG", ".lanspread-peer-cli/docker-config")
default: run
FIXTURE_CATALOG_SOURCE := "crates/lanspread-tauri-deno-ts/src-tauri/game.db"
FIXTURE_CATALOG_ROOT := "crates/lanspread-peer-cli/catalogs"
FIXTURE_UNRAR := "crates/lanspread-tauri-deno-ts/src-tauri/binaries/unrar-x86_64-unknown-linux-gnu"
TAURI_DEV_CONFIG := '{"bundle":{"resources":{"../../lanspread-peer-cli/catalogs/default/game.db":"game.db","../../lanspread-peer-cli/catalogs/default/manifests/":"manifests/","assets/*":"assets/"}}}'
TAURI_FIXTURE_ENV := "LANSPREAD_USE_FIXTURE_CATALOG=1"
setup:
cargo install tauri-cli
cd crates/lanspread-tauri-deno-ts && deno install --frozen=true
run: fixture-catalogs-check
{{ TAURI_FIXTURE_ENV }} cargo tauri dev --config crates/lanspread-tauri-deno-ts/src-tauri/tauri.dev.conf.json --release
build: fixture-catalogs-check
{{ TAURI_FIXTURE_ENV }} cargo tauri build --config crates/lanspread-tauri-deno-ts/src-tauri/tauri.dev.conf.json --no-bundle #-- --profile dev
bundle: catalog-check-production
cargo tauri build --config crates/lanspread-tauri-deno-ts/src-tauri/tauri.production.conf.json -- --profile production
fmt:
cargo +nightly fmt
tombi format
fd -tf -e md -x prettier --write --prose-wrap always --print-width 80
rumdl check --flavor commonmark --fix
just --fmt
_fix:
{{ TAURI_FIXTURE_ENV }} TAURI_CONFIG='{{ TAURI_DEV_CONFIG }}' cargo fix --workspace --all-targets --all-features
{{ TAURI_FIXTURE_ENV }} TAURI_CONFIG='{{ TAURI_DEV_CONFIG }}' cargo clippy --workspace --all-targets --all-features --fix
fix: _fix fmt
clippy:
{{ TAURI_FIXTURE_ENV }} TAURI_CONFIG='{{ TAURI_DEV_CONFIG }}' cargo clippy --workspace --all-targets --all-features -- -D warnings
test:
{{ TAURI_FIXTURE_ENV }} TAURI_CONFIG='{{ TAURI_DEV_CONFIG }}' cargo test --workspace --all-targets --all-features
# Acceptance catalogs are derived only by the Rust publisher. The static
# profiles are committed artifacts; generation is an explicit maintainer task,
# while normal development and image builds run the package-free check.
fixture-catalogs:
cargo run -p lanspread-compat --bin lanspread-fixture-catalog -- \
--source-catalog-db {{ FIXTURE_CATALOG_SOURCE }} \
--output-dir {{ FIXTURE_CATALOG_ROOT }}/default \
--unrar {{ FIXTURE_UNRAR }} \
--game-root crates/lanspread-peer-cli/fixtures/fixture-alpha/alienswarm \
--game-root crates/lanspread-peer-cli/fixtures/fixture-alpha/bf1942 \
--game-root crates/lanspread-peer-cli/fixtures/fixture-alpha/ggoo \
--game-root crates/lanspread-peer-cli/fixtures/fixture-bravo/bfbc2 \
--game-root crates/lanspread-peer-cli/fixtures/fixture-bravo/cnc4 \
--game-root crates/lanspread-peer-cli/fixtures/fixture-bravo/cnctw \
--game-root crates/lanspread-peer-cli/fixtures/fixture-charlie/cod5 \
--game-root crates/lanspread-peer-cli/fixtures/fixture-charlie/cod6 \
--game-root crates/lanspread-peer-cli/fixtures/fixture-charlie/coh \
--game-root crates/lanspread-peer-cli/fixtures/fixture-persona/css
cargo run -p lanspread-compat --bin lanspread-fixture-catalog -- \
--source-catalog-db {{ FIXTURE_CATALOG_SOURCE }} \
--output-dir {{ FIXTURE_CATALOG_ROOT }}/solid \
--unrar {{ FIXTURE_UNRAR }} \
--game-root crates/lanspread-peer-cli/fixtures/fixture-solid/cnctw
cargo run -p lanspread-compat --bin lanspread-fixture-catalog -- \
--source-catalog-db {{ FIXTURE_CATALOG_SOURCE }} \
--output-dir {{ FIXTURE_CATALOG_ROOT }}/multi \
--unrar {{ FIXTURE_UNRAR }} \
--game-root crates/lanspread-peer-cli/fixtures/fixture-multi/cnctw
cargo run -p lanspread-compat --bin lanspread-fixture-catalog -- \
--source-catalog-db {{ FIXTURE_CATALOG_SOURCE }} \
--output-dir {{ FIXTURE_CATALOG_ROOT }}/unknown \
--unrar {{ FIXTURE_UNRAR }} \
--game-root crates/lanspread-peer-cli/fixtures/fixture-unknown/cod2
fixture-catalog OUTPUT GAME_ROOT:
cargo run -p lanspread-compat --bin lanspread-fixture-catalog -- \
--source-catalog-db {{ FIXTURE_CATALOG_SOURCE }} \
--output-dir "{{ OUTPUT }}" \
--unrar {{ FIXTURE_UNRAR }} \
--game-root "{{ GAME_ROOT }}"
fixture-download-only-catalog OUTPUT GAME_ID GAME_ROOT:
cargo run -p lanspread-compat --bin lanspread-fixture-catalog -- \
--source-catalog-db {{ FIXTURE_CATALOG_SOURCE }} \
--output-dir "{{ OUTPUT }}" \
--unrar {{ FIXTURE_UNRAR }} \
--game-root "{{ GAME_ROOT }}" \
--no-stream-install "{{ GAME_ID }}"
fixture-catalogs-check:
cargo run -p lanspread-compat --bin lanspread-catalog-publisher -- check \
--catalog-db {{ FIXTURE_CATALOG_ROOT }}/default/game.db --all
cargo run -p lanspread-compat --bin lanspread-catalog-publisher -- check \
--catalog-db {{ FIXTURE_CATALOG_ROOT }}/solid/game.db --all
cargo run -p lanspread-compat --bin lanspread-catalog-publisher -- check \
--catalog-db {{ FIXTURE_CATALOG_ROOT }}/multi/game.db --all
cargo run -p lanspread-compat --bin lanspread-catalog-publisher -- check \
--catalog-db {{ FIXTURE_CATALOG_ROOT }}/unknown/game.db --all
catalog-check-production:
cargo run -p lanspread-compat --bin lanspread-catalog-publisher -- check \
--catalog-db crates/lanspread-tauri-deno-ts/src-tauri/game.db --all
catalog-publisher-test:
cargo test -p lanspread-compat --all-targets --all-features
catalog-publisher-clippy:
cargo clippy -p lanspread-compat --all-targets --all-features -- -D warnings
catalog-publisher-fmt:
cargo +nightly fmt --package lanspread-compat
frontend-test:
cd crates/lanspread-tauri-deno-ts && deno test --unstable-sloppy-imports tests
clean:
cargo clean
peer-cli-build:
cargo build -p lanspread-peer-cli
peer-cli-image: fixture-catalogs-check
mkdir -p "$DOCKER_CONFIG"
docker build -f crates/lanspread-peer-cli/Dockerfile -t lanspread-peer-cli:dev .
peer-cli-tests *SCENARIOS: peer-cli-image
python3 crates/lanspread-peer-cli/scripts/run_extended_scenarios.py {{ SCENARIOS }}
# macvlan: each peer container gets its own MAC/IP on the real LAN.
# Override on the command line if your LAN differs, e.g.
# just LANSPREAD_PARENT_IFACE=enp4s0 LANSPREAD_SUBNET=10.0.0.0/24 LANSPREAD_GATEWAY=10.0.0.1 peer-cli-net
LANSPREAD_NET := "lanspread"
LANSPREAD_PARENT_IFACE := "eth0"
LANSPREAD_SUBNET := "192.168.1.0/24"
LANSPREAD_GATEWAY := "192.168.1.1"
peer-cli-net:
mkdir -p "$DOCKER_CONFIG"
docker network inspect {{ LANSPREAD_NET }} >/dev/null 2>&1 || \
docker network create -d macvlan \
--subnet={{ LANSPREAD_SUBNET }} \
--gateway={{ LANSPREAD_GATEWAY }} \
-o parent={{ LANSPREAD_PARENT_IFACE }} \
{{ LANSPREAD_NET }}
peer-cli-run NAME: peer-cli-net
mkdir -p ".lanspread-peer-cli/{{ NAME }}/state" ".lanspread-peer-cli/{{ NAME }}/games"
docker run --rm --init --network {{ LANSPREAD_NET }} --name "lanspread-peer-cli-{{ NAME }}" -i \
-v "$PWD/.lanspread-peer-cli/{{ NAME }}/state:/state" \
-v "$PWD/.lanspread-peer-cli/{{ NAME }}/games:/games" \
lanspread-peer-cli:dev \
--name "{{ NAME }}" \
--games-dir /games \
--state-dir /state \
--catalog-db /app/game.db \
--manifests-dir /app/manifests
peer-cli-alpha: peer-cli-net
mkdir -p ".lanspread-peer-cli/alpha/state"
docker run --rm --init --network lanspread --name "lanspread-peer-cli-alpha" -i \
-v "$PWD/.lanspread-peer-cli/alpha/state:/state" \
-v "$PWD/crates/lanspread-peer-cli/fixtures/fixture-alpha:/games:ro" \
lanspread-peer-cli:dev \
--name "alpha" \
--games-dir /games \
--state-dir /state \
--catalog-db /app/game.db \
--manifests-dir /app/manifests
peer-cli-bravo: peer-cli-net
mkdir -p ".lanspread-peer-cli/bravo/state"
docker run --rm --init --network lanspread --name "lanspread-peer-cli-bravo" -i \
-v "$PWD/.lanspread-peer-cli/bravo/state:/state" \
-v "$PWD/crates/lanspread-peer-cli/fixtures/fixture-bravo:/games:ro" \
lanspread-peer-cli:dev \
--name "bravo" \
--games-dir /games \
--state-dir /state \
--catalog-db /app/game.db \
--manifests-dir /app/manifests
peer-cli-charlie: peer-cli-net
mkdir -p ".lanspread-peer-cli/charlie/state"
docker run --rm --init --network lanspread --name "lanspread-peer-cli-charlie" -i \
-v "$PWD/.lanspread-peer-cli/charlie/state:/state" \
-v "$PWD/crates/lanspread-peer-cli/fixtures/fixture-charlie:/games:ro" \
lanspread-peer-cli:dev \
--name "charlie" \
--games-dir /games \
--state-dir /state \
--catalog-db /app/game.db \
--manifests-dir /app/manifests