You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(directconn): show administrators whether the host can accept direct connections - #5047
Other clients: Apple Silo-Server/silo-apple#1248 (native client support for the direct path, which a later pull request of this feature adds; this one changes only the admin readiness view); Android Silo-Server/silo-android#1028 (same); Roku N/A (the connection-path setting that a later pull request adds lists no Roku platform, and silo-roku's spec records that a Roku cannot join a tailnet)
Native clients reach Silo over TCP. On a long or lossy link that route recovers slowly from loss, and a client has no other route. #4440, from the proposal in #4436, adds a direct UDP path between native clients and the API host. Before any of that can run, an administrator needs to know whether the server host can accept it: whether it can map a NAT port, use IPv4 and IPv6, open a port, and size its socket buffers. This change adds that readiness check and shows its result in the Network Access admin page. It starts no engine and opens no playback path. It is the first of three pull requests, and the next one starts the engine behind a Redis lease.
Approach
Settings. Three admin settings: direct_connections.enabled (default false), direct_connections.port_mapping (default true) and direct_connections.stun_servers (default Cloudflare's and Google's STUN servers; at most eight host:port entries, each validated). While the feature is off, no STUN or port-mapping probe runs, and the local socket reads send no packets. There is no settings-page field to turn the feature on: the Direct Connections section appears on Network Access once an administrator sets direct_connections.enabled to true through the admin settings API. Backups treat all three settings as server-specific, so a restore onto another server does not carry them.
The check. The API and integrated modes run one check at startup and run it again when the effective settings change. A settings save rereads settings in the background, so a slow read never holds the save's response. Callers share a check that is already running, a caller that stops waiting does not cancel it, and a check and the settings read that starts it each have a 15-second bound. A status read rereads settings in the background after a failed read, or once the last read is a minute old, so a settings-change event this process missed still reaches the status. The check reports the direct path, NAT mapping, IPv4, IPv6, port mapping, socket buffers, GSO, GRO, path MTU fallback and the CAP_NET_ADMIN capability. An address family that no configured STUN server can answer in (a list of IPv4 literals tests no IPv6) is reported as not measured. NAT hairpin and reachability are reported as not measured. On Linux the kernel doubles a socket buffer when it grants one, so the status and the logs report the usable size, half the readback.
Two admin operations.GET /api/v2/admin/direct-connections/status returns the API host's features, startup tuning values and, once bound, the API, Jellyfin and Audiobookshelf listener results. ?refresh=true starts a check or joins the one in flight. A settings read that fails or runs out of time answers 503 dependency_unavailable. GET /api/v2/admin/direct-connections/capabilities reports whether status reads and refreshes are supported. Both are for the acting administrator only. The API contract diff reports two additive changes. Each API process keeps its own result: with several API replicas, the one that answers reports itself under the api host, and the response does not yet name the replica.
The admin section. Network Access shows the features, listeners and tuning values in plain language, below the network access providers, and polls the last completed check every 15 seconds while the page is visible. A Run check button starts a new check, and an advanced part saves the port-mapping and STUN settings. A late response is refused after a profile token change.
Modules. The engine is a separate Go module, github.com/Silo-Server/shunpike, BSD-3-Clause. It builds against two forks of third-party modules that the Silo-Server organization also maintains: quic-go (MIT upstream) at v0.64.1-shunpike.2, which changes congestion control and path recovery, and Tailscale (BSD-3-Clause upstream) at v1.104.2-shunpike.2, which changes magicsock and DERP signaling. go.mod requires shunpike v0.1.2 and replaces the two modules by tagged version. Go ignores a dependency's replace lines, so go.mod repeats them, and make verify-fork-pins fails when any versioned replace in shunpike's go.mod is missing here or differs, or when go.mod replaces shunpike itself. CI runs it beside the go mod tidy check. THIRD_PARTY_NOTICES.md records the notices.
The commit that links the modules also raises quic-go to the v0.64.1 line and webtransport-go to v0.13.0, and the WebTransport compatibility shim follows upstream's rename of Dialer to Transport. Upstream Tailscale's requirements raise the AWS SDK, miekg/dns, gorilla/websocket, prometheus/client_model and golang.org/x/time, and add tailscale.com with its netlink and UPnP dependencies.
Docs: docs/direct-connections-api.md and docs/architecture/direct-connections.md are new, and docs/architecture/observability.md lists the new directconn log component. docs/architecture/tcp-congestion.md now says the send-buffer log reports half the readback.
The section's text comes from keys under web.admin.settings.network.direct.* in Silo-Server/silo-translations#142, which merged with its translations. .silo-translations pins release 2026.11.22-e656ecc.
Validation
Tests that failed on the base, each for the reason the change addresses: the settings normalizer (the base accepted bad direct_connections.* values), the route manifest (the two routes were missing), and the send-buffer result (the raw doubled readback). The review fixes each have a test that failed before its fix: the minute-old settings reread, the address family a literal-only STUN list can't measure, the 503 on a failed settings read, and the fork-pin checker accepting an extra fork or a shunpike replace. The new package's tests and the web section and hook tests test code the base doesn't have.
At this head with Go 1.27.4: build, vet, the touched packages' tests, make verify-fork-pins (Fork pins match github.com/Silo-Server/[email protected]), go mod tidy -diff, the contract checks, the web type check, and the web tests.
Live, on a sandbox built from 6108b8f, with packet captures in the API container's network namespace:
With the feature off, a forced check sent nothing on the STUN, NAT-PMP/PCP, SSDP, or DNS ports, and the section is absent.
Enabling it ran one check: STUN to both default servers and router discovery.
With port mapping off, the check sent STUN only.
The settings API refused five bad values with 422, and normalized a mixed list.
A STUN change written straight to the database reached the status through the minute-old reread.
Surface and build: Admin, Network Access, at desktop, tablet and phone widths, feature off and on. The page names the sandbox build, quotes the status responses and packet captures, and links the tests' runs on the base.
Risks
New dependencies. The modules above enter the build, with the raised requirements. The compatibility shim for zishang520/webtransport-go, an indirect dependency of the Socket.IO libraries, now builds against the quic-go fork. Its only code change is the rename, and the Audiobookshelf socket opens no WebTransport listener.
gorilla/websocket. Upstream Tailscale moves it from v1.5.3 to an untagged commit. One visible change: a request to the Jellyfin /socket that isn't a WebSocket upgrade now gets 426 Upgrade Required instead of 400.
Startup work. Every API and integrated process runs one local readiness check at startup, even with the feature off. With it off, no network probe runs.
Several API replicas. Each reports its own process under the same api host, so the page can show whichever replica answered. The engine pull request needs to settle which replica's readiness the page shows.
Hidden toggle. The only way to turn the feature on is the admin settings API.
Checklist
I read and can explain the complete diff.
This pull request addresses one concern.
Each test this pull request adds meets "Decide what to test" in CONTRIBUTING.md.
The Evidence section shows every change a user can see, or how I checked a change nobody sees.
Council review
Rounds: 1, last reviewed 9bfc766 (maintainer review)
Fixed: the save path's synchronous settings reread, the unmeasured address family, the 500 on a failed settings read, the fork-pin checker's gaps, the per-replica docs, the section's place on the page, and the gap in the host tuning rows. Answered: the closed response enums (a contract-checker gap that predates this pull request, addressed in #5095), refresh on GET (existing v2 precedent), logging under the status lock, and the self-check's size. Open for the maintainers: the visual design points that come from shared settings components (heading scale, field widths, disclosure style) and a readiness summary.
Adversarial review: Two reviewers on different models (claude-opus-5-5 in Claude Code, gpt-6.1-sol in Codex CLI) read the three pull requests of this feature in one round, and a claude-sonnet-5-5 seat merged their findings. For this pull request they checked the module and license changes against the published modules. They found one Medium defect: THIRD_PARTY_NOTICES.md lacked shunpike's own license, was missing 14 modules from the notice block, and named the wrong owner for the forks. It was fixed, and a separate claude-sonnet-5-5 seat checked the fix.
Maintainer review: Claude Code (claude-opus-5-5) moved the modules to the Silo-Server organization, merged main, and added the review fixes listed in Council review.
Note
Add direct-connections status self-check and admin status UI
Adds a directconn.Service that reads the direct-connections admin settings, runs NAT, port-mapping, and local-capability probes, and publishes a status snapshot with feature, listener, and tuning rows (selfcheck.go, features.go).
Exposes the status to acting administrators via GET /api/v2/admin/direct-connections/status and a capabilities route in direct_connections.go, rendered in the admin network settings page by DirectConnectionsSection.tsx.
Adds admin settings for the enabled toggle, port mapping, and STUN servers, with validation and defaults in admin_settings.go.
Adds React Query hooks that poll status every 15 seconds and guard refreshes against profile-token changes (directConnections.ts).
Pins quic-go and Tailscale to Silo-Server forks via Shunpike v0.1.2 in go.mod, verified in CI by make verify-fork-pins.
Behavioral Change: tcpcongestion send-buffer results now report half of the Linux SO_SNDBUF readback as the usable grant (buffers.go); log records gain a directconn component with deduplicated feature rows. Also adds locale entries across all catalogs.
The module requires github.com/darthShadow/shunpike v0.1.1, and replace
lines point quic-go and Tailscale at the published forks, tagged
-shunpike.2. Shunpike itself needs no replace line. Go ignores a
dependency's own replace directives, so the server repeats shunpike's
fork replacements. scripts/ci/forkpins reads the shunpike version from
the require line and checks that each fork replace line matches
shunpike's pin exactly. Run it with make verify-fork-pins; CI runs it
next to the go mod tidy check.
quic-go moves to the v0.64.1 line and webtransport-go to v0.13.0. The
WebTransport compatibility shim follows the upstream rename of Dialer
to Transport.
The shunpike engine raises several dependencies, including the AWS
SDK, miekg/dns, gorilla/websocket, protobuf, and the Prometheus
libraries, and adds tailscale.com with its netlink and UPnP
requirements. THIRD_PARTY_NOTICES.md records the shunpike and fork
notices.
Signed-off-by: Anagh Kumar Baranwal <[email protected]>
It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.
The pull request adds direct-connection settings, readiness checks, administrator API endpoints, and web controls and diagnostics. It also updates listener buffer reporting, routes quic-go and Tailscale through Shunpike forks, and adds a CI check for those fork pins.
Changes: Direct-Connection Readiness
Layer / File(s)
Summary
Settings and status contracts internal/config/admin_settings.go, internal/config/admin_settings_test.go, internal/directconn/settings.go, internal/directconn/status.go, internal/tuning/tuning.go, internal/backup/settings_classes.go
Adds direct-connection setting keys and defaults, validates boolean and STUN server values, and defines readiness status, listener, knob, and settings-store structures.
Readiness checks and feature reporting internal/directconn/selfcheck.go, internal/directconn/features.go, internal/directconn/logs.go, internal/directconn/*_test.go
Adds settings reconciliation, bounded capability and network checks, feature-state reporting, and change-based logging. Tests cover check triggers, coalescing, cancellation, probe outcomes, and reported states.
Listener registration and buffer reporting cmd/silo/compat_listener.go, cmd/silo/main.go, internal/tcpcongestion/buffers.go, internal/tcpcongestion/*_test.go
Passes listener results to the readiness service. Forced send-buffer results report usable granted bytes, and tests check the updated value.
Administrator readiness API contracts/api/v2/*, internal/apiv2/*direct_connections*, internal/apiv2/{document.go,fixtures_test.go,router.go}, internal/api/{router.go,testdata/media_routes.txt}, web/src/api/v2/{operations.ts,schema.ts}, docs/direct-connections-api.md
Adds administrator capabilities and status endpoints, response schemas, service wiring, fixtures, and API documentation.
Administrator settings and diagnostics web/src/components/admin/DirectConnectionsSection*, web/src/hooks/queries/admin/directConnections*, web/src/pages/admin-settings/NetworkAccessSettings.tsx, web/src/locales/{en.json,en-XA.json,ar-XB.json,keys.ts}, .silo-translations
Adds settings controls and readiness diagnostics to the network access page. Adds profile-scoped status and refresh hooks, tests, and translation entries.
Documents readiness checks and their reporting. Adds historyimport to the canonical component list.
Fork Pin Verification
Layer / File(s)
Summary
Fork dependencies and notices go.mod, internal/compat/zishang520-webtransport-go/{compat.go,go.mod}, THIRD_PARTY_NOTICES.md
Updates dependency versions and routes quic-go and Tailscale through Shunpike fork replacements. Adds fork and dependency notices, and updates the WebTransport compatibility alias.
Pin checker and CI integration scripts/ci/forkpins/*, Makefile, .github/workflows/trusted-linux-ci.yml, CONTRIBUTING.md
Adds a command and tests that compare the repository fork replacements with Shunpike’s module file. Adds the Make target, CI invocation, and documented verification command.
sequenceDiagram
participant Admin
participant DirectConnectionsEndpoint
participant DirectConnectionsService
participant SettingsStore
participant CapabilitySource
participant NATProber
Admin->>DirectConnectionsEndpoint: Request readiness status
DirectConnectionsEndpoint->>DirectConnectionsService: Request status or refresh
DirectConnectionsService->>SettingsStore: Read administrator settings
DirectConnectionsService->>CapabilitySource: Probe capabilities
DirectConnectionsService->>NATProber: Probe NAT when enabled
DirectConnectionsService-->>DirectConnectionsEndpoint: Return status snapshot
DirectConnectionsEndpoint-->>Admin: Return readiness response
Loading
Possibly related issues
Issue 4440: The issue describes the direct-connection readiness scope, including settings, self-checks, administrator operations, and the Network Access section.
Suggested reviewers:quick104, blurbery
Merge Risk: Low · up to 0f53f
This change adds a hidden, default-off readiness check and an administrator diagnostics view; it does not change playback. The remaining issues are small: some malformed IPv4-like STUN entries are accepted on save. The translation pin still names a local build that a clean checkout cannot reinstall. A replica can show stale readiness after a missed settings event. Logging still runs under the status lock, so a stalled log sink could delay status responses. The change is mergeable once the translation pin is updated and the owner accepts or fixes the other items.
Security architecture risk: Minimal · up to 0f53f
The checks are administrator-controlled and disabled by default. The inspected change establishes no material security, ownership, or rollback regression and does not activate a direct playback path.
Retained concerns
No architecture-level concerns identified.
Security review details
Security Blast Radius
inferred — The new configurable network authority is server-administrator controlled and executes from each participating API process's network environment. Configuration accepts private and loopback address literals as well as DNS names; actual resolution and packet behavior belong to the unavailable external probe implementation. The inspected chain does not establish unprivileged destination control, credential forwarding, or arbitrary data retrieval.
Trust Boundaries and Controls
observed — Settings writes and both readiness endpoints declare the acting-administrator class. Its shared gate requires authentication, viewer access, and the acting-administrator decision, failing closed when required authorization dependencies are absent. Single-setting writes invoke the shared normalizer before proceeding. NAT and router discovery are separately gated by the captured enablement and port-mapping settings.
Resilience and Maintainability Implications
observed — Single-flight ownership contains concurrent refreshes within each process. Failed reads cannot be cleared by an older successful read, and pending failures trigger later recovery. Cached reporting is not continuous probing: new probe runs are driven by startup, changed settings, or refresh. Consequently, snapshot staleness is not itself evidence of an active playback path or indefinitely recurring enabled probes.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title "feat(directconn): show administrators whether the host can accept direct connections" matches the main change. The changeset adds a directconn readiness self-check service, admin status and…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Description check
The description is specific to the changeset. It explains the direct-connection readiness check, the three new admin settings, the two admin endpoints (status and capabilities), the Network Access adm…
Full details: Title check
Explanation
The title "feat(directconn): show administrators whether the host can accept direct connections" matches the main change. The changeset adds a directconn readiness self-check service, admin status and capabilities endpoints, and a Network Access admin section that shows the host's direct-connection readiness. The title is specific, follows conventional commit style, and does not describe anything absent from the changeset.
Full details: Description check
Explanation
The description is specific to the changeset. It explains the direct-connection readiness check, the three new admin settings, the two admin endpoints (status and capabilities), the Network Access admin section, the Shunpike module and fork pins with make verify-fork-pins, and the send-buffer readback change. It also lists the docs, tests, and validation performed, so it describes the changes in enough detail to pass.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
The reason will be displayed to describe this comment to others. Learn more.
Local translation pin breaks the pinned-release sync workflow
The local dirty pin makes scripts/sync-translations fail without the matching translations checkout and prevents reproducing the catalog from a release. Pin a published translations release and its checksum instead.
Prompt for LLM
File .silo-translations, lines 2-3:
Local translation pin breaks the pinned-release sync workflow
The committed local dirty pin makes the documented `scripts/sync-translations` reinstall fail unless the developer has the exact separate translations checkout, and it cannot reproduce the generated catalog from a release. Pin a published translations release and its checksum instead.
The reason will be displayed to describe this comment to others. Learn more.
Right, the pin names a local catalog build for now. The keys are in Silo-Server/silo-translations#142. Once that merges and its release is published, I'll re-sync with scripts/sync-translations --version <release> and update this commit, so .silo-translations names the published release before this pull request merges.
The reason will be displayed to describe this comment to others. Learn more.
That plan addresses the reproducibility concern. The local pin can remain while the translations PR and release are pending; before merging this PR, re-sync to the published release and verify that .silo-translations contains its version and checksum.
The reason will be displayed to describe this comment to others. Learn more.
🤖 Claude Code (claude-opus-5-5)
Still open at ca62dcf: the pin reads version=local-19b5086f3aa9-dirty and sha256=-, and Silo-Server/silo-translations#142 hasn't merged. AGENTS.md requires a published release before this merges, so this is the merge blocker. The branch also conflicts with main in .silo-translations, web/src/locales/keys.ts, and go.mod. The re-sync against the published release is the natural point to merge main in.
The reason will be displayed to describe this comment to others. Learn more.
The translation pin remains a merge blocker, based on the reported state at ca62dcfc. Once Silo-Server/silo-translations#142 merges and its release is published, the next steps are to merge main, resolve the three reported conflicts, and re-sync with scripts/sync-translations --version <release> so the pin includes the published release and checksum.
I haven’t independently verified the current branch state or changed anything.
The reason will be displayed to describe this comment to others. Learn more.
Refresh timeout does not cover settings reads
A stalled settings read can make the endpoint wait indefinitely because s.reconcile runs before the probe timeout starts. Apply a 15-second deadline to the entire refresh, including reconciliation and waiting for the run.
Prompt for LLM
File internal/directconn/selfcheck.go, lines 140-143:
Refresh timeout does not cover settings reads
A refresh reads settings using the request context before starting the 15-second probe timeout, so a stalled database or settings gate can make the endpoint wait indefinitely despite its documented bound. Apply a 15-second deadline to the whole refresh operation, including reconciliation and waiting for the run.
The reason will be displayed to describe this comment to others. Learn more.
Fixed. Every settings read now runs under the 15-second check timeout, including the wait for an earlier read. That covers the status path and the settings-change path, which runs with context.Background(). Caller cancellation still ends the call at once. TestStatusFirstReadBound and TestSettingsChangedReadBound cover both paths.
The reason will be displayed to describe this comment to others. Learn more.
Thanks for addressing this. Based on your description, the settings-read and gate-wait paths are now bounded, including the background settings-change path, while caller cancellation remains responsive.
One point to confirm: does a single 15-second deadline cover both reconciliation and waiting for the shared check, rather than giving each a separate 15-second budget? The original suggestion concerned the total refresh time.
I couldn’t retrieve the updated file to verify the implementation or tests.
The reason will be displayed to describe this comment to others. Learn more.
No, they are two budgets. The settings read, including its wait for an earlier read, has its own 15-second bound, and the shared check has its own. A status call that has to start a check can therefore wait up to about 30 seconds. One shared deadline would end the caller's wait while the check keeps running, which the request's own context already does: canceling the request ends the call at once.
The reason will be displayed to describe this comment to others. Learn more.
Thanks for clarifying. The two separate budgets address the indefinite settings-read wait raised in the original suggestion. They do not impose a 15-second limit on the entire status request: a call that must read settings and start a check can take about 30 seconds unless its request context has an earlier deadline or is canceled.
That distinction seems reasonable if the intended guarantee is that each phase is bounded, rather than that the endpoint responds within 15 seconds. The documentation should make that distinction clear. I haven’t verified the implementation or tests directly.
The reason will be displayed to describe this comment to others. Learn more.
The docs now state the distinction. docs/architecture/direct-connections.md, docs/direct-connections-api.md and the status operation's description in the OpenAPI document say that the settings read and the check each have their own fifteen-second bound, so a request can take about thirty seconds.
The reason will be displayed to describe this comment to others. Learn more.
Thanks for clarifying the documentation. Stating the two separate 15-second bounds and the approximately 30-second total addresses my concern about the endpoint’s stated timing guarantee.
I haven’t independently verified the documentation or implementation.
The reason will be displayed to describe this comment to others. Learn more.
An empty STUN server list silently restores public servers
Clearing the STUN server list still sends probes to third-party servers because EffectiveAdminSettings replaces empty stored values with defaults. Preserve the explicit empty value when building direct-connection settings.
Prompt for LLM
File internal/directconn/settings.go, lines 26-27:
An empty STUN server list silently restores public servers
An explicitly empty STUN server setting is replaced by the public defaults because `EffectiveAdminSettings` ignores empty stored values for keys with defaults. Preserve the explicit empty value when building direct-connection settings so clearing the list does not continue sending probes to third-party servers.
The reason will be displayed to describe this comment to others. Learn more.
This is intended. An empty direct_connections.stun_servers means "use the defaults", the same rule EffectiveAdminSettings applies to every admin setting with a default. The defaults are Cloudflare's and Google's public STUN servers, and a STUN binding request tells them only the server's public address. An administrator who wants no STUN probes turns the feature off: while direct_connections.enabled is false, the check sends no STUN or port-mapping probe. The field's description is being updated in Silo-Server/silo-translations#142 to say that an empty field uses the defaults.
The reason will be displayed to describe this comment to others. Learn more.
Thanks for clarifying. I withdraw the suggestion: an empty STUN server list is intended to use the public defaults, not disable STUN probes. Disabling direct connections is the supported way to prevent STUN and port-mapping probes.
The planned field description should make that behavior clearer to administrators. Would you like me to save this convention for future reviews?
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.
The reason will be displayed to describe this comment to others. Learn more.
Minor · Maintainability & Code Quality · Heavy lift
Pin a reproducible translation build instead of a dirty local one.
.silo-translations pins version=local-2cf4aaccc815-dirty with sha256=-. When scripts/sync-translations runs without arguments, it rejects any local-* pin and exits before it changes any file. A clean checkout therefore cannot reinstall this state through the default path. The -dirty suffix also means the generated catalog depends on uncommitted changes in the silo-translations checkout, so the recorded version cannot reproduce the same content.
Before merge, replace the local pin with one that a clean checkout can reinstall. Use a published release with its SHA-256, or a version that identifies a committed silo-translations state.
The reason will be displayed to describe this comment to others. Learn more.
Right, the pin names a local catalog build for now. The keys are in Silo-Server/silo-translations#142. Once that merges and its release is published, I'll re-sync with scripts/sync-translations --version <release> and update this commit, so .silo-translations names the published release and its checksum before this pull request merges.
The reason will be displayed to describe this comment to others. Learn more.
Refresh bypasses pending settings reconciliation during a check
A failed settings read during an active check leaves refresh reporting old settings without scheduling the needed follow-up. Read pending settings before returning s.running and schedule a follow-up when they differ.
Prompt for LLM
File internal/directconn/selfcheck.go, lines 110-116:
Refresh bypasses pending settings reconciliation during a check
When a settings-change read fails during an active check, a refresh joins that check without retrying the pending read, so it reports the old settings and does not schedule the needed follow-up. Read pending settings before returning the running check and schedule a follow-up when they differ.
The reason will be displayed to describe this comment to others. Learn more.
Fixed. After a failed settings read, a refresh that finds a running check now reads the settings first. It schedules a follow-up check when the values differ from the running check's, and it returns the read error if that read fails too. TestRefreshReadsPendingChangeDuringRunningCheck and TestRefreshJoiningRunningCheckReturnsFailedRead cover both cases.
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the update. The described fix addresses the reported issue, and the two tests cover both successful reconciliation and a repeated settings-read failure. I haven’t independently verified the code or run the tests.
The reason will be displayed to describe this comment to others. Learn more.
Wall-clock ordering can permanently retain an obsolete readiness snapshot
Clock skew or a backward clock correction can leave readiness and enablement stale until wall time catches up. Change newerStatus to order responses by request or server generation identifiers rather than timestamps.
Prompt for LLM
File web/src/hooks/queries/admin/directConnections.ts, lines 43-47:
Wall-clock ordering can permanently retain an obsolete readiness snapshot
A replica with a clock ahead of another, or a host clock corrected backward, causes `newerStatus` to reject every subsequent legitimate snapshot until wall time catches up, leaving readiness and enablement stale. Order competing responses using request or server generation identifiers instead of comparing timestamps across checks.
The reason will be displayed to describe this comment to others. Learn more.
Fixed. The hook no longer compares checked_at. It orders status responses by request order on the client: a refresh result always replaces the cached status, and a poll that started before a refresh result was published is dropped. The test "publishes a poll that started after a refresh even when its checked_at is older" covers a skewed clock.
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the update. Removing the checked_at comparison addresses the clock-skew concern, and the new test covers the case where a later poll returns an older timestamp.
I haven’t independently verified the implementation or run the test. Client request ordering also doesn’t guarantee server-side freshness across replicas, so that remains a separate consideration if responses can come from different hosts.
Files skipped from review as they are similar to previous changes: 4
web/src/locales/ar-XB.json
web/src/locales/en-XA.json
web/src/locales/en.json
web/src/locales/keys.ts
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.
The reason will be displayed to describe this comment to others. Learn more.
A failed settings subscription permanently misses remote updates
Settings changes made on another replica leave this replica's readiness snapshot and probe configuration stale indefinitely. Retry eventBus.Subscribe or periodically reconcile settings after a subscription failure.
Prompt for LLM
File cmd/silo/main.go, lines 3208-3209:
A failed settings subscription permanently misses remote updates
If the initial Redis subscription fails, this replica never receives subsequent settings-change events, so changes made on another replica leave its readiness snapshot and probe configuration stale indefinitely. Retry the subscription or arrange periodic settings reconciliation after a subscription failure.
The reason will be displayed to describe this comment to others. Learn more.
Leaving this as is for this pull request. Every other cache.ChannelAdmin subscriber in cmd/silo/main.go handles a failed startup Subscribe the same way, and most of them discard the error. A retry or catch-up for a missed subscription belongs in the event bus, where it would cover all of them. A fix in this one subscriber would leave the others stale. This change now logs the failure. On this service, a refresh (?refresh=true) rereads the settings, and so does a restart. The setting only controls readiness probes, and nothing serves playback from it yet.
The reason will be displayed to describe this comment to others. Learn more.
That’s a reasonable decision for this PR. The subscription failure can still leave this replica’s readiness snapshot stale until a refresh or restart, but the failure is logged and the impact is limited to readiness probes for now.
A shared event-bus retry or reconciliation mechanism would address the same gap for the other subscribers. It may be worth tracking as a separate issue.
The reason will be displayed to describe this comment to others. Learn more.
🤖 Claude Code (claude-opus-5-5)
Covered by ee55cfb, the fix in the neighbouring thread. A failed subscription, or a message dropped during a reconnect, no longer leaves this replica stale: once its last settings read is a minute old, the next status read rereads settings in the background.
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the update. The on-demand reconciliation in ee55cfb addresses the reported indefinite staleness: after the last settings read is a minute old, the next status read triggers a background reload.
This is read-triggered rather than periodic, so a replica can remain stale until someone requests status. Based on the described readiness-only impact, that distinction seems reasonable for this PR.
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.
The reason will be displayed to describe this comment to others. Learn more.
Minor · Data Integrity & Integration · Quick win
Reload direct-connection settings after a missed settings event.
The API replica has no event-independent path that rereads direct_connections.* after a settings change. The only remote-change path is the EventSettingsChanged subscription at cmd/silo/main.go:3201-3210. Redis pub/sub does not replay messages published while a subscriber is disconnected. If that event is missed, directConn keeps its disabled snapshot until restart or the next settings event. The replica then reports the disabled state while other replicas report it enabled.
Add a reconciliation path that rereads committed direct-connection settings. Options include a periodic reread, or a reread after the subscription reconnects. The choice is left to the implementer, but the replica must converge without a restart.
The reason will be displayed to describe this comment to others. Learn more.
Leaving this as is for this pull request. Every other cache.ChannelAdmin subscriber in cmd/silo/main.go has the same gap: Redis pub/sub does not replay, and nothing rereads settings after a missed event. Catch-up after a reconnect belongs in the event bus, where it would cover all of them; a timer in this one service would leave the others stale. This change logs a failed subscription. On this service, a refresh (?refresh=true) rereads the settings, and so does a restart. The setting only controls readiness probes, and nothing serves playback from it yet.
The reason will be displayed to describe this comment to others. Learn more.
🤖 Claude Code (claude-opus-5-5)
One correction to the reasoning above: the neighbouring subscribers do have a fallback. The trusted-proxy reload is also registered on configWatcher.OnChange, and the watcher rereads settings every 60 seconds. Admin defaults expire after config.AdminDefaultsCacheTTL (10 seconds), whose comment says it bounds how long a node that missed the event keeps an old value. This service has neither. After a lost pub/sub message (Redis drops anything published while a subscriber reconnects), a replica keeps its old readiness until a refresh lands on that replica or it restarts.
Here that means a stale admin view. In the engine pull request the same path decides whether the engine starts, so it matters more there. configWatcher.OnChange alone won't cover it, because it fires only when config.Config changes and these keys aren't part of it. One bounded option is for a non-refresh Status to reread settings in the background, through the existing rereadSettings path, when the last read is older than a minute. I've left this open for the maintainers and haven't changed it.
The reason will be displayed to describe this comment to others. Learn more.
Seems like the humans are having a chat. I'll hop back into my burrow for now. If you need me again, just tag @coderabbitai in a new comment, and I'll come hopping out!
The reason will be displayed to describe this comment to others. Learn more.
🤖 Claude Code (claude-opus-5-5)
Fixed in ee55cfb. The service records when settings were last read successfully. A status read that finds that read a minute old starts the existing background reread and returns the snapshot at once, and the reread starts a check only if the values changed. TestStatusRereadsSettingsAfterMissedEvent failed before the change (it stayed on the old STUN servers) and passes now. I checked it live on a sandbox: a STUN list written straight to the database, with no settings event, reached the status on the first read after the minute, and the new check probed only the new server.
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 7
Review info
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Organization UI
Review profile: CHILL
Plan: Advanced
Run ID: 92f36ae9-f957-4639-89f9-1a12bd02cf50
Commits
Reviewing files that changed from the base of the PR and between 6a54365 and ece6ed6.
Files ignored due to path filters: 2
go.sum is excluded by !**/*.sum
internal/compat/zishang520-webtransport-go/go.sum is excluded by !**/*.sum
Files selected for processing: 3
internal/directconn/selfcheck.go
internal/directconn/selfcheck_join_test.go
internal/directconn/selfcheck_test.go
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 2 remain after this review.
The reason will be displayed to describe this comment to others. Learn more.
Minor · Stability & Availability · Heavy lift
Publish readiness results without waiting for log output.
logFeatures writes through the configured logger while s.mu is held. The production logger can write synchronously to stderr. If that sink stalls, the check cannot publish its result, and even a request for the previous snapshot blocks on s.mu. Neither the check deadline nor the request deadline releases that mutex. (raw.githubusercontent.com)
Update the deduplication state and publish the snapshot under the mutex. Send the log records through a bounded path outside the mutex so a stalled sink cannot delay readiness or create an unbounded log backlog.
The reason will be displayed to describe this comment to others. Learn more.
Leaving this out of this pull request. Logging the feature changes under s.mu comes from the first version of this code. A stalled stderr sink would also stall every other log call in the process, so a bounded log path here would not keep the server responsive on its own.
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Review info
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Organization UI
Review profile: CHILL
Plan: Advanced
Run ID: 81618017-07a9-49bf-a19c-81437872b675
Commits
Reviewing files that changed from the base of the PR and between ece6ed6 and 0f53f02.
Files ignored due to path filters: 2
go.sum is excluded by !**/*.sum
internal/compat/zishang520-webtransport-go/go.sum is excluded by !**/*.sum
Files selected for processing: 5
docs/architecture/direct-connections.md
internal/config/admin_settings.go
internal/config/admin_settings_test.go
internal/directconn/selfcheck.go
internal/directconn/selfcheck_test.go
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 2 remain after this review.
Add a hidden readiness self-check and an administrator view of its
result. It starts no direct-connection engine and opens no playback
path.
Three admin settings control it: direct_connections.enabled (default
false), direct_connections.port_mapping (default true), and
direct_connections.stun_servers (default Cloudflare and Google STUN, at
most eight validated host:port entries; an IPv4-mapped IPv6 literal is
stored as its IPv4 endpoint). While disabled, no STUN or port-mapping
probe runs; a check that started while enabled finishes, and the
follow-up check with the disabled values sends no probe. Local socket
capability reads send no packets. Backups treat all three as
server-specific, so a restore does not carry them over.
internal/directconn runs one single-flight check at startup and again
whenever the effective settings change. Duplicate change signals do
not rerun probes, and a request that stops waiting does not cancel
the shared check. A check is bounded by fifteen seconds. Only the API
and integrated modes run it.
Settings are read outside the service mutex. Reads are serialized
through publication, so a slow older read cannot override a newer one,
and a caller waiting on a read can still be canceled. Every settings
read, including its wait for an earlier read, is bounded by fifteen
seconds, as is the reread after a check that saw a settings change, and
ends when the service stops. This bound and the check bound are
separate, so a request that reads settings and starts a check can take
about thirty seconds. After a failed read, the next status read without
refresh reads again; with a completed snapshot it returns that snapshot
at once. A refresh that finds a running check joins it without a read,
except after a failed read: then it reads the settings first, returns
the read error if that read fails, and otherwise schedules a follow-up
check when the values differ from the running check's. The service
subscribes to admin events before its initial settings read, so a change
committed after the subscription reaches it and one committed before is
in the read. A failed subscription is logged.
Each observation maps to a feature, state, and reason. Rows cover the
direct path, NAT mapping and hairpin, IPv4, IPv6, port mapping,
reachability, socket buffers, GSO, GRO, PMTU fallback, and
CAP_NET_ADMIN. Linux doubles socket buffer readbacks, so status and
logs report a grant as the usable size, half the readback. A capped
buffer says whether NET_ADMIN was never held or was dropped after
startup. A buffer row that was not measured omits its requested and
granted byte counts.
A probe that gets no STUN reply reports off/probe_failed on the
nat_mapping, ipv4, and ipv6 rows. A probe that succeeds but finds no
address for a family reports that family's row as off/not_available.
NAT hairpin and mapped-address reachability stay unmeasured. The same
values, with each row's kind, go to the log; repeated unchanged
states are logged once.
GET /api/v2/admin/direct-connections/status
(getAdminDirectConnectionsStatus) returns the API host's features,
startup tuning values, and, once bound, the API, Jellyfin, and
Audiobookshelf listener results. Listener send-buffer grants use the
same usable size as the feature rows. ?refresh=true starts a check or
joins the one in flight. The operation is acting-admin only and
answers 503 when the service is missing.
GET /api/v2/admin/direct-connections/capabilities
(getAdminDirectConnectionsCapabilities) is also acting-admin only. It
reports state available when the service is wired and not_configured
when it is missing, and whether status reads and refreshes are
supported. It runs no probes and does not depend on the hidden
setting or on probe health.
The Network Access settings page gains a Direct Connections section once
direct_connections.enabled is true. It stays visible after the feature
is turned off while the form has unsaved edits, so they can still be
saved or discarded. It shows the features, listener results, and tuning
values, and polls every 15 seconds while the page is visible. Reasons
and states read as plain language, and listeners appear by name; the
host heading reads API server. All text in the section comes from
translation keys, so it follows the interface language. Every row has
one layout, with the state on the label line. Byte counts show as
sizes, and a listener's send buffer shows them only when a buffer was
requested. A send buffer that needs no increase shows Not needed. The
NET_ADMIN row shows Not needed only when no buffer row needed the
capability.
Each tuning variable has a plain label, with the variable name as
secondary text. Its values read as people say them: a congestion
algorithm as BBR, off as Off, and a buffer limit as a byte size.
Polling reads the last completed check and starts no new probes; a Run
check button starts one. The page orders status responses by request
order, not by server check time, so clock skew between replicas cannot
hold an old result: a refresh result always replaces the cached status,
and a poll that started before a refresh result was published is
dropped. An advanced section saves direct_connections.port_mapping
and direct_connections.stun_servers. Status and refresh results are
keyed to the profile authority that requested them, so a late response
is refused after a profile token change.
Signed-off-by: Anagh Kumar Baranwal <[email protected]>
The reason will be displayed to describe this comment to others. Learn more.
Scoped IPv6 STUN server addresses are rejected
Administrators cannot use valid link-local STUN endpoints such as [fe80::1%eth0]:3478. Parse IPv6 zones separately before validating the IP literal.
Prompt for LLM
File internal/config/admin_settings.go, lines 1649-1650:
Scoped IPv6 STUN server addresses are rejected
Scoped IPv6 STUN endpoints such as `[fe80::1%eth0]:3478` now fail validation even though they are valid socket addresses, preventing administrators from using a link-local STUN server. Parse IPv6 address zones separately before validating the IP literal.
The reason will be displayed to describe this comment to others. Learn more.
Leaving this as is. The STUN list is how the check learns the public address the NAT maps this host to, and a link-local server is on the same link with no NAT between them, so it cannot report that address. A zone also names a network interface on one host, which a server-wide setting does not model. This isn't new in ca62dcfc0: net.ParseIP returns nil for fe80::1%eth0, and the DNS-name rules refused the : and % before this change too.
The reason will be displayed to describe this comment to others. Learn more.
Understood. I’ll withdraw the suggestion: although scoped IPv6 addresses are valid socket addresses, the proposed link-local STUN endpoint does not serve this check’s public NAT-mapping purpose, and interface zones are not modeled by the server-wide setting. No change is needed.
decideForce now logs granted as half the SO_SNDBUF readback, the usable
size. The log reference still called it the raw readback.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The host heading test checked copy and the field-name test checked a CSS
class and element order. CONTRIBUTING.md asks tests to assert outcomes,
not CSS classes, DOM structure, or copy.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The admin-channel subscriber read and decrypted every setting on each
settings_changed event, for any key and on every API replica, even with
the feature off. Publishers name the changed key in the payload, so skip
events for other keys. An event with no key still triggers a read.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The reason will be displayed to describe this comment to others. Learn more.
🤖 Claude Code (claude-opus-5-5)
Review of ca62dcf. I traced the self-check's running, follow-up, pending-read, and reread states through refresh and non-refresh calls and found no lost or doubled check. The probes stay off while the feature is off. There are four findings below. The first needs a maintainer decision; I'm fixing the other three in commits on this branch, so those need nothing from you. The missed-event gap and the translation pin are answered in their existing threads, and the summary comment covers the rest.
The reason will be displayed to describe this comment to others. Learn more.
Maintainer decision: whether this PR needs the forks yet, and where they live.
This PR calls three probes (CheckNAT, ProbePortMapping, ProbeCapabilities) but imports all of shunpike/engine, which also holds magicsock, wireguard-go, and the QUIC transport. That is what makes these two replace lines mandatory now. From this PR on, every Silo binary builds quic-go and tailscale.com from forks, including the existing Audiobookshelf Socket.IO shim, before anything runs the engine.
The probes don't need either fork. They use Tailscale's net/netcheck, net/portmapper, net/netns, net/netmon, util/eventbus, and tailcfg, and those packages are byte-identical between v1.104.2-shunpike.2 and upstream v1.104.2; the fork changes only wgengine/magicsock and derp/derphttp. The one fork-only call is quic.CongestionControlName in ProbeCapabilities, which fills BBRSender, a field this PR never reads.
Options: keep it as is; have shunpike expose the probes from a leaf package with no fork-only calls, so this PR builds against upstream modules and the replace lines and verify-fork-pins arrive with the engine PR; or move the modules to the Silo-Server organization first, as the proposal offered. The raised requirements (the gorilla/websocket pseudo-version, the AWS SDK, miekg/dns) come from upstream Tailscale's go.mod, so they arrive with any of these.
The maintainers decided Silo-Server maintains shunpike and both forks. The modules now live at Silo-Server/shunpike, Silo-Server/quic-go and Silo-Server/tailscale, at the same fork tags. This branch requires shunpike v0.1.2, whose only change is the module path and fork pins (4765299).
The translation pin names silo-translations release 2026.11.22-e656ecc, which carries this pull request's keys in every language. Main is merged in, and the branch is mergeable.
Review fixes, each with a test that failed before it:
a minute-old settings reread, so a missed settings event can't leave a replica stale (ee55cfb);
the settings save no longer waits on the readiness reread (67ca277);
an address family no configured STUN server can test reads "not measured" (d900330);
the fork-pin check now compares every fork shunpike pins and refuses a replace of shunpike (14b104a).
Earlier: the send-buffer log doc (6ba3345), two layout-only tests removed (64cf4e4), and the settings-event filter (1e8d709).
Web: the section now follows the providers list, so the providers intro stays next to it (443d1de), and host tuning details sit under their value (2b84c69).
Docs: the API doc notes that each API process reports itself, and the 503 (6086ee0).
Left for the maintainers
Several API replicas. Each process keeps its own result under the single host api, so behind a load balancer the page shows whichever replica answered. This is documented now. The engine pull request will need to say which replica's readiness the page shows.
Visual design points from the review. These come from shared settings components or are design calls, not defects in this section:
subheadings set larger than the section title;
toggles and inputs ending short of the right edge;
a single-line STUN field (the same input trusted proxies uses);
the Advanced disclosure's style;
the floating header over scrolled content;
no overall readiness summary.
Single-family STUN host names. A name with addresses in only one family still counts for both. The fix belongs in shunpike's NAT report.
Validated features: no passed validation case reaches this change. Validation tasks: none is right.
Validation
Tests that failed on the base for the reason the change addresses: the settings normalizer, the route manifest, and the send-buffer result.
At this head: build, vet, the touched Go packages' tests, fork pins, go mod tidy -diff, contract checks, the web type check, and the web tests. CI on 6108b8f has passed every completed job.
Live, on a sandbox built from 6108b8f, with packet captures inside the API container:
With the feature off, a forced check sent nothing on the STUN, NAT-PMP/PCP, SSDP, or DNS ports.
Enabling it ran one check, with STUN to both default servers and router discovery.
With port mapping off, the check sent STUN only.
The settings API refused five bad values with 422.
A STUN change written straight to the database reached the status through the minute-old reread.
Council review: one round on 9bfc766. Sol 7/10, Opus 6.5/10, Gemini 7/10. Their confirmed findings are fixed above or listed as open. The rest were answered in the review threads.
Visual review: two rounds. Round 1, on 6086ee0: Sol new, 7/10; Opus new, 6/10; Gemini new, 6/10. Round 2, on 6108b8f: Sol better, 7.5/10; Opus better, 7/10; Gemini better, 7/10.
User manual: unaffected for now. The section appears only after an administrator sets the hidden setting through the API.
Fit: 7/10 · Readiness: 8/10 — conditional (assuming CI is green)
Fit: Direct UDP connections between native clients and the API host #4440 accepts the feature, and this slice is off by default and sends nothing while off. The modules are now maintained by the Silo-Server organization. It still adds three settings and two admin operations, and a Tailscale-based stack in the core server ahead of the engine that uses it.
Readiness: every finding from the review is fixed or answered, and the behavior was shown live and by tests that failed on the base. It stays conditional on two calls for the maintainers: how the engine pull request handles several API replicas, and the visual design points above.
…organization
Silo-Server now maintains shunpike and the quic-go and Tailscale forks.
Require github.com/Silo-Server/shunpike v0.1.2, which differs from v0.1.1
only in its module path and fork pins, and point both replace lines at the
organization's forks at the same shunpike.2 tags. The notices name the
new locations and keep the author's copyright.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Redis drops a settings-change event published while a subscriber
reconnects, and nothing else rereads direct-connection settings, so a
replica that missed one kept its old readiness until a refresh reached it
or it restarted. The trusted-proxy reload has the config watcher's poll
and admin defaults have a TTL; this service had neither.
Status now starts its existing background reread once the last successful
read is a minute old. It still returns the snapshot at once, and the
reread starts a check only when the values changed.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Resolve go.mod against main's direct golang.org/x/term requirement, and
re-pin the web catalog to silo-translations 2026.11.22-e656ecc, the
release that carries this pull request's keys.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ponse
The settings handler calls OnServerSettingUpdated once per changed key before it answers, and the direct-connections hook waited there for a full settings read with a 15 second bound. A slow read after the commit could hold an administrator's save for up to 45 seconds. The hook now rereads in the background on a context that outlives the request; the service still bounds the read, reads serialize there, and unchanged values start no check.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…er can test it
The prober sends to an IP literal only in its own family, so a STUN list of IPv4 literals never tests IPv6, yet the status reported IPv6 as not available. A family that no configured server can answer in now reads unknown/not_measured; a host name still covers both.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ings
A failed or timed-out settings read reached serviceProblem and became a 500 internal error. The API contract answers temporary dependency failures with 503 dependency_unavailable and Retry-After; a request the caller canceled keeps its own error.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…hunpike
The check compared only quic-go and tailscale.com, so a fork shunpike added later would not reach silo-server unnoticed. It now also compares every versioned replace in shunpike's go.mod, refuses a replace of shunpike itself, and decodes only stdout from go mod download, since the go command can print notes on stderr.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ettings read
With several API replicas each answers with its own process's readiness under the same api host, and the response does not yet identify the replica.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The reason will be displayed to describe this comment to others. Learn more.
STUN hostnames are assumed to measure both IP families
A successful probe against a single-family STUN hostname can incorrectly report the other family as off/not_available even though it was not probed. Determine measured families from resolved addresses that were actually attempted.
Prompt for LLM
File internal/directconn/features.go, lines 200-203:
STUN hostnames are assumed to measure both IP families
An IPv4-only STUN hostname is treated as measuring IPv6, so a successful IPv4 probe reports IPv6 as `off/not_available` even though no IPv6 probe was possible; the reverse occurs for an IPv6-only hostname. Determine measured families from the resolved and actually attempted server addresses rather than assuming every hostname supports both.
The reason will be displayed to describe this comment to others. Learn more.
🤖 Claude Code (claude-opus-5-5)
Right: d900330 covers IP literals only. A host name with records in one family still counts for both, so an IPv4-only name leaves IPv6 reported off/not_available without a probe. Silo can't tell which families the prober attempted, because shunpike's NATReport doesn't say, and resolving the names again here would add DNS lookups that can disagree with the prober's. The fix belongs in shunpike: per-family attempt flags on NATReport, which features.go would then read in place of stunFamilies. Both default servers publish IPv4 and IPv6 addresses, so the gap needs an administrator-set single-family name. I've left this open for the engine pull request.
The reason will be displayed to describe this comment to others. Learn more.
The finding is valid: a hostname with only one address family can cause the other family to be reported as off/not_available without being probed.
The proposed fix is to have shunpike’s NATReport record which families were actually attempted, then use those flags in features.go. Resolving the hostname separately in Silo could produce results that differ from the probe.
Because the fix is deferred to the engine pull request, it may be worth tracking as an issue. Would you like me to create one?
The section sat between the providers introduction, which ends "install one from the Plugins page and it appears here", and the providers list, so "here" pointed at the wrong thing and the list moved below a long readiness report. It now follows the providers.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
A host tuning label runs two lines, the plain name and the environment variable, and the default and allowed lines started below both, leaving a blank line under the effective value. The label now spans both rows so the details sit directly under the value; other rows keep their full-width details.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Keep the web catalog on silo-translations 2026.11.22-e656ecc, which carries main's keys and this pull request's, and regenerate the locale files from it.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
enhancementNew feature or requestgoPull requests that update go codepriority: P2Limited scope, workaround exists, or polishsize/XXXL3000+ added + deleted lines (all files); change volume, not priority.
2 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Related issue: #4440
Validation tasks: none
Other clients: Apple Silo-Server/silo-apple#1248 (native client support for the direct path, which a later pull request of this feature adds; this one changes only the admin readiness view); Android Silo-Server/silo-android#1028 (same); Roku N/A (the connection-path setting that a later pull request adds lists no Roku platform, and silo-roku's spec records that a Roku cannot join a tailnet)
Native clients reach Silo over TCP. On a long or lossy link that route recovers slowly from loss, and a client has no other route. #4440, from the proposal in #4436, adds a direct UDP path between native clients and the API host. Before any of that can run, an administrator needs to know whether the server host can accept it: whether it can map a NAT port, use IPv4 and IPv6, open a port, and size its socket buffers. This change adds that readiness check and shows its result in the Network Access admin page. It starts no engine and opens no playback path. It is the first of three pull requests, and the next one starts the engine behind a Redis lease.
Approach
Settings. Three admin settings:
direct_connections.enabled(defaultfalse),direct_connections.port_mapping(defaulttrue) anddirect_connections.stun_servers(default Cloudflare's and Google's STUN servers; at most eighthost:portentries, each validated). While the feature is off, no STUN or port-mapping probe runs, and the local socket reads send no packets. There is no settings-page field to turn the feature on: the Direct Connections section appears on Network Access once an administrator setsdirect_connections.enabledtotruethrough the admin settings API. Backups treat all three settings as server-specific, so a restore onto another server does not carry them.The check. The API and integrated modes run one check at startup and run it again when the effective settings change. A settings save rereads settings in the background, so a slow read never holds the save's response. Callers share a check that is already running, a caller that stops waiting does not cancel it, and a check and the settings read that starts it each have a 15-second bound. A status read rereads settings in the background after a failed read, or once the last read is a minute old, so a settings-change event this process missed still reaches the status. The check reports the direct path, NAT mapping, IPv4, IPv6, port mapping, socket buffers, GSO, GRO, path MTU fallback and the
CAP_NET_ADMINcapability. An address family that no configured STUN server can answer in (a list of IPv4 literals tests no IPv6) is reported as not measured. NAT hairpin and reachability are reported as not measured. On Linux the kernel doubles a socket buffer when it grants one, so the status and the logs report the usable size, half the readback.Two admin operations.
GET /api/v2/admin/direct-connections/statusreturns the API host's features, startup tuning values and, once bound, the API, Jellyfin and Audiobookshelf listener results.?refresh=truestarts a check or joins the one in flight. A settings read that fails or runs out of time answers503 dependency_unavailable.GET /api/v2/admin/direct-connections/capabilitiesreports whether status reads and refreshes are supported. Both are for the acting administrator only. The API contract diff reports two additive changes. Each API process keeps its own result: with several API replicas, the one that answers reports itself under theapihost, and the response does not yet name the replica.The admin section. Network Access shows the features, listeners and tuning values in plain language, below the network access providers, and polls the last completed check every 15 seconds while the page is visible. A Run check button starts a new check, and an advanced part saves the port-mapping and STUN settings. A late response is refused after a profile token change.
Modules. The engine is a separate Go module,
github.com/Silo-Server/shunpike, BSD-3-Clause. It builds against two forks of third-party modules that the Silo-Server organization also maintains: quic-go (MIT upstream) atv0.64.1-shunpike.2, which changes congestion control and path recovery, and Tailscale (BSD-3-Clause upstream) atv1.104.2-shunpike.2, which changes magicsock and DERP signaling.go.modrequires shunpikev0.1.2and replaces the two modules by tagged version. Go ignores a dependency'sreplacelines, sogo.modrepeats them, andmake verify-fork-pinsfails when any versionedreplacein shunpike'sgo.modis missing here or differs, or whengo.modreplaces shunpike itself. CI runs it beside thego mod tidycheck.THIRD_PARTY_NOTICES.mdrecords the notices.The commit that links the modules also raises quic-go to the v0.64.1 line and webtransport-go to v0.13.0, and the WebTransport compatibility shim follows upstream's rename of
DialertoTransport. Upstream Tailscale's requirements raise the AWS SDK,miekg/dns,gorilla/websocket,prometheus/client_modelandgolang.org/x/time, and addtailscale.comwith its netlink and UPnP dependencies.Docs:
docs/direct-connections-api.mdanddocs/architecture/direct-connections.mdare new, anddocs/architecture/observability.mdlists the newdirectconnlog component.docs/architecture/tcp-congestion.mdnow says the send-buffer log reports half the readback.The section's text comes from keys under
web.admin.settings.network.direct.*in Silo-Server/silo-translations#142, which merged with its translations..silo-translationspins release2026.11.22-e656ecc.Validation
direct_connections.*values), the route manifest (the two routes were missing), and the send-buffer result (the raw doubled readback). The review fixes each have a test that failed before its fix: the minute-old settings reread, the address family a literal-only STUN list can't measure, the503on a failed settings read, and the fork-pin checker accepting an extra fork or a shunpikereplace. The new package's tests and the web section and hook tests test code the base doesn't have.make verify-fork-pins(Fork pins match github.com/Silo-Server/[email protected]),go mod tidy -diff, the contract checks, the web type check, and the web tests.422, and normalized a mixed list.Evidence
Evidence: https://evidence.siloserver.org/r/silo-server/pr-5047/
Surface and build: Admin, Network Access, at desktop, tablet and phone widths, feature off and on. The page names the sandbox build, quotes the status responses and packet captures, and links the tests' runs on the base.
Risks
zishang520/webtransport-go, an indirect dependency of the Socket.IO libraries, now builds against the quic-go fork. Its only code change is the rename, and the Audiobookshelf socket opens no WebTransport listener.v1.5.3to an untagged commit. One visible change: a request to the Jellyfin/socketthat isn't a WebSocket upgrade now gets426 Upgrade Requiredinstead of400.apihost, so the page can show whichever replica answered. The engine pull request needs to settle which replica's readiness the page shows.Checklist
Council review
Rounds: 1, last reviewed 9bfc766 (maintainer review)
Visual review: 2 rounds, captures from 6108b8f
Fixed: the save path's synchronous settings reread, the unmeasured address family, the
500on a failed settings read, the fork-pin checker's gaps, the per-replica docs, the section's place on the page, and the gap in the host tuning rows. Answered: the closed response enums (a contract-checker gap that predates this pull request, addressed in #5095), refresh onGET(existing v2 precedent), logging under the status lock, and the self-check's size. Open for the maintainers: the visual design points that come from shared settings components (heading scale, field widths, disclosure style) and a readiness summary.AI Disclosure
claude-opus-5-5,claude-sonnet-5-5(Claude Code);gpt-6.1-sol(Codex CLI)claude-opus-5-5in Claude Code,gpt-6.1-solin Codex CLI) read the three pull requests of this feature in one round, and aclaude-sonnet-5-5seat merged their findings. For this pull request they checked the module and license changes against the published modules. They found one Medium defect:THIRD_PARTY_NOTICES.mdlacked shunpike's own license, was missing 14 modules from the notice block, and named the wrong owner for the forks. It was fixed, and a separateclaude-sonnet-5-5seat checked the fix.claude-opus-5-5) moved the modules to the Silo-Server organization, merged main, and added the review fixes listed in Council review.Note
Add direct-connections status self-check and admin status UI
directconn.Servicethat reads the direct-connections admin settings, runs NAT, port-mapping, and local-capability probes, and publishes a status snapshot with feature, listener, and tuning rows (selfcheck.go, features.go).GET /api/v2/admin/direct-connections/statusand a capabilities route in direct_connections.go, rendered in the admin network settings page by DirectConnectionsSection.tsx.make verify-fork-pins.tcpcongestionsend-buffer results now report half of the LinuxSO_SNDBUFreadback as the usable grant (buffers.go); log records gain adirectconncomponent with deduplicated feature rows. Also adds locale entries across all catalogs.Macroscope summarized 6086ee0.