Repository navigation
chore: neutral examples and no hard-coded infrastructure defaults - #156
Conversation
Remove application-specific examples and hard-coded infrastructure
defaults from source, tests, CI and docs.
- invite now requires --seed <host:port> and the default agent label is
"agent"; join rejects a token without a seed instead of falling back
to a built-in address. CLI help and docs/reference/cli.md describe both.
- LAN discovery: the default app ID constant is APP_ID_DEFAULT; its
value (0x5043) is unchanged, so beacons stay compatible.
- Application channels: the example channel constant is EXAMPLE_CHANNEL
("example-v1"); test channels use neutral names.
- FFI doc example uses relay.example.org.
- The WASM proof server allows loopback WebSocket origins by default;
MESHGUARD_WEB_PROOF_CONNECT_SRC adds gateway origins.
- test_connect.sh takes the remote host from MESHGUARD_REMOTE.
- Drop stale per-machine Android libc files (build-libraries.sh
generates its own) and the WASM workflow's extra branch filter.
- Docs: generic example organization and channel names; the browser
relay qualification is described without device, app or host details,
and its evidence files and an unrelated design note are removed.
There was a problem hiding this comment.
🟡 Changes recommended
Hostname invite seeds cannot bootstrap joins, and CSP validation permits unrestricted wildcard origins.
2 open findings
What changed in this PR
Removes application-specific examples and infrastructure defaults while requiring explicit invite seeds.
Changes:
- Replaces product-specific constants, channels, aliases, and documentation.
- Requires invite tokens to carry an explicit seed.
- Makes WASM proof WebSocket origins configurable and removes machine-specific files.
| File | Description |
|---|---|
web/relay.html |
Generalizes qualification text. |
tests/wasm/serve.mjs |
Configures proof-page WebSocket CSP. |
test_connect.sh |
Makes the remote host configurable. |
src/services/transfers.zig |
Renames test channels. |
src/services/control.zig |
Neutralizes application-channel fixtures. |
src/protocol/transfer.zig |
Neutralizes transfer fixtures. |
src/protocol/messages.zig |
Updates alias example. |
src/protocol/codec.zig |
Updates alias test data. |
src/protocol/app_channel.zig |
Renames the example channel constant. |
src/meshguard_ffi.zig |
Uses neutral discovery and relay examples. |
src/main.zig |
Requires invite seeds and removes fallback infrastructure. |
src/discovery/lan.zig |
Renames the default LAN app ID. |
scripts/test-control-startup.py |
Updates channel fixtures. |
docs/reference/wasm-core.md |
Documents configurable CSP origins. |
docs/reference/cli.md |
Documents invite and join behavior. |
docs/reference/browser-relay.md |
Generalizes qualification details. |
docs/reference/app-transfers.md |
Neutralizes transfer examples. |
docs/reference/app-channels.md |
Neutralizes channel examples. |
docs/guide/trust-model.md |
Uses a generic organization. |
docs/guide/services.md |
Uses generic policy examples. |
docs/guide/configuration.md |
Uses generic configuration examples. |
docs/evidence/android-web-relay-browser.json |
Removes environment-specific evidence. |
docs/concepts/identity-and-trust.md |
Uses a generic alias example. |
docs/agent-rooms-direction-2026-09-20.md |
Removes an unrelated design note. |
dist/agent-join.sh |
Generalizes onboarding wording. |
CHANGELOG.md |
Records behavior and naming changes. |
android-x86_64-libc.conf |
Removes machine-specific Android configuration. |
android-aarch64-libc.conf |
Removes machine-specific Android configuration. |
.github/workflows/wasm.yml |
Limits PR workflow triggers to main. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| // Extra origins the proof page may connect to (the browser gateway), space-separated, | ||
| // for example MESHGUARD_WEB_PROOF_CONNECT_SRC='wss://gateway.example.org'. Loopback only by default. | ||
| const extraConnect=(process.env.MESHGUARD_WEB_PROOF_CONNECT_SRC||'').split(/\s+/).filter(Boolean); | ||
| for(const origin of extraConnect)if(!/^wss?:\/\/[A-Za-z0-9.\-\[\]:*]+$/.test(origin))throw new Error(`MESHGUARD_WEB_PROOF_CONNECT_SRC: not a ws(s):// origin: ${origin}`); |
There was a problem hiding this comment.
Fixed in 743aedb: each entry is now parsed with new URL and must be a plain ws:/wss: origin (no wildcard, credentials, path, query or fragment). wss://*, wss://*.x.org, wss://u:p@h.org, wss://h.org/path and https://h.org are rejected at startup.
| } | ||
| } | ||
|
|
||
| if (seed.len == 0) { |
There was a problem hiding this comment.
Good catch, fixed in 743aedb. The static-seed path in up used only parseEndpoint, so hostnames worked only alongside --dns/--mdns. Static seeds now go through Seed.parseOrResolve (numeric address, else DNS A record), the warning names unresolvable seeds, and the seed module tests now run in zig build test. Checked manually: a resolvable hostname seed is accepted and an unresolvable one is reported.
- `up` resolved hostname seeds only when DNS or mDNS discovery was also enabled; with static seeds alone a hostname was silently dropped, so an invite carrying a hostname seed could not bootstrap `join`. Static seeds now go through Seed.parseOrResolve (numeric address, else DNS A record), and the warning names unresolvable seeds. - Run the seed module's tests in `zig build test`. - The WASM proof server parses each MESHGUARD_WEB_PROOF_CONNECT_SRC entry as a URL and accepts only a plain ws:/wss: origin: no wildcard, credentials, path, query or fragment.


Remove application-specific examples and hard-coded infrastructure defaults; use neutral examples; require an explicit seed for
invite.Behavior changes
meshguard invitenow requires--seed <host:port>. Without it the command exits witherror: invite requires --seed <host:port>and a usage line. There is no built-in seed address any more. The default agent label is nowagent.meshguard join <token>rejects a token that carries no seed (error: invite token has no seed address) instead of falling back to a built-in address.docs/reference/cli.md(newinvite/joinsections) describe both.Renames (no wire change)
discovery.Lan.APP_ID_DEFAULTreplaces the previous app-specific constant name. The value stays0x5043, so LAN beacons remain compatible.protocol.app_channel.EXAMPLE_CHANNEL("example-v1") replaces the previous example channel constant, which was only used by tests. Test channel names are neutral (example-v1,example-files).Other
relay.example.org:51821.tests/wasm/serve.mjs: the proof page's CSP allows loopback WebSocket origins by default;MESHGUARD_WEB_PROOF_CONNECT_SRC(space-separatedws(s)://origins, validated) adds a gateway origin. Documented indocs/reference/wasm-core.md.test_connect.shreads the remote host fromMESHGUARD_REMOTE.libcfiles at the repository root;scripts/build-libraries.shgenerates its own.mainonly.acme) and channel names are generic. CHANGELOG Unreleased updated.Tests
zig build,zig build test(517/519, 2 skipped),zig build wasm wasm-test,python scripts/test-control-startup.py(11 tests, 1 skipped),bun test tests/web(36 pass, 2 skip), docs build.zig build test -Dno-sodium=true(533/535, 2 skipped).invitewithout--seed, with a dangling--seed, andjoinwith a seedless token all exit 1 with the messages above;invite --seed relay.example.org:51821prints a token.