Skip to content

Advertise an announced gateway origin in capability ads and /api/nodes - #151

Merged
ralyodio merged 1 commit into
masterfrom
feat/gateway-url-in-ads
Nov 9, 2026
Merged

ralyodio merged 1 commit into
masterfrom
feat/gateway-url-in-ads

Conversation

@ralyodio

@ralyodio ralyodio commented Nov 9, 2026

Copy link
Copy Markdown
Collaborator

What

  • capabilities.rs: announced_gateway(config) / gateway_origin(raw). A node with the gateway role and gateway.announce set puts "gateway": "<scheme://host[:port]>" in its hardware blob. Nothing without the setting, never in private mode.
  • status_aggregator.rs: NodeRow.gateway, re-validated through gateway_origin (http/https, host present, no userinfo, <= 200 chars).
  • apps/web/src/lib/nodes.ts: gateway?: string | null on NodeRow (passed through by publicRow).
  • docs/hosting.md: Moshpit names section updated + "Finding gateways".

Why

Today /api/nodes has no gateway addresses, so nothing outside libp2p can find a gateway to fetch /s/<site_id>/ from. The Moshpit c0mpute edge (profullstack/moshpit-proxy#31, registry side moshcoder/moshcode#600) discovers gateways here, with seeds as a fallback. Published only by operator opt-in: the operator typed this address, the same one d1sks already lists, so it stays within the board's no-addresses rule.

No version bump. The Moshpit design does not need the hosting DNS verifier to query dns.moshcode.sh (the edge fetches /s/<site_id>/, no Host check), so that change is not included.

Tests (docker, rust:1.92)

  • capabilities::tests::gateway_origins_are_sanitized, gateway_is_advertised_only_when_announced_and_public (new)
  • status_aggregator::tests::node_board_ranks_by_bench_and_counts_referrers extended: valid gateway published as a bare origin, invalid dropped, absent when not announced
  • cargo test -p c0mpute-core --lib -- gateway node_board: 12 passed; cargo build --workspace --all-targets --locked: clean

🤖 Generated with Claude Code

A gateway whose operator set gateway.announce now puts its public origin
in its capability ad (`gateway`), and the node board publishes it as
`gateway` on /nodes and /api/nodes. Opt-in (nothing without the setting,
never in private mode, only with the gateway role), re-validated by the
aggregator to a bare http(s) origin with no credentials.

This is how a client that is not a libp2p peer (the Moshpit c0mpute edge,
profullstack/moshpit-proxy#31) finds gateways to fetch /s/<site>/ from,
without a central list.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown

ThreatCrush Security Scan

12 finding(s)

HIGH/CRITICAL: 1 | MEDIUM: 8 | LOW: 3

Severity Rule Location
HIGH js-ssrf-outbound-request apps/web/public/sw.js:24
MEDIUM js-unescaped-html-sink apps/web/src/app/blog/[slug]/page.tsx:53
MEDIUM js-unescaped-html-sink apps/web/src/app/layout.tsx:80
MEDIUM sh-remote-script-execution scripts/dev-setup.sh:25
MEDIUM sh-eval-expansion scripts/dev-setup.sh:35
MEDIUM sh-remote-script-execution scripts/install.sh:173
MEDIUM sh-remote-script-execution scripts/install.sh:198
MEDIUM sh-remote-script-execution scripts/install.sh:316
MEDIUM sh-remote-script-execution scripts/install.sh:354
LOW py-ssrf-outbound-request examples/business-strategist-agent/chat.py:37
LOW py-ssrf-outbound-request examples/business-strategist-agent/train.py:54
LOW secret-generic-credential node/crates/c0mpute-core/src/webhook.rs:1165

Snippets are redacted; ThreatCrush never prints matched credential material.

@ralyodio
ralyodio merged commit 6b4a4b1 into master Nov 9, 2026
12 checks passed
sh1pt-actions-fleet Bot pushed a commit that referenced this pull request Nov 9, 2026
Ships podcasting + podcasts (and #151 gateway addresses in /api/nodes).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ralyodio added a commit that referenced this pull request Nov 9, 2026
* feat(podcasting,podcasts): p2p podcasts on top of hosting

podcasting: `c0mpute podcasting publish <folder|files> --name <show>` builds
an RSS 2.0 + iTunes + Podcasting 2.0 feed (enclosures with length+type, guid,
pubDate, podcast:guid = uuid v5 of the site id, podcast:locked, optional
podcast:value), an episode page and the audio, and publishes it as a hosting
site (three self-healing copies, served at /s/<site_id>/feed.xml).

podcasts: subscribe to c0mpute shows (via a gateway or --p2p) or any RSS feed
(net_guard on every redirect hop), list, download and play episodes.
Subscriptions in <data_dir>/podcasts/subscriptions.json. quick-xml reader.

hosting: feed.xml/rss.xml serve as application/rss+xml; audio MIME types.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* bump v0.2.75

Ships podcasting + podcasts (and #151 gateway addresses in /api/nodes).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* bump v0.2.76

v0.2.75 was taken by #153; ships podcasting + podcasts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant