registry-server
This page shows how to wire a project to a self-hosted registry server. It is optional. The static registry works without it.
What you get
The server adds what a static index cannot do: percentage rollouts, a kill switch that works on the next request, scoped tokens and an audit log. This feature does not run the server. It sets up the project side.
- Two runtime config keys,
registryUrlsandregistryBeacon, both off until you fill them in. src/registry-sources.tsin the shell, which adds the browser id and starts the beacon.docs/registry-server.md, a guide with your server address in it.- Scripts
server:deploy,server:rollbackandserver:status. - With
ci-github, adeploy-server.ymlworkflow that deploys every remote on a push to main.
When to use it
Use it when you want to roll a release out to a share of visitors, or take a remote out of the page in seconds. If a rollback by pointer is enough, stay on the static registry.
Add it
Add it with the address of your server, or leave the option empty and set it later:
What changed:
Use it
Set the index address for production and turn the beacon on:
Then call the helper in the shell's bootstrap instead of the plain one:
Deploy with the token in the environment:
You should see Rollout started: catalog@... is at 10%. The token is read only from MFEFLOW_REGISTRY_TOKEN. There is no flag for it.
Configure
How it works
The shell asks the server for the index with ?u=<browser id>. The server hashes the id to decide whether that browser gets the candidate or the stable version. The beacon reports loads and errors back, which feeds the gate. The second URL in registryUrls is the static fallback the server keeps up to date.
Gotchas
- The beacon stores a random id in
localStorage. Check your privacy rules before you turn it on. - Plain http works only for localhost, for the server address and for the token.
- The workflow needs a
registryenvironment with the token as a secret. Withoutci-githubno workflow is written.
Reference
See Run the registry server, Registry server SLOs and the server README.