Skip to content

Commit ccb021d

Browse files
tlongwell-blocknpub1qyvc0c5kl4gqv2fd97fsk46tu378sqgy35vc83rvgfwne90sel7s0ed67dTyler Longwellnpub1mprnacetjua2xx3p5eddmhxyk6wv929ymm5py8kd2xfxurxahspqqlgytanpub1cc3ha7z055mu0rwwu7806t2wt8mj3pvu0uv5mfp2c50dahaqhczshdalg6
authored
Relay mesh: cross-pod tunnel + huddle transport (buzz-relay-mesh) (#1670)
Signed-off-by: Tyler Longwell <[email protected]> Signed-off-by: npub1mprnacetjua2xx3p5eddmhxyk6wv929ymm5py8kd2xfxurxahspqqlgyta <d8473ee32b973aa31a21a65adddcc4b69cc2a8a4dee8121ecd51926e0cddbc02@sprout-oss.stage.blox.sqprod.co> Signed-off-by: npub17jjz49l9jjmhhk7cac63j8yt9z555n9cw8vk7v5jz4vzw4ppld5qgj57cc <f4a42a97e594b77bdbd8ee35191c8b28a94a4cb871d96f32921558275421fb68@sprout-oss.stage.blox.sqprod.co> Signed-off-by: Tyler Longwell <[email protected]> Signed-off-by: tlongwell-block <[email protected]> Co-authored-by: npub1qyvc0c5kl4gqv2fd97fsk46tu378sqgy35vc83rvgfwne90sel7s0ed67d <011987e296fd5006292d2f930b574be47c7801048d1983c46c425d3c95f0cffd@sprout-oss.stage.blox.sqprod.co> Co-authored-by: Tyler Longwell <[email protected]> Co-authored-by: npub1mprnacetjua2xx3p5eddmhxyk6wv929ymm5py8kd2xfxurxahspqqlgyta <d8473ee32b973aa31a21a65adddcc4b69cc2a8a4dee8121ecd51926e0cddbc02@sprout-oss.stage.blox.sqprod.co> Co-authored-by: npub1cc3ha7z055mu0rwwu7806t2wt8mj3pvu0uv5mfp2c50dahaqhczshdalg6 <c6237ef84fa537c78dcee78efd2d4e59f728859c7f194da42ac51ededfa0be05@sprout-oss.stage.blox.sqprod.co> Co-authored-by: npub17jjz49l9jjmhhk7cac63j8yt9z555n9cw8vk7v5jz4vzw4ppld5qgj57cc <f4a42a97e594b77bdbd8ee35191c8b28a94a4cb871d96f32921558275421fb68@sprout-oss.stage.blox.sqprod.co> Co-authored-by: npub1jh9wn95s0472h86ahapupaf7m6kx4v9sx2n0atj2hltcfer8k06s5n3pyf <95cae996907d7cab9f5dbf43c0f53edeac6ab0b032a6feae4abfd784e467b3f5@sprout-oss.stage.blox.sqprod.co> Co-authored-by: npub1t2tgm7d8f995uqvmnm8h88sg3wnpp9a5xysjf6dg3tjmgt3ltulqdp8ehr <5a968df9a7494b4e019b9ecf739e088ba61097b4312124e9a88ae5b42e3f5f3e@sprout-oss.stage.blox.sqprod.co> Co-authored-by: npub12gtutshhh76rx0jx697f32f9tffd4hhp3hx58fp4x6u4uemkm7sqf8f757 <5217c5c2f7bfb4333e46d17c98a9255a52dadee18dcd43a43536b95e6776dfa0@sprout-oss.stage.blox.sqprod.co>
1 parent cf97237 commit ccb021d

42 files changed

Lines changed: 10810 additions & 110 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎Cargo.lock‎

Lines changed: 26 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎Cargo.toml‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ members = [
2424
"crates/git-credential-nostr",
2525
"crates/git-sign-nostr",
2626
"crates/buzz-pair-relay",
27+
"crates/buzz-relay-mesh",
2728
"crates/buzz-dev-mcp",
2829
"examples/countdown-bot",
2930
]
@@ -61,6 +62,10 @@ nostr = { version = "0.44", features = ["nip44", "nip98"] }
6162

6263
# Serialization
6364
serde = { version = "1", features = ["derive"] }
65+
postcard = { version = "1", default-features = false, features = ["use-std"] }
66+
67+
# Inter-relay mesh transport (buzz-relay-mesh)
68+
iroh = { version = "1.0.0-rc.0", default-features = false, features = ["tls-ring"] }
6469
serde_json = "1"
6570
serde_yaml = "0.9"
6671
evalexpr = "11"
@@ -126,6 +131,7 @@ buzz-workflow = { path = "crates/buzz-workflow" }
126131
buzz-media = { path = "crates/buzz-media" }
127132
buzz-sdk = { path = "crates/buzz-sdk" }
128133
buzz-ws-client = { path = "crates/buzz-ws-client" }
134+
buzz-relay-mesh = { path = "crates/buzz-relay-mesh" }
129135

130136
# CI profile — builds the relay for desktop e2e. Dependencies keep full
131137
# release optimization (warm from main's cache; they carry the runtime hot

‎Dockerfile‎

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,29 @@ ARG RUST_VERSION=1.95
1515
ARG NODE_VERSION=24
1616
ARG DEBIAN_VERSION=bookworm
1717

18+
# Optional extra CA bundle for builds behind a TLS-intercepting corporate proxy
19+
# (e.g. a Cloudflare/Zscaler gateway that re-signs TLS). Empty by default, so
20+
# public CI builds are unaffected. Point it at a PEM file in the build context:
21+
# docker build --build-arg EXTRA_CA_CERTS=path/to/proxy-ca.pem ...
22+
# Consumed by the network-touching stages below (cargo + pnpm).
23+
ARG EXTRA_CA_CERTS=
24+
25+
# Optional npm registry for builds where the public registry is unreachable or
26+
# policy-blocked (e.g. a corporate mirror / Artifactory). Empty default = public
27+
# npmjs, so public CI builds are unaffected. Consumed by the web-builder stage.
28+
ARG NPM_REGISTRY=
29+
1830
# ─── Stage 1: cargo-chef base ───────────────────────────────────────────────
1931
FROM rust:${RUST_VERSION}-${DEBIAN_VERSION} AS chef
32+
# Trust an optional corporate-proxy CA before any network fetch (no-op if unset).
33+
ARG EXTRA_CA_CERTS
34+
COPY --chmod=0644 ${EXTRA_CA_CERTS:-Dockerfile} /tmp/extra-ca/src
35+
RUN if [ -n "${EXTRA_CA_CERTS}" ]; then \
36+
cp /tmp/extra-ca/src /usr/local/share/ca-certificates/extra-proxy-ca.crt \
37+
&& update-ca-certificates \
38+
&& echo "CARGO_HTTP_CAINFO=/etc/ssl/certs/ca-certificates.crt" >> /etc/environment; \
39+
fi
40+
ENV CARGO_HTTP_CAINFO=/etc/ssl/certs/ca-certificates.crt
2041
RUN cargo install cargo-chef --locked --version 0.1.71
2142
WORKDIR /build
2243

@@ -55,6 +76,31 @@ RUN cargo build --release --locked -p buzz-relay --bin buzz-relay \
5576
# vice versa.
5677
FROM node:${NODE_VERSION}-${DEBIAN_VERSION}-slim AS web-builder
5778
WORKDIR /build
79+
# Trust an optional corporate-proxy CA so corepack + pnpm can fetch over an
80+
# intercepting TLS gateway (no-op if EXTRA_CA_CERTS is unset).
81+
ARG EXTRA_CA_CERTS
82+
COPY --chmod=0644 ${EXTRA_CA_CERTS:-Dockerfile} /tmp/extra-ca/src
83+
RUN if [ -n "${EXTRA_CA_CERTS}" ]; then \
84+
apt-get update && apt-get install -y --no-install-recommends ca-certificates \
85+
&& cp /tmp/extra-ca/src /usr/local/share/ca-certificates/extra-proxy-ca.crt \
86+
&& update-ca-certificates \
87+
&& rm -rf /var/lib/apt/lists/*; \
88+
fi
89+
ENV NODE_EXTRA_CA_CERTS=/etc/ssl/certs/ca-certificates.crt
90+
# Point npm + corepack at an optional mirror (no-op when NPM_REGISTRY is unset).
91+
# corepack reads COREPACK_NPM_REGISTRY to fetch the pinned pnpm; pnpm/npm read
92+
# the .npmrc registry for dependency installs.
93+
ARG NPM_REGISTRY
94+
ENV COREPACK_NPM_REGISTRY=${NPM_REGISTRY}
95+
# When using a mirror, disable corepack's npmjs signature check: the mirror
96+
# republishes tarballs without the public registry's provenance signatures, so
97+
# strict verification fails ("No compatible signature found"). Only relaxed on
98+
# the mirror path — public builds (NPM_REGISTRY unset) keep strict verification.
99+
RUN if [ -n "${NPM_REGISTRY}" ]; then \
100+
echo "registry=${NPM_REGISTRY}" > /build/.npmrc \
101+
&& echo "COREPACK_INTEGRITY_KEYS=0" >> /etc/environment; \
102+
fi
103+
ENV COREPACK_INTEGRITY_KEYS=${NPM_REGISTRY:+0}
58104
RUN corepack enable
59105
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
60106
COPY patches/ patches/

‎crates/buzz-relay-mesh/Cargo.toml‎

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
[package]
2+
name = "buzz-relay-mesh"
3+
description = "Inter-relay QUIC mesh: transport, membership, and the fenced wire contract"
4+
version.workspace = true
5+
edition.workspace = true
6+
rust-version.workspace = true
7+
license.workspace = true
8+
repository.workspace = true
9+
10+
[dependencies]
11+
tokio = { workspace = true }
12+
serde = { workspace = true }
13+
serde_json = { workspace = true }
14+
postcard = { workspace = true }
15+
iroh = { workspace = true }
16+
redis = { workspace = true }
17+
deadpool-redis = { workspace = true }
18+
thiserror = { workspace = true }
19+
tracing = { workspace = true }
20+
uuid = { workspace = true }
21+
hmac = { workspace = true }
22+
sha2 = { workspace = true }
23+
hex = { workspace = true }
24+
nostr = { workspace = true }
25+
bytes = "1"
26+
futures-util = { workspace = true }
27+
28+
[dev-dependencies]
29+
tokio = { workspace = true, features = ["test-util"] }
30+
proptest = { workspace = true }

0 commit comments

Comments
 (0)