Small bird. Strong connections. HTTP tunneling and reverse proxying in Rust, with automated TLS and end-to-end authentication.
  • Rust 72.7%
  • Svelte 13.1%
  • JavaScript 7.7%
  • TypeScript 4.2%
  • Gherkin 0.9%
  • Other 1.3%
Find a file
Rémy Sanchez c43d1540a8
[WVR-177] Make the flaky CI tests deterministic (#41)
Two CI flakes (the usage covered_minutes assertion and a store
SQLITE_BUSY race) and the slow tunnel_e2e file all came from waits on
wall-clock time or on races. Every wait now hangs on a real event or
signal, and no retry loops or sleeps paper over it.

SQLITE_BUSY race (a real live-relay bug):
- A deferred `BEGIN` write transaction reads first. If another writer
  commits before its first write, SQLite fails it at once with
  SQLITE_BUSY_SNAPSHOT and busy_timeout does not apply.
- New `Store::begin_write()` opens `BEGIN IMMEDIATE` through SeaORM
  `begin_with_options`. All 18 relay write transactions use it
  (store/*, metrics.rs fold_day), and the raw sqlx slot write uses
  `begin_with("BEGIN IMMEDIATE")`. Once the transaction is IMMEDIATE,
  the only BUSY left is busy_timeout expiring, which is real overload.
  A retry with the same deadline would change nothing, so there is no
  retry loop.
- The weave client store gets the same fix (record_pairing,
  set_default, forget), because `weave start` runs alongside other
  weave processes.
- New per-crate clippy.toml in weaver-server and weave bans
  `sea_orm::TransactionTrait::begin` and `sqlx::Connection::begin`, so a
  deferred writer cannot come back.
- The race test went from 91/160 failures to 0/400.

Usage covered_minutes flake:
- MeteringManager gains a test-util `with_pinned_clock`. The
  control_socket usage test pins the clock, advances it 1050 ms by hand
  (no sleep, no ticker) and asserts covered_minutes == 1 and
  open_ms == 1050 exactly.

tunnel_e2e:
- The test relay seeds its self-signed wildcard into the store and calls
  cert_manager.init(), so registrations no longer place real ACME
  orders with Let's Encrypt staging. That network call made
  test_control_stream_is_the_registration_lease fail every time and kept
  the file at ~20s. It now takes ~1s.
- All sleep-polling is replaced by signals:
  TestRelay::until_routed/until_unrouted subscribe to the registry's
  LiveHub change bus and then check, so they cannot miss a change.
  TestOrigin::stop() awaits the accept loop. The cookie test reads the
  origin record after the response, since the record is written before
  the reply. The stalled-ACME test waits for the fake directory's first
  accept. The metering test pins the relay clock and waits on the new
  test-util `MeteringManager::observations()` watch channel, with exact
  assertions requests == 1 and open_ms == 1000.
- 30 s HANG_GUARD timeouts only turn a hang into a named failure.

AGENTS.md: refresh the Testing contract (full suite ~25s warm, e2e
~120s) and add a last-measured entry.

Verified: fmt/clippy/deny/fuzz clean; full suite 624 passed/0 failed
five runs in a row; ignored 3 passed; e2e 34 scenarios/488 steps
passed; tunnel_e2e 80/80 parallel runs green.
2026-11-04 23:29:21 +01:00
.github [WVR-169] Sign in with Microsoft Entra ID (#37) 2026-11-02 18:22:47 +01:00
ci [OFF-86] Shim: patch the absolute-form request-target too; pin the host-mismatch 421 2026-09-23 23:18:31 +02:00
crates [WVR-177] Make the flaky CI tests deterministic (#41) 2026-11-04 23:29:21 +01:00
docs [WVR-98] Control who may create an account with a relay-wide policy (#39) 2026-11-03 21:39:28 +01:00
e2e [WVR-98] Control who may create an account with a relay-wide policy (#39) 2026-11-03 21:39:28 +01:00
frontend [WVR-98] Control who may create an account with a relay-wide policy (#39) 2026-11-03 21:39:28 +01:00
fuzz [WVR-13] Review the Rust crates: one client, less code, honest nullability 2026-10-19 08:44:08 +02:00
vision [WVR-163] Sign in with a passkey (WebAuthn) (#35) 2026-10-27 00:40:59 +01:00
.gitignore [WVR-36] Make the landing header a single GitHub entry point 2026-10-12 12:32:10 +02:00
AGENTS.md [WVR-177] Make the flaky CI tests deterministic (#41) 2026-11-04 23:29:21 +01:00
Cargo.lock [WVR-169] Sign in with Microsoft Entra ID (#37) 2026-11-02 18:22:47 +01:00
Cargo.toml [WVR-169] Sign in with Microsoft Entra ID (#37) 2026-11-02 18:22:47 +01:00
CONTRIBUTING.md [OFF-77] Initialize Tunnel Weaver Workspace and CI Pipeline (#1) 2026-09-13 18:02:03 +02:00
deny.toml [WVR-45] Manage machines, meter usage daily, and rebuild the console 2026-10-21 14:25:35 +02:00
LICENSE [OFF-77] Initialize Tunnel Weaver Workspace and CI Pipeline (#1) 2026-09-13 18:02:03 +02:00
README.md [OFF-89] Brand repository README with spectacled weaver 2026-09-24 10:36:31 +02:00
rust-toolchain.toml [OFF-77] Initialize Tunnel Weaver Workspace and CI Pipeline (#1) 2026-09-13 18:02:03 +02:00
rustfmt.toml [OFF-77] Initialize Tunnel Weaver Workspace and CI Pipeline (#1) 2026-09-13 18:02:03 +02:00

Tunnel Weaver — Small bird. Strong connections.

Build & test · Architecture · Contribute · Apache 2.0

Tunnel Weaver is an open-core tunneling and reverse proxying system designed for exposing local services to public domains with automated TLS, end-to-end authentication, and multiplexed streams.

Public endpoints Authenticated connections Multiplexed streams
Expose local services through public domains with automated TLS. End-to-end authentication between the client and relay. A Rust workspace with a sans-IO multiplexer at its core.

Workspace Overview

The project is structured as a Cargo workspace:

  • crates/weaver-mux: Sans-IO stream multiplexer framing layer (Frame::parse).
  • crates/weaver-proto: Shared protocol constants (PROTOCOL_VERSION) and core definitions.
  • crates/weaver-server: Relay server binary (Linux-only).
  • crates/weaver-assets: Shared embedded branded HTML error pages and security headers.
  • crates/weave: Tunnel Weaver client CLI binary (Linux, macOS, Windows).
  • fuzz/: LibFuzzer targets executed continuously in CI.

Prerequisites

  • Rust: 1.98+ (Rust edition 2024).

Building & Testing

Workspace Build

cargo build --workspace

Running Tests

Run the workspace test suite:

# On Linux:
cargo test --workspace

# On macOS and Windows (excluding Linux-only server):
cargo test --workspace --exclude weaver-server

# Run ignored end-to-end tests:
cargo test --workspace -- --ignored

Linting & Formatting

cargo fmt --check
cargo clippy --workspace --all-targets -- -D warnings
cargo deny check

Contributing

See CONTRIBUTING.md for contribution guidelines, engineering rules, and architectural decision records (ADRs in docs/decisions/). docs/architecture.md maps the crate layers and every call that crosses them.

License

Licensed under the Apache License, Version 2.0. See LICENSE for details.