Skip to content

server: serve Go and sccache on organization hosts - #43

Merged
Uzaaft merged 1 commit into
masterfrom
org-host/go-sccache
Nov 18, 2026
Merged

Uzaaft merged 1 commit into
masterfrom
org-host/go-sccache

Conversation

@Uzaaft

@Uzaaft Uzaaft commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

First of three stacked PRs for Polymath-AS/snowstead-service#20.

Serves Go and sccache at <org>.<suffix>/<cache>/<product> on organization hosts. The /_api/v1/<product>/<org>/<cache> addresses keep working and read the same entries.

  • New outer routes dispatch into a router holding only the Go and sccache protocol routes; management and upload routes stay unreachable from an organization host.
  • On other hosts the same path shape is still a path-based Nix read, so caches named go or sccache are unaffected (covered by tests, no new reserved names).
  • tests/org_host.rs covers auth, cross-organization isolation, method and path edge cases, and no-store on every response. test/compiler.mjs runs real go and sccache clients against both addresses.

Behavior changes: on an organization host, product-shaped paths now return the protocol's JSON 404/405 where the Nix read returned 405; matching requests get new route labels in metrics.

pnpm check passes.

An organization host answered every request as a Nix read, so the Go
and sccache caches were reachable only under /_api/v1/<product>/<org>/
<cache> on the shared host. Customers should configure one address
shape, <org>.<suffix>/<cache>/<product>.

The cache router now registers /{cache}/go and /{cache}/sccache with
their trailing forms. On an organization host their handler rewrites
the path to the canonical protocol route and dispatches it into a
router holding only the Go and sccache routes, so authorization, limits,
and storage are the existing handlers' and management or upload routes
stay unreachable from an organization host. On any other host the same
shape remains a path-based Nix read, which keeps caches named go or
sccache working. PROPFIND answers with the path the client used.

Two things change shape. On an organization host, a product path with a
method the protocol rejects now gets the protocol's JSON 404 or 405
instead of the Nix read's 405. Requests matching the new routes are
labelled with them in metrics rather than as cache reads.
@Uzaaft
Uzaaft merged commit 3b70f44 into master Nov 18, 2026
1 check passed
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