Registry sources
Status: approved 2026-11-15 (Kevin). Phase 1 shipped in 0.1.5; phases 2 and 3 are built (Unreleased). How to use them: registry.md and Mirroring.
Large organizations (universities, cities, agencies) want the public registry on spillwaycms.com and a registry of their own at the same time: modules, kits and themes they write for their sites, next to what everyone can install. Until now an instance read one registry (REGISTRY_URL), so pointing at an internal one meant losing the public one.
Today
- One index per instance:
REGISTRY_URL(defaulthttps://spillwaycms.com/registry/v1/index.json) andREGISTRY_PUBLIC_KEYfor its ed25519 signature (the public registry's key is built in). - An organization can already run a registry: a static signed index on any web server (registry.md), or a Spillway instance with
REGISTRY_HOST=1. It can also upload a module archive by hand. - Modules, kits, themes and brand kits all come from that one index: System → Modules → Install from registry, Kits → Install from registry, Updates, the MCP module tools and kit dependencies.
The design
An instance reads an ordered list of registry sources. Each source is a signed index with its own key, a name people see, and optionally the scopes it owns.
REGISTRY_SOURCES='[{"id":"acme","label":"Acme internal","url":"https://registry.acme.edu/registry/v1/index.json","publicKey":"<base64 key>","scopes":["@acme"]}]'
- The public registry (
REGISTRY_URL, with its key) stays a source, after the ones inREGISTRY_SOURCES.REGISTRY_URL=offleaves it out. - Scopes stop look-alike packages. A source that owns
@acmeis the only place@acme/*packages come from, and it serves nothing else. A public package named@acme/formsis never installed in its place, and no two sources may own the same scope. - Unscoped names come from the first source without scopes that lists them, in order. A name listed by two such sources resolves to the first, and the others' copies are ignored.
- Every package says where it came from. Install from registry, Kits → Install from registry and the MCP tools show the source's name beside each package when there is more than one source; installs record it in the audit log.
- Updates check each package against the source it resolves to, so an internal module is updated from the internal registry.
- One source down is not an outage. If an index cannot be read, the others still list and install; the source shows its error in System → Modules → Registries. Only when every source fails is the registry reported unavailable.
- Signatures, sizes, checksums, redirects and the SSRF guard apply to every source exactly as to the single registry today: a tarball is checked against the sha256 in its own source's signed index before it is opened.
Phases
- Sources and scopes (built first):
REGISTRY_SOURCES,REGISTRY_URL=off, scope ownership, merged listings with the source's name, installs and updates through the owning source, and a read-only Registries list in System → Modules → Install from registry (name, address, signed or not, scopes, whether it answered). - Trust per source. Each source says which module tiers it may supply (for example, trusted modules only from the internal source, sandboxed modules from the public one), and a locked-down mode that installs only from named sources. Editing the list in the admin, kept in instance settings and audited, for instance administrators only.
- Mirroring.
spillway registry mirror --from <source> <name>[@version]...copies chosen packages, with their tarballs, into a registry of your own and signs it, for organizations that vet every package or run without internet access.
As built (phases 2 and 3)
suppliesper source:sandboxed,trusted,kit,theme,brand,components(all six when left out);REGISTRY_URL_SUPPLIESor the admin setting for theREGISTRY_URLsource. A withheld package's name does not fall through to a later source.- Locked-down mode:
REGISTRY_LOCKDOWNor the admin setting; sources not named are not read at all. - System → Modules → Registries, for administrators from a global role: sources kept in instance settings (migration 0094,
registry_setting), signed and https only, the key's fingerprint shown after a check and confirmed with the save, every change audited. Order:REGISTRY_SOURCES, then the settings, thenREGISTRY_URL; the environment's ids, scopes, lockdown and trust win. Other processes pick a change up within 15 seconds. spillway registry mirror --from <source> <name>[@version]... --out DIR --key <private.pem>: a signed static folder, re-runs incremental, versions immutable, served as files, read withfile:or by a registry host withREGISTRY_MIRROR_DIR.- MCP:
list_registriesreads; no tool changes the sources.
Private namespaces on the hosted registry (an organization's @acme/* packages visible only to its hosted sites, with no registry to run) are a hosting feature, planned in the private hosting repository.
Decisions
- Configuration first, admin editing in phase 2. Adding a registry adds a supplier of code that can run on the server, so in phase 1 only whoever runs the instance (its environment) can add one.
- Scopes over priority alone. Ordering alone would let a public package shadow an internal one whose name it copies; scope ownership closes that.
- The public registry stays last. Internal sources come first, so an organization's unscoped packages win over public ones of the same name.
Spillway 0.1.24