Sindri
Sindri is an artifact repository for OCI images, Python packages, and npm packages, shipped as one Go binary. An artifact keeps one identity as it matures: it is not copied from repository to repository, its approval for each environment changes. CI and Kubernetes can ask whether exactly this artifact is approved for this environment.
These pages are built from the docs/ directory of
the repository, so they are versioned and reviewed
with the code they describe.
- Quickstart: a registry with a web UI on one machine, in about two minutes.
- pip and twine, and npm, pnpm, and yarn: pointing your clients at Sindri.
- Deploying: Docker Compose, Kubernetes with Helm, and TLS behind a reverse proxy.
- Operating Sindri: backup and restore, garbage collection, metrics and alerts, and sizing.
- Configuration reference: every key
sindri.yamlaccepts, in short and long form. - Upgrading: what happens on startup, the behaviour changes in each release, and how to roll back.
- Architecture decision records: why Sindri is built the way it is, and what was rejected.
The design is in ARCHITECTURE.md, and what comes next is in roadmap.md.
Quickstart
A registry with a web UI on one machine, in about two minutes, with nothing installed but Docker for the image steps. You push an image, sign in, and look at it. The npm steps also publish and install a package, and those need Node.js and npm on your machine; without them the script skips the npm steps and says so.
This setup is for trying Sindri out. Its identity provider signs in anyone who opens a browser on this machine, as an administrator. For a real deployment, see Going further.
1. Save the Compose file
Save this as compose.yaml in an empty directory. It is the same file as
deploy/quickstart/compose.yaml, so
curl -fsSLO https://raw.githubusercontent.com/SPJDevOps/sindri/main/deploy/quickstart/compose.yaml
fetches it too.
It runs three containers:
- Postgres for metadata.
- Dex, a development identity provider whose mock connector signs everyone in as one example user.
- Sindri itself, storing blobs in a named volume.
# Sindri quickstart: a registry with a web UI on one machine, nothing to
# install but Docker. docs/quickstart.md walks through it.
#
# export SINDRI_TOKEN=$(openssl rand -hex 16)
# docker compose up -d --wait
#
# DEVELOPMENT ONLY. Dex here signs in anyone who opens the browser as an
# example user in the `authors` group, and `authors` administer this server.
# The database password is in this file. Never deploy this as it is: point
# auth.oidc at your identity provider and the database at a managed Postgres.
name: sindri-quickstart
services:
postgres:
image: postgres:18-alpine@sha256:123b17998ccaf47e53b502e8c6a1e79afd8f579c6f3eec83c563da026f957395
environment:
POSTGRES_USER: sindri
POSTGRES_PASSWORD: sindri
POSTGRES_DB: sindri
volumes:
- postgres:/var/lib/postgresql
healthcheck:
test: ["CMD-SHELL", "pg_isready -U sindri -d sindri"]
interval: 2s
timeout: 5s
retries: 30
# The identity provider for the UI. Its mock connector signs everyone in as
# one example user, with no password, which is what makes this a demo.
dex:
image: ghcr.io/dexidp/dex:v2.46.1@sha256:65b72ca0f4b0bf6d4ada84ec21da8851782563404ac7b8f926923d27ceced9ab
command: ["dex", "serve", "/etc/dex/config.yaml"]
configs:
- source: dex
target: /etc/dex/config.yaml
# Sindri shares this network namespace, so it reaches Dex at the same
# http://localhost:5556 the browser uses, and the token issuer matches.
ports:
- "127.0.0.1:8080:8080"
- "127.0.0.1:5556:5556"
sindri:
# To scan what you publish, use the image that includes Trivy and
# uncomment `scanning:` in the configuration below:
# export SINDRI_IMAGE=ghcr.io/spjdevops/sindri:latest-trivy
image: ${SINDRI_IMAGE:-ghcr.io/spjdevops/sindri:latest}
network_mode: "service:dex"
depends_on:
postgres:
condition: service_healthy
dex:
condition: service_started
environment:
SINDRI_TOKEN: ${SINDRI_TOKEN:?export SINDRI_TOKEN first, for example SINDRI_TOKEN=$(openssl rand -hex 16)}
configs:
- source: sindri
target: /etc/sindri/sindri.yaml
volumes:
- blobs:/var/lib/sindri
healthcheck:
test: ["CMD", "/usr/local/bin/sindri", "probe", "http://127.0.0.1:8080/readyz"]
interval: 2s
timeout: 5s
retries: 30
configs:
sindri:
content: |
listen: :8080
storage: /var/lib/sindri
database: postgres://sindri:sindri@postgres:5432/sindri?sslmode=disable
# npm packuments carry absolute tarball URLs, so a server with an npm
# repository must know the address its clients use.
publicUrl: http://localhost:8080
auth:
# The bootstrap administrator token: docker login and npm use it below.
static_token: $${SINDRI_TOKEN}
admins: [authors]
oidc:
issuer: http://localhost:5556/dex
clientId: sindri
clientSecret: quickstart-not-a-secret
redirectUrl: http://localhost:8080/auth/callback
scopes: [openid, profile, email, groups]
# Opt-in vulnerability scanning of hosted publishes. It needs the
# `-trivy` image (see SINDRI_IMAGE above) and downloads Trivy's database
# from the internet on first use.
# scanning:
# enabled: true
repos:
# A hosted npm repository. Container images need no declaration here:
# docker push creates its repository.
js: { protocol: npm }
dex:
content: |
issuer: http://localhost:5556/dex
storage:
type: memory
web:
http: 0.0.0.0:5556
oauth2:
skipApprovalScreen: true
staticClients:
- id: sindri
name: Sindri
secret: quickstart-not-a-secret
redirectURIs: ["http://localhost:8080/auth/callback"]
connectors:
- type: mockCallback
id: mock
name: Example user
volumes:
postgres:
blobs:
2. Start it, push an image, publish a package, open the UI
export SINDRI_TOKEN=$(openssl rand -hex 16)
docker compose up -d --wait
echo "$SINDRI_TOKEN" | docker login localhost:8080 -u admin --password-stdin
docker pull alpine:3.20
docker tag alpine:3.20 localhost:8080/demo/app:1.0
docker push localhost:8080/demo/app:1.0
# Publish an npm package to the hosted repository `js`, then install it from
# another directory. This needs npm; without it, these steps are skipped.
# The token is keyed to the repository's own path.
if command -v npm >/dev/null 2>&1; then
mkdir js-demo js-app
cat > js-demo/package.json <<'EOF'
{ "name": "@demo/hello", "version": "1.0.0", "main": "index.js", "license": "MIT" }
EOF
echo "module.exports = 'hello from sindri';" > js-demo/index.js
for dir in js-demo js-app; do
printf 'registry=http://localhost:8080/npm/js/\n//localhost:8080/npm/js/:_authToken=%s\n' "$SINDRI_TOKEN" > "$dir/.npmrc"
done
(cd js-demo && npm publish --access public)
(cd js-app && npm install @demo/hello)
else
echo "npm is not installed: skipping the npm steps"
fi
open http://localhost:8080/ui/
SINDRI_TOKEN is the bootstrap administrator credential: docker login uses
it as the password, and the .npmrc files carry it as npm’s auth token. The
npm steps run only if npm is on your PATH, so Node.js and npm are the one thing
here that is not Docker. On Linux, use xdg-open instead of open, or paste the
URL into a browser.
The browser goes through Dex and back, and lands on the repository list
signed in as the example user. Open demo/app, then tag 1.0, to see the
artifact page: digest, owner, provenance, the manifest and its layers, and its
state in each lifecycle stage.
The compose file declares js under repos: and sets publicUrl. npm
packuments carry absolute tarball URLs, so Sindri refuses to start with an npm
repository and no publicUrl. Both keys, and every other one, are in the
configuration reference. To install from npmjs through
Sindri as well, add a proxy and a virtual repository; see
Using Sindri as an npm registry.
3. Stop it
docker compose down # keeps the data volumes
docker compose down -v # deletes them too
Going further
- Configuration as code. Repositories, access, and lifecycle stages
belong in
sindri.yaml, reconciled on every start. See ARCHITECTURE.md section 8, and every key is in the configuration reference. - Your identity provider. Point
auth.oidcat it and setauth.adminsto a group of yours. Then people use their ID token as the password for docker, pip, twine, and npm. See ADR 18. - More repositories. Add a proxy of registry.npmjs.org and a virtual
repository in front of
js, as the README shows, and the same for pip. - Storage.
storage: s3://bucket/prefixuses any S3-compatible store. - Garbage collection.
sindri gc --dry-runlists what nothing references any more. See ADR 19. - Upgrading is replacing the image. Migrations apply on startup and stay compatible with the previous release. See upgrading.
Using Sindri as a pip index
Sindri is usable as a private Python index today, for both publishing and installing.
Starting from the quickstart, declare a repository once, in the configuration
file or through the API. PyPI repositories are never auto-created, so a typo in a
--repository-url fails loudly instead of silently creating a second index:
curl -fsS -X POST localhost:8080/api/v1/repositories \
-H "Authorization: Bearer $SINDRI_TOKEN" \
-H 'Content-Type: application/json' \
-d '{"name":"internal","type":"hosted","protocol":"pypi"}'
Publish with twine, and install with pip:
python -m twine upload \
--repository-url http://127.0.0.1:8080/pypi/internal/upload \
-u token -p "$SINDRI_TOKEN" dist/*
pip install --index-url "http://token:$SINDRI_TOKEN@127.0.0.1:8080/pypi/internal/simple/" \
--trusted-host 127.0.0.1:8080 your-package
Or run scripts/pypi-twine-gate.sh, which does all of the
above against a checked-in sample package.
To avoid repeating the URLs, ~/.pypirc:
[distutils]
index-servers = sindri
[sindri]
repository = http://127.0.0.1:8080/pypi/internal/upload
username = token
password = <your token>
Worth knowing before you point real work at it:
- Every request authenticates, the index and downloads included. The username is ignored; the password is the token. Uploading needs the write role on the repository.
- Use one virtual index, not
--extra-index-url. With two indexes, pip chooses by version and not by trust. A virtual repository listing your hosted repository before a pypi.org proxy never serves a name you publish from the proxy, whatever version the proxy offers. That is the dependency-confusion defence of invariant I5. - A published file is immutable. Re-uploading identical bytes is a no-op while the file exists; different bytes under a filename already published is a 409, because consumers pin the hash the index advertised. A deleted file’s name stays taken too: it is refused even with identical bytes. Bump the version to republish. See ADR 13.
- Wheels and sdists only (
.whl,.tar.gz,.tgz), and an upload must be self-consistent: the filename, the packaged metadata, and twine’s form fields have to agree on project and version. Build tools satisfy that; a hand-rolledcurl -Fmay not. - No yanking. Removing a file is a
DELETEon its management API path,/api/v1/repositories/{repo}/packages/{name}/versions/{version}/files/{filename}.
Using Sindri as an npm registry
Sindri serves npm at /npm/{repo}/, for publishing and installing, with npm, pnpm, and
yarn. Declare the repositories in the configuration file. npm packuments carry absolute
tarball URLs, so a server with an npm repository must be told its own address with
publicUrl, and refuses to load without it:
publicUrl: http://localhost:8080 # the origin your clients use
repos:
internal-js: { protocol: npm } # hosted
npm: { upstream: npm } # proxy of registry.npmjs.org
javascript: { members: [internal-js, npm] } # virtual
Point a project at a repository with a .npmrc, and keep the token out of the project:
put it in your user-level ~/.npmrc, under the repository’s own path. A host-level key
makes npm publish fail with ENEEDAUTH, and pnpm refuses to expand ${SINDRI_TOKEN}
in a credential from a project .npmrc. To publish to internal-js, the project’s
.npmrc names the registry:
registry=http://localhost:8080/npm/internal-js/
and ~/.npmrc carries the token:
//localhost:8080/npm/internal-js/:_authToken=${SINDRI_TOKEN}
npm publish --access public
To install through the virtual repository, name it instead, and add its token line:
registry=http://localhost:8080/npm/javascript/
//localhost:8080/npm/javascript/:_authToken=${SINDRI_TOKEN}
npm install
SINDRI_TOKEN is the bootstrap token, or any token with the right role; the real
deployment uses an identity provider’s ID token or a machine token, the same as for pip.
pnpm reads the same .npmrc. pnpm import turns npm’s package-lock.json into a
lockfile, and pnpm install --frozen-lockfile installs from it. Yarn 1 reads it too:
pnpm import
pnpm install --frozen-lockfile
yarn import
yarn install --frozen-lockfile
Yarn 4 reads .yarnrc.yml instead, and allows plain http only for hosts you list:
npmRegistryServer: "http://localhost:8080/npm/javascript/"
unsafeHttpWhitelist:
- localhost
npmAlwaysAuth: true
npmAuthToken: "${SINDRI_TOKEN}"
Yarn 4 keeps its default age gate (npmMinimalAgeGate, 1440 minutes): it holds back a
version published less than a day ago, judging by the time map in the packument. Sindri
serves that map, with each hosted version’s real publish time and, through a proxy,
npmjs’s own, so the gate works as it does against npmjs and needs no setting.
If your team publishes an internal package and installs it within a day, list your scope as pre-approved. Yarn then skips the age gate for those packages only, and keeps it for everything else:
npmPreapprovedPackages:
- "@acme/*"
Or run scripts/npm-gate.sh, which does all of the above against
the Compose stack.
Worth knowing before you point real work at it:
- Every request authenticates, packuments and tarballs included. Publishing needs the write role on the repository.
- Use one virtual repository, not two registries. A virtual repository listing your
hosted repository before the npmjs proxy never serves a name you publish from the proxy,
whatever version the proxy offers, and a hosted
@scope/nameclaims the whole scope. That is the dependency-confusion defence of invariant I5. See ADR 24. - A published version is immutable. Publishing the same version again is refused, and so is publishing a version you deleted, even with identical bytes. Bump the version.
- Files upstream drops disappear. Once npmjs stops listing a file, a proxy answers 404
for it at once, in a lockfile install too. It serves again if npmjs relists it, and the
row is removed after
worker.retention.proxyStaleAfter. OCI is outside this: a digest manifest and its layer blobs keep serving from placement after upstream drops them. A whole-package 404 moves a virtual repository’s walk on, so with[private-proxy, npm]a package removed from the private upstream can resolve from the public proxy; only a hosted claim protects a private name. - An upstream that refuses Sindri’s credential is a 502, not a 404, and fails a virtual repository’s walk; a cached copy still serves. See upgrading.
Signatures and SBOMs with cosign and oras
cosign, oras, Notation, and Trivy attach a signature or an SBOM to an image by pushing a
second manifest that names the image as its subject. They find it again through the OCI
referrers API, GET /v2/<name>/referrers/<digest>. Sindri serves that API for hosted
repositories from 1.5, so these tools work with their defaults.
The examples use the quickstart’s docker repository on plain HTTP,
hence --plain-http. Behind TLS, leave it out.
Attach and discover with oras
Any manifest can be a subject. This pushes a stand-in for an image, then attaches an SBOM to it:
echo 'hello' > hello.txt
oras push --plain-http -u token -p "$SINDRI_TOKEN" \
localhost:8080/docker/demo/app:1.0 hello.txt
echo '{"spdxVersion":"SPDX-2.3"}' > sbom.spdx.json
oras attach --plain-http -u token -p "$SINDRI_TOKEN" \
--artifact-type application/spdx+json \
localhost:8080/docker/demo/app:1.0 sbom.spdx.json:application/spdx+json
The :application/spdx+json after the file name is the layer’s media type. Give one:
without it oras labels the file as a container image layer, and Sindri then treats the
attachment as an image and scans it.
oras discover lists what refers to the image:
oras discover --plain-http -u token -p "$SINDRI_TOKEN" \
localhost:8080/docker/demo/app:1.0
Sign and verify with cosign
cosign 2 stores a signature as a referrer when asked to. This example signs with a local
key and stays out of the public transparency log so that it runs offline. For real use,
leave out --tlog-upload=false and --insecure-ignore-tlog.
cosign login localhost:8080 -u token -p "$SINDRI_TOKEN"
cosign generate-key-pair
DIGEST="$(oras resolve --plain-http -u token -p "$SINDRI_TOKEN" localhost:8080/docker/demo/app:1.0)"
COSIGN_EXPERIMENTAL=1 cosign sign --key cosign.key --tlog-upload=false \
--registry-referrers-mode=oci-1-1 -y "localhost:8080/docker/demo/app@$DIGEST"
cosign verify --key cosign.pub --insecure-ignore-tlog --experimental-oci11 \
"localhost:8080/docker/demo/app@$DIGEST"
The API itself
The answer is an OCI image index with one descriptor per referrer. It is empty, with
status 200, when nothing refers to the digest. artifactType filters the list:
curl -fsS -u "token:$SINDRI_TOKEN" \
"http://localhost:8080/v2/docker/demo/app/referrers/$DIGEST?artifactType=application/spdx%2Bjson"
A long list is paged with a Link header, as the tags list is.
What to know
- A referrer is not evidence. A lifecycle gate that requires a
signatureor ansbomreads only what was attached throughPOST /api/v1/subjects/{digest}/evidence. A cosign signature pushed as a referrer is discoverable by cosign and does not satisfy the gate. Sindri does not verify signatures yet. - Each repository has its own list. A list holds the referrers pushed to that repository and no others, even when another repository holds the same image.
- Hosted repositories only. A proxy repository answers with an empty list and does not ask its upstream. A virtual repository answers from its first hosted member that holds the image and that you may read.
- A referrer lives as long as its subject. Garbage collection keeps an untagged signature while a repository holds both it and the image it signs. It is collected with the image, or once you delete it from the repository.
- Signatures and SBOMs are not scanned on publish. That means a manifest that names a subject and has neither an image config nor an image layer. Anything that looks like an image is scanned, whether or not it names a subject. See Scanning.
- Pushed before 1.5? Manifests pushed to an older Sindri are not listed. Attach them again. See Upgrading.
Scanning and the severity gate
With scanning enabled, every hosted publish is scanned, and promotion is refused above a severity. The one exception is a signature or SBOM attached to an image as an OCI referrer, which is a document and not an image; see Signatures and SBOMs. This page turns that on, shows what a refusal looks like, and explains how to read the scan evidence behind it. It ends with how to run scanning on a server that cannot reach the internet.
The commands assume the setup from the quickstart: a server at
localhost:8080 and the bootstrap token in SINDRI_TOKEN.
Enable scanning
Scanning is off by default. It needs Trivy, which the -trivy release image ships. Use
ghcr.io/spjdevops/sindri:<version>-trivy (or latest-trivy) in place of the plain
image, and add this to sindri.yaml:
scanning:
enabled: true
For Docker Compose, set SINDRI_VERSION in .env to the -trivy tag and keep Trivy’s
cache on a volume. The Compose guide shows the volume. For
Kubernetes, set image.tag to the -trivy tag and config.scanning.enabled. The
Helm guide shows the values.
Each hosted publish then queues a scan job. The worker unpacks the image or package,
runs Trivy, and attaches two documents to the artifact as evidence: a CycloneDX sbom
and a Trivy scan report. The queue is the same one the garbage collector uses (see
ADR 20), so a scan that fails is retried
with backoff. A scan that can never succeed is not retried: an archive over
scanning.maxUnpackedBytes or with an unsafe path, an index with too many, no scannable, or
duplicate platforms, an index child of an unsupported type, and malformed job arguments all
fail on the first attempt, and last_error names the cause. Only two outcomes are skipped
rather than failed, because they are expected: a subject kind with nothing to scan, and a blob
the publishing repository does not hold. Every key under scanning is in the
configuration reference.
Turning scanning on does not scan what was published earlier. Those artifacts have no scan until something queues one, and what does depends on the protocol:
- OCI: pushing the same manifest again queues a scan.
- PyPI: uploading the identical file again queues a scan. A file that was deleted cannot be uploaded again, because a deleted filename is never reused.
- npm: nothing. Publishing a version again is refused, so an existing version cannot be scanned later. A new version is a new artifact and gets its own scan.
To scan what is already published, use the re-scan route.
Refuse promotion above a severity
A scan gate sets a severity ceiling for a stage. Declare it next to the stages:
lifecycle:
stages: [dev, prod]
gates:
prod:
- scan: {maxSeverity: high}
maxSeverity is a ceiling: critical, high, medium, or low. The ceiling
high allows findings rated high and lower, and refuses a critical one. The ceiling
low refuses everything rated medium or above. A finding that Trivy does not rate
(UNKNOWN) is refused at every ceiling, because the gate cannot tell it is safe.
The gate reads the newest scan that Sindri itself made, for each platform of the
subject. For an image index, every platform in the index must have a scan. A scan you
attach yourself, with POST /subjects/{digest}/evidence, still satisfies a presence gate
such as sbom, but the severity gate ignores it. Only the worker can mark evidence as
its own, so nobody who can publish can produce a clean scan.
ADR 29 and
ADR 30 give the reasoning.
To see it work, publish an old image and try to promote it. alpine:3.10 carries a
critical finding in Trivy’s database as this page was written:
echo "$SINDRI_TOKEN" | docker login localhost:8080 -u admin --password-stdin
docker pull alpine:3.10
docker tag alpine:3.10 localhost:8080/scan/old:1
docker push localhost:8080/scan/old:1
DIGEST=$(curl -fsSI -u "admin:$SINDRI_TOKEN" \
-H 'Accept: application/vnd.oci.image.manifest.v1+json, application/vnd.docker.distribution.manifest.v2+json' \
localhost:8080/v2/scan/old/manifests/1 \
| tr -d '\r' | awk -F': ' 'tolower($1)=="docker-content-digest" {print $2}')
echo "$DIGEST"
The scan runs in the background, so wait for the scan evidence to appear before you
promote. This polls for up to two minutes, longer than a small image needs once the
database is cached:
for _ in $(seq 1 60); do
n=$(curl -fsS -H "Authorization: Bearer $SINDRI_TOKEN" \
"localhost:8080/api/v1/subjects/$DIGEST/evidence" \
| jq '[.items[] | select(.type == "scan")] | length')
[ "$n" -gt 0 ] && break
sleep 2
done
echo "scans: $n"
A subject with no scan yet is refused, the same as one with a bad scan. Now promote:
curl -sS -X POST -H "Authorization: Bearer $SINDRI_TOKEN" \
-H 'Content-Type: application/json' \
-d '{"repository":"scan","stage":"prod","reason":"try the severity gate"}' \
"localhost:8080/api/v1/subjects/$DIGEST/promote" | jq .
The server answers 409 Conflict with code GATE_FAILED. The violations list names
each rule that failed, the platform when the subject has one, and the findings above the
ceiling:
{
"code": "GATE_FAILED",
"message": "promotion to prod refused: scan.max_severity=high: findings above the ceiling: CVE-2021-36159 CRITICAL",
"request_id": "c8b7cda5d42367d73f26d5e00778564b",
"violations": [
{
"rule": "scan.max_severity=high",
"findings": [{"id": "CVE-2021-36159", "severity": "CRITICAL"}]
}
]
}
The message names at most ten findings and then counts the rest; violations lists them
all. A subject with a platform that has findings also carries "platform": "linux/arm64"
(or whichever platform it is) on that violation. When the gate refuses for lack of
evidence instead, the violation has a reason and no findings:
reason | Cause |
|---|---|
no Sindri scan for sha256:... | The scan is queued, failed after its retries, or the artifact predates scanning. |
scan incomplete: no Sindri scan for platform linux/arm64 | One platform of an index has no scan: the job is still running, or it failed part way. |
scan incomplete: no Sindri scan for the index child without a platform | The same, for an index child that declares no platform. |
the Sindri scan <id> lists no vulnerabilities; it needs a new scan, ... | A scan written before the gate existed. Pushing it again (OCI) or uploading it again (PyPI) queues a new scan, and the re-scan route does it for any artifact, npm included. |
the Sindri scan <id> does not list the platforms of its index; it needs a new scan, ... | A scan of an index child written before the gate existed. The same applies. |
A refusal writes no event to the ledger. A promotion that passes records the ids of the
scan and presence evidence it evaluated, in evidence_ids on the event, so an audit can
show exactly which scan the decision rested on. Read them with
GET /api/v1/subjects/{digest}/events or GET /api/v1/audit. A later scan never rewrites
a decision that was already made.
Read the evidence
Evidence is listed per artifact. Each item carries the metadata the worker wrote:
curl -fsS -H "Authorization: Bearer $SINDRI_TOKEN" \
"localhost:8080/api/v1/subjects/$DIGEST/evidence" \
| jq '.items[] | select(.type == "scan") | {id, media_type, created_at, metadata}'
{
"id": "3670f7f3-ea62-491e-8398-4fe4cb6b44a8",
"media_type": "application/vnd.aquasec.trivy.report+json",
"created_at": "2026-11-11T09:41:07Z",
"metadata": {
"producer": "sindri",
"scanner": "trivy",
"scanner_version": "0.76.2",
"db_updated_at": "2026-11-10T18:34:12.5Z",
"severity_counts": {"CRITICAL": 1, "HIGH": 0, "MEDIUM": 0, "LOW": 0, "UNKNOWN": 0},
"vulnerabilities": [{"id": "CVE-2021-36159", "severity": "CRITICAL", "package": "apk-tools", "installed": "2.10.6-r0", "fixed": "2.10.7-r0"}],
"new_vulnerabilities": ["CVE-2021-36159"],
"coverage": "image"
}
}
| Key | Meaning |
|---|---|
producer | sindri on evidence the worker wrote. The severity gate reads only this. |
scanner, scanner_version | The scanner and its version. |
db_updated_at | When the vulnerability database the scan used was built. See Keep the database fresh. |
severity_counts | Findings per severity. |
vulnerabilities | Each finding as id, severity, and the package with its installed and fixed versions (fixed is empty when no fix exists), worst first. On scan rows only; the sbom row omits it. Scans written before re-scanning exist have only id and severity. |
new_vulnerabilities | The ids in this scan that the previous Sindri scan of the same subject and platform did not list. Absent on a first scan, and when the previous scan predates the vulnerabilities list (an older scan has no list to compare with). See Re-scanning. |
coverage | image for an OCI image, package for a wheel, sdist, or npm tarball. |
platform | The platform of an index child, such as linux/arm64. Absent on a single image. |
platforms | On an index child’s scan, every platform the job scanned. The gate requires a scan for each. |
The full report and the SBOM are the evidence documents themselves.
GET /api/v1/subjects/{digest}/evidence/{id} returns the bytes. The web UI shows the
same evidence on the artifact’s page. Each Sindri scan row there also shows its findings
per severity, worst first, and its platform, or “no findings”. A scan a client attached
shows no summary, because the page only repeats what Sindri itself found. Below the
evidence, a Vulnerabilities panel lists the findings of the newest Sindri scan of each
platform: id, severity, package, installed version, and fixed version. A finding the
previous scan did not list carries a new marker. The panel shows the first 500 findings
of a scan and says how many it left out; the full report is the evidence document.
Prometheus series describe the worker (see Operating Sindri):
sindri_scans_total{result} counts scan job attempts as succeeded, failed, or
skipped, and sindri_scan_duration_seconds times them. Both exist only while scanning
is on. sindri_queue_jobs{state="failed"} rises when a scan has used up its retries or failed
permanently.
That artifact then has no Sindri scan and a severity gate refuses it.
Re-scanning
A scan describes the vulnerabilities known on the day it ran. An approved artifact keeps running long after that, so Sindri scans it again. ADR 31 has the reasoning. In short:
- Only approved artifacts. Every subject with a current
approvedecision, in any stage, is scanned again. Artifacts nobody approved are not. - Daily by default.
scanning.rescanIntervalis24h. Set0sto turn the schedule off; the on-demand route below still works. Values under1mare refused. - The ledger does not change. A re-scan adds evidence and nothing else. It never revokes and never rewrites a decision already made.
- A new finding blocks the next promotion only. The severity gate reads the newest Sindri scan, so an artifact with a new CRITICAL finding cannot be promoted further, but where it already runs is untouched.
- Revoking is a person’s call. Sindri shows the finding, in the evidence, the Vulnerabilities panel, and a metric, and a person decides. It does not take production down over a CVE that may have no fix.
A scan reads the artifact from the lowest-named hosted repository that owns it and still holds it, so an artifact copied to another repository and deleted from the first is scanned from the other. An approved artifact no hosted repository holds is left out. Each re-scan is one Trivy run per approved artifact, so cost follows what is approved, not everything ever published.
Re-scan one artifact now
POST /api/v1/subjects/{digest}/scan queues a scan of one artifact. It needs write
access to a hosted repository that holds it. It answers 202 Accepted, and the same job
if a scan of that artifact is already queued or running. An administrator gets the full
job (attempts, last_error) and a Location header for GET /api/v1/jobs/{id}, which
only administrators may read. Anyone else gets only {"id", "kind", "state"} and no
Location. Errors:
| Status | Code | When |
|---|---|---|
| 404 | SUBJECT_NOT_FOUND | The caller cannot read the artifact. |
| 403 | FORBIDDEN | The caller can read it but not write it. |
| 409 | SCANNING_DISABLED | Scanning is off on this server. |
| 409 | NO_HOSTED_REPOSITORY | No hosted repository the caller may write holds the artifact. |
This block scans the image from the section above again, waits for the new scan, and
prints the ids that scan found and the previous one did not. It prints [] while the
database has not changed. After the vulnerability database is updated, a published CVE
shows up here:
BEFORE=$(curl -fsS -H "Authorization: Bearer $SINDRI_TOKEN" \
"localhost:8080/api/v1/subjects/$DIGEST/evidence" \
| jq '[.items[] | select(.type == "scan")] | length')
curl -fsS -X POST -H "Authorization: Bearer $SINDRI_TOKEN" \
"localhost:8080/api/v1/subjects/$DIGEST/scan" | jq -c '{id, kind, state}'
for _ in $(seq 1 60); do
EVIDENCE=$(curl -fsS -H "Authorization: Bearer $SINDRI_TOKEN" \
"localhost:8080/api/v1/subjects/$DIGEST/evidence")
n=$(echo "$EVIDENCE" | jq '[.items[] | select(.type == "scan")] | length')
[ "$n" -gt "$BEFORE" ] && break
sleep 2
done
echo "scans: $n"
echo "$EVIDENCE" | jq -c '[.items[] | select(.type == "scan" and .metadata.new_vulnerabilities != null)] | last | .metadata.new_vulnerabilities'
Watch for findings in approved artifacts
sindri_approved_findings{severity} is a gauge read at scrape time: the number of approved
artifacts whose newest Sindri scan lists at least one finding of that severity. All five
labels (CRITICAL, HIGH, MEDIUM, LOW, UNKNOWN) are always present. It exists only
while scanning is on. An alert for the one that matters:
- alert: SindriApprovedCriticalFinding
expr: sindri_approved_findings{severity="CRITICAL"} > 0
for: 1h
labels: {severity: warning}
The operations guide carries it in its starting set.
A gauge tells whoever looks at it. To have Sindri tell someone the moment a re-scan finds
something new in an approved artifact, configure a finding.new webhook; see
Notifications.
Size the cache
Trivy keeps its vulnerability database in scanning.cacheDir. The -trivy image sets
that to /var/cache/sindri/trivy. Scans also unpack each image or package into the same
volume, so size it for two things:
- The databases. The vulnerability database is about 130 MiB compressed and the Java database about 950 MiB compressed, both larger once unpacked. Trivy downloads the Java database only when a scan finds a jar.
- The largest thing you scan. Each scan unpacks the whole image. A volume smaller
than the largest image fails that scan, and the job is retried. For wheels and
tarballs,
scanning.maxUnpackedBytes(1 GiB by default) caps one archive.
Keep the cache on a volume that survives a restart, or Trivy downloads the database again
each time. Compose and Helm both give the cache a place; their guides show it.
scanning.timeout (ten minutes by default) cancels a scan that runs too long.
What scanning does not cover
- It is off by default. Nothing is scanned until you set
scanning.enabled. - Hosted repositories only. Content cached from an upstream through a proxy is never scanned. It has no subject of its own, and a proxy is a mirror of someone else’s artifacts (ADR 16, ADR 23).
- Coverage differs by protocol. An image scan covers the OS and language packages
installed in its layers. A wheel or npm tarball scan covers the package’s own name and
version and anything pinned inside the archive, such as a bundled
node_modules. It does not resolve the dependency ranges the package declares, so a clean scan of a wheel does not mean whatpip installfetches beside it is clean. Teams that need that scan their lockfile in CI and attach the result for presence gates. Generic files are not scanned. ADR 29 has the detail. - Only Sindri’s scans count. The severity gate ignores evidence a client attached.
- A missing scan refuses. A queued job, a failed job, or an artifact published before scanning was on has no Sindri scan, and the gate refuses it.
- A scan is a point in time. A vulnerability published tomorrow does not change
today’s scan or a decision made on it. Re-scanning scans approved
artifacts again on a schedule, and
POST /api/v1/subjects/{digest}/scanscans any one on demand, which is how to scan an npm version: npm will not accept the same version twice, so there is no other way to give it a newer database. Neither changes a decision already made.
Scan without internet access
Trivy fetches two databases from ghcr.io/aquasecurity: trivy-db for
vulnerabilities and trivy-java-db for the Maven index it uses to identify jars. Both
are ordinary OCI artifacts. An air-gapped install copies them into a registry it can
reach and points Sindri at the copy.
Mirror the databases
Run this on a machine that can reach both ghcr.io and your mirror. It uses
oras (the commands were run with oras 1.3.0) and any registry that
accepts OCI artifacts. For a first try, this starts a throwaway one:
docker run -d --name trivy-mirror -p 127.0.0.1:5001:5000 registry:3
export MIRROR=localhost:5001
The mirror listens on port 5001 because macOS uses 5000 for AirPlay Receiver.
For a real mirror, set MIRROR to your registry’s host, and log in with
oras login "$MIRROR" if it needs credentials. Then copy both databases. oras cp copies
the manifest and layers as they are, and the tag you give is the tag Trivy asks for:
oras cp --to-plain-http ghcr.io/aquasecurity/trivy-db:2 "$MIRROR/trivy/trivy-db:2"
oras cp --to-plain-http ghcr.io/aquasecurity/trivy-java-db:1 "$MIRROR/trivy/trivy-java-db:1"
Drop --to-plain-http for a mirror that serves HTTPS. Trivy reaches a mirror over HTTPS
unless its host is localhost, so a real mirror needs TLS. If its certificate comes from
a private CA, set SSL_CERT_FILE in the server’s environment to a bundle that holds the
CA; Sindri passes it on to Trivy.
Point Sindri at the copies. Give each as a full reference with its tag:
scanning:
enabled: true
dbRepository: mirror.example.com/trivy/trivy-db:2
javaDbRepository: mirror.example.com/trivy/trivy-java-db:1
With these set, Trivy asks only the mirror. It no longer falls back to the public
registries. Sindri passes the values to Trivy as --db-repository and
--java-db-repository, and Trivy reads any registry credentials from the server’s Docker config.
The mirror covers the two databases only. Sindri always passes --skip-version-check and
--disable-telemetry, so Trivy never checks check.trivy.dev for a newer version or sends
telemetry, but during a scan it can still look packages up. On a server that can reach the
mirror and nothing else, add offlineScan: true, which passes --offline-scan so Trivy
makes no request of its own:
scanning:
enabled: true
dbRepository: mirror.example.com/trivy/trivy-db:2
javaDbRepository: mirror.example.com/trivy/trivy-java-db:1
offlineScan: true
Keep the database fresh
Aquasec publishes a new vulnerability database regularly. The mirror holds the
copy you made, so it ages until you copy again. Run the two oras cp commands on a
schedule from a machine that sees both registries. A cron entry or a Kubernetes
CronJob that runs every six hours is enough. Sindri needs no restart: on its next scan Trivy
checks whether its cached database is due for an update, and if so downloads from the mirror.
Every scan records db_updated_at, the build time of the database it used, so a stale
mirror is visible on the artifacts it scanned. This prints the age in days of the newest
scan of one artifact:
curl -fsS -H "Authorization: Bearer $SINDRI_TOKEN" \
"localhost:8080/api/v1/subjects/$DIGEST/evidence" \
| jq -r '[.items[] | select(.type == "scan")] | sort_by(.created_at) | last
| .metadata.db_updated_at
| sub("\\.[0-9]+Z$"; "Z") | fromdateiso8601
| ((now - .) / 86400 | floor)
| "database is \(.) days old"'
Alert on that age from your own tooling. A scan made against a month-old database is still a valid scan, and the gate does not look at its age. It will pass an artifact whose newest vulnerabilities the database does not know yet.
Or pre-seed the cache
If you cannot run a registry, fill the cache directly and tell Trivy never to download.
On a machine with internet access, use the same Trivy version as the -trivy image
(0.76.2 at the time of writing; the version is in scanner_version on any scan):
mkdir -p trivy-cache
docker run --rm -v "$PWD/trivy-cache:/cache" aquasec/trivy:0.76.2 \
image --download-db-only --cache-dir /cache
docker run --rm -v "$PWD/trivy-cache:/cache" aquasec/trivy:0.76.2 \
image --download-java-db-only --cache-dir /cache
tar -C trivy-cache -czf trivy-cache.tar.gz .
Carry trivy-cache.tar.gz across the gap and unpack it into the cache directory the
server uses (/var/cache/sindri/trivy in the -trivy image). The server accepts only a
cache directory with mode 0700, owned by the user it runs as, which is uid 65532 in the
release image. With Docker, this fills a named volume that way:
docker volume create sindri-trivy-cache
docker run --rm -v sindri-trivy-cache:/cache -v "$PWD:/in:ro" alpine:3.20 sh -c \
'tar -xzf /in/trivy-cache.tar.gz -C /cache && chown -R 65532:65532 /cache && chmod 0700 /cache'
Mount that volume at /var/cache/sindri/trivy. Then set:
scanning:
enabled: true
skipDBUpdate: true
skipDBUpdate cannot be combined with dbRepository or javaDbRepository, and the
server refuses to start with both. With skipDBUpdate, offlineScan defaults to true,
so Sindri also passes --offline-scan, and Trivy makes no request of its own while
scanning. Write offlineScan: false to allow package lookups. Refresh the cache by repeating the steps. The Helm
chart’s scan cache is an emptyDir, which is empty again when the pod is replaced, so
use the mirror there.
Images with jars fail closed
Trivy loads the Java database only when a scan finds a jar. An air-gapped server with no Java database does not skip those files: the scan fails, retries, and runs out of attempts. That artifact has no Sindri scan, and a severity gate refuses it. This is the intended direction of failure, because a scan that quietly skipped the jars could report an image clean that is not.
It happens in two ways. With skipDBUpdate, the Java database is missing from the cache.
With a mirror, javaDbRepository is unset, so Trivy tries the public registries and
cannot reach them. Either way the fix is to supply the Java database. Watch for it in
sindri_queue_jobs{state="failed"} and in sindri_scans_total{result="failed"}.
Clean up
If you started the throwaway mirror above:
docker rm -f trivy-mirror
Notifications
Sindri can tell another system when something happens that a person should know about. It POSTs a signed JSON document, a webhook, to each URL you configure. Point it at a chat bridge, an incident tool, or a small service of your own.
Two events are sent:
| Event | Sent when |
|---|---|
finding.new | A scan finds a vulnerability that the previous scan of the same artifact did not have, and the artifact is approved at some stage. One event is sent for each repository that holds an approval of it. |
lifecycle.promoted | An artifact is promoted (approved) to a stage. |
finding.new is the one that matters most. A re-scan can find a new CVE in something that
is already running in production, and without a webhook nobody hears about it until they
look. A finding on an artifact that nobody approved is not sent: it is not running anywhere.
See Re-scanning for how re-scans run and what counts as new.
The design is recorded in ADR 34.
Configure a webhook
Webhooks are a server setting, in the notifications: section of the configuration file:
notifications:
webhooks:
- name: security-team
url: https://hooks.example.com/sindri
secret: ${SINDRI_WEBHOOK_SECRET}
events: [finding.new, lifecycle.promoted]
repositories: [docker, pypi] # optional; leave it out for every repository
timeout: 10s
maxAttempts: 8
secretsigns every delivery. It must be at least 32 bytes. Keep it out of the file with${VAR};openssl rand -hex 32makes a good one.urlmust be https, or http on a loopback address. It may not contain a user name or password. Sindri never prints more of it than the scheme and host, because webhook URLs often carry a token in the path.repositoriesfilters by the repository the event concerns: the repository a promotion was made in, or, for a finding, each repository where the artifact is approved. A digest that is inapp-stagingbut approved only inprodsends its finding forprodalone, so a webhook withrepositories: [prod]hears about it whichever repository the scan read the bytes from.
The full list of keys is in the configuration reference.
kill -HUP reloads the webhook list with the rest of the file. A webhook you remove stops
receiving: its queued deliveries are recorded as failed rather than sent.
What a delivery looks like
Each delivery is an HTTP POST with a JSON body and these headers:
| Header | Value |
|---|---|
Content-Type | application/json |
User-Agent | sindri/<version> |
X-Sindri-Event | finding.new or lifecycle.promoted |
X-Sindri-Delivery | The delivery id, the same as the body’s id |
X-Sindri-Timestamp | When this attempt was sent, in Unix seconds |
X-Sindri-Signature | sha256= and the hex HMAC-SHA256 of the timestamp, a ., and the body |
A finding.new body:
{
"id": "41",
"event": "finding.new",
"occurredAt": "2026-11-16T10:00:00Z",
"sindri": {"url": "https://sindri.example.com", "version": "1.6.0"},
"subject": {"digest": "sha256:9f86d0…", "repository": "docker"},
"data": {
"newVulnerabilities": ["CVE-2026-1234"],
"severityCounts": {"CRITICAL": 1, "HIGH": 3, "MEDIUM": 0, "LOW": 2, "UNKNOWN": 0},
"platform": "linux/amd64",
"approvedStages": ["prod"],
"evidenceId": "0b6f…"
}
}
severityCounts counts every finding in the new scan, not only the new ones. A
multi-platform image sends one delivery per platform that has something new, and an
artifact approved in several repositories sends each of those deliveries once per
repository; subject.repository names it and approvedStages lists the stages approved
in that repository.
A lifecycle.promoted body:
{
"id": "42",
"event": "lifecycle.promoted",
"occurredAt": "2026-11-16T10:05:00Z",
"sindri": {"url": "https://sindri.example.com", "version": "1.6.0"},
"subject": {"digest": "sha256:9f86d0…", "repository": "docker", "stage": "prod"},
"data": {
"actor": "alice@example.com",
"reason": "release 4.2",
"eventId": 17,
"evidenceIds": ["0b6f…"]
}
}
A body never carries a credential, a token, or the artifact itself. Look the artifact up by its digest in the UI or the API.
Verify the signature
Check the signature before you trust a delivery, and refuse one whose timestamp is more than a few minutes old so that a captured delivery cannot be replayed. Compute the HMAC over the raw body bytes exactly as received, not over JSON you have parsed and re-encoded.
In a shell, with the body saved to body.json:
expected="sha256=$(printf '%s.%s' "$TIMESTAMP" "$(cat body.json)" \
| openssl dgst -sha256 -hmac "$SINDRI_WEBHOOK_SECRET" -hex | sed 's/^.* //')"
[ "$expected" = "$SIGNATURE" ] && echo valid
In Go:
func verify(secret []byte, r *http.Request, body []byte) bool {
ts := r.Header.Get("X-Sindri-Timestamp")
sec, err := strconv.ParseInt(ts, 10, 64)
if err != nil || time.Since(time.Unix(sec, 0)).Abs() > 5*time.Minute {
return false
}
mac := hmac.New(sha256.New, secret)
mac.Write([]byte(ts + "."))
mac.Write(body)
want := "sha256=" + hex.EncodeToString(mac.Sum(nil))
return hmac.Equal([]byte(want), []byte(r.Header.Get("X-Sindri-Signature")))
}
Retries and failures
A delivery is a queue job, so a slow or broken receiver never slows Sindri down, and a restart loses nothing.
- A 2xx response means delivered.
- 408, 429, a 5xx, a timeout, or a network error is retried with exponential backoff,
up to
maxAttemptsattempts in all. After the last one the delivery is recorded as failed, including when a worker died on the last attempt. - Any other response, including a redirect, fails the delivery at once. Sindri does not follow redirects; point the webhook at the final URL.
The same event is never delivered twice to one webhook, even if the job that caused it is
retried. The same finding, meaning the same new IDs on the same platform of the same
artifact in the same repository, is sent once per webhook, even if it disappears from a
scan and later reappears. Receivers should still treat X-Sindri-Delivery as an idempotency key, because a
receiver that answers too slowly may be sent the same delivery again.
See what was sent
Administrators can see every webhook and its deliveries:
-
In the UI, the System page shows each webhook with its target host and the number of failed deliveries. The line at the top says whether any webhook is failing, which means its newest finished delivery failed, so a receiver that recovers clears it. It links to the delivery log: when each delivery was made, the response status, the attempts, the next retry, and the error. An artifact’s page lists the notifications sent about it.
-
In the API, these routes need an administrator:
Route Answers GET /api/v1/notifications/webhooksEach webhook: name, events, repositories, target host, failed deliveries, and whether it is failing GET /api/v1/notifications/deliveries?webhook=&state=&digest=&limit=The delivery log, newest first; stateispending,delivered, orfailedGET /api/v1/notifications/deliveries/{id}One delivery, with the body that was sent POST /api/v1/notifications/deliveries/{id}/redeliver202, and a new delivery with the same body and a new id Redelivering after you fix a receiver:
curl -fsS -X POST -H "Authorization: Bearer $TOKEN" \ "$SINDRI_URL/api/v1/notifications/deliveries/41/redeliver"A webhook that is no longer configured answers 409
WEBHOOK_NOT_CONFIGURED.
Two metrics count deliveries; see Operating Sindri:
sindri_webhook_deliveries_total{result} counts attempts that were delivered,
retried, or failed, and sindri_webhook_delivery_duration_seconds times them.
Configuration reference
Sindri reads one file, sindri.yaml. sindri serve --config <file> names it; with
no flag, serve reads ./sindri.yaml if it exists and runs on the defaults below if
it does not. A file you name that is missing is an error. An empty file means
“everything default”.
Check a file without a database or a server:
sindri config check -f sindri.yaml
sindri config show --expanded -f sindri.yaml
config show prints the server sections with every secret replaced by <redacted>.
--expanded also prints the repositories, lifecycle, and defaults as the long-form
documents the server acts on, with every preset, inference, and default written out.
The server settings tables are generated from the structs in internal/config by
make reference, and a test fails when the page and the code disagree. The tables for
repositories, lifecycle, defaults, and manifests are written by hand, and a test checks that they
list exactly the keys the loader accepts. Where the code sets a default, the page states
it; where it does not, the key is unset.
Rules that apply everywhere
- Unknown keys are an error. A typo fails at load instead of silently keeping a default.
- Environment references. Any string value may contain
${VAR}or${VAR:-default}.$$writes a literal dollar sign. Expansion happens on parsed values, so a password containing:or#cannot change the meaning of the file. An unset variable with no default is an error. - Durations are Go duration strings with a unit:
30s,5m,1h,168h. A bare number such as3600is rejected, because guessing a unit is how a five minute cache becomes a one hour one. Negative durations are rejected. - Short and long forms. Most sections accept a one-line short form and a mapping long form. They produce the same configuration; nothing downstream can tell which was written. The tables below give both.
- Secrets stay out of the database. The database holds the name of a credential, not its value.
Server settings
These keys configure the process. They have no manifest form: manifests describe
repositories and lifecycle, so listen, storage, database, log, auth, worker,
scanning, notifications, ui, credentials, and publicUrl appear in sindri.yaml only.
listen
The HTTP listener.
Short form: listen: :8080 is the same as listen: {address: ":8080"}.
| Key | Type | Meaning | Default |
|---|---|---|---|
address | string | Address the HTTP server binds. Must not be empty. | :8080 |
readHeaderTimeout | duration | How long a client may take to send request headers. | 10s |
shutdownTimeout | duration | How long shutdown waits for requests in flight. | 20s |
storage
Where blobs are written.
Short form: storage: ./data is the same as storage: {backend: filesystem, path: ./data}.
Short form: storage: s3://bucket/prefix is the same as storage: {backend: s3, bucket: bucket, prefix: prefix}.
| Key | Type | Meaning | Default |
|---|---|---|---|
backend | string | filesystem or s3. | filesystem |
path | string | Directory for blobs. Filesystem only, and required there. A relative path is resolved against the configuration file’s directory. | ./data |
bucket | string | Bucket name. S3 only, and required there. | unset |
prefix | string | Key prefix inside the bucket. S3 only. | unset |
region | string | S3 region. Compatible stores ignore it, but the SDK needs one. | us-east-1 on S3 |
endpoint | string | URL of an S3-compatible store such as MinIO. S3 only. Credentials written into the URL are redacted by config show. | unset, which is AWS |
pathStyle | boolean | Use path-style addressing, which most S3-compatible stores need. S3 only. | false |
accessKeyId | string | Static access key. Set it together with secretAccessKey, or leave both out to use the ambient AWS credential chain. | unset |
secretAccessKey | string | Static secret key. Redacted by config show. | unset |
sessionToken | string | Session token for temporary credentials. Redacted by config show. | unset |
Setting an S3-only key on the filesystem backend, or path on S3, is an error.
database
Postgres is the only supported store.
Short form: database: postgres://sindri.example.com/sindri is the same as database: {url: "postgres://sindri.example.com/sindri"}.
| Key | Type | Meaning | Default |
|---|---|---|---|
url | string | Connection URL. The scheme must be postgres or postgresql. The password is redacted in logs and by config show. The default is the development stack’s, with a development-only credential: never deploy it. | postgres://sindri:sindri@127.0.0.1:55432/sindri?sslmode=disable |
maxConns | integer | Pool size. At least 1. | 10 |
minConns | integer | Connections kept open. Between 0 and maxConns. | 0 |
connectTimeout | duration | How long to wait for a connection. | 10s |
log
The structured logger.
Short form: log: debug is the same as log: {level: debug}.
| Key | Type | Meaning | Default |
|---|---|---|---|
level | string | debug, info, warn, or error. | info |
format | string | json or text. | json |
auth
Every request authenticates; there is no anonymous access. See
ADR 18. Without oidc, only the bootstrap
token and machine tokens authenticate, and the web UI cannot sign anyone in. Note that
static_token is spelled with an underscore, unlike the camelCase keys around it.
Short form: auth: ${SINDRI_TOKEN} is the same as auth: {static_token: "${SINDRI_TOKEN}"}.
| Key | Type | Meaning | Default |
|---|---|---|---|
static_token | string | The bootstrap administrator credential: what sindri apply uses before an identity provider is configured, and the break-glass path after. Compared in constant time, never logged, and redacted by config show. The default logs a warning while it is in use. | sindri-dev-token |
admins | list of strings | Identity-provider groups whose members administer the server. Entries must not be empty. Membership is read from the caller’s token on each request and never stored. | unset |
oidc.issuer | string | The provider’s issuer URL. Required. Must be https, or http for a loopback address. | unset |
oidc.clientId | string | OAuth client id. Required. | unset |
oidc.clientSecret | string | OAuth client secret. Redacted by config show. | unset |
oidc.redirectUrl | string | The browser login callback, for example https://sindri.example.com/auth/callback. Setting it enables UI sign-in. Same scheme rule as issuer. The session cookie is Secure exactly when this is https. | unset |
oidc.groupsClaim | string | Token claim listing the caller’s groups. | groups |
oidc.usernameClaim | string | Token claim recorded as the actor in the audit ledger. | email |
oidc.scopes | list of strings | Scopes the browser login requests. Providers that release groups only on request, such as Dex, need groups added. | openid, profile, email |
publicUrl
npm packuments carry absolute tarball URLs, and a request’s Host header is not trusted
to build them (see ADR 24), so a server with an
npm repository needs to know its own origin. Sindri serves at the root of that origin.
Loading fails when an npm repository is declared, in the short or the long form, and
publicUrl is unset.
| Key | Type | Meaning | Default |
|---|---|---|---|
publicUrl | string | The origin clients reach this server at, for example https://sindri.example.com. Required when the file declares any npm repository. Must be https, or http for a loopback address, and an origin only: no credentials, path, query, or fragment. A trailing slash is removed. | unset |
credentials
Upstream secrets, which proxy repositories name by key. A map from a reference name to
a login. Reference names are lowercase letters, digits, -, and _, at most 63
characters, and may not start with - or _. Values are normally written as
${VAR}.
credentials:
dockerhub-login:
username: ${DOCKERHUB_USER}
password: ${DOCKERHUB_TOKEN}
| Key | Type | Meaning | Default |
|---|---|---|---|
<name>.username | string | Upstream user name. Redacted by config show. | unset |
<name>.password | string | Upstream password, sent as HTTP Basic with username. Set it, or token, never both. Redacted by config show. | unset |
<name>.token | string | Upstream token, sent as HTTP Bearer. Set it instead of username and password. An OCI proxy cannot use one. Redacted by config show. | unset |
A repository refers to a credential with upstream.credentials: <name>. Naming a
reference that is not defined here is refused when the repository is written. Reloading
the file with SIGHUP swaps the secrets atomically.
A proxy that has credentials fails a virtual repository’s walk when its upstream refuses them, instead of reading the refusal as “no such name”. See ADR 14.
A credential is either username and password (sent as HTTP Basic) or token (sent as
HTTP Bearer), never both. A private npm registry that wants a token takes the second form.
Both are sent only to the upstream’s own origin, with one exception (ADR 14): an OCI
proxy’s username and password also go to the registry’s token realm, but only over https
or on the upstream’s own origin. An OCI proxy cannot use a token, because
OCI registries exchange username and password at their token realm; naming one is refused
when the repository is written. See ADR 27.
credentials:
npm-private:
token: ${NPM_TOKEN}
worker
The background worker evicts stale proxy cache entries and abandoned uploads, and runs scheduled garbage collection. See ADR 20.
Short form: worker: false is the same as worker: {enabled: false}.
Short form: worker: true is the same as worker: {enabled: true}.
| Key | Type | Meaning | Default |
|---|---|---|---|
enabled | boolean | Run a worker inside serve. With it off, the server still enqueues work, such as sindri gc, for a worker elsewhere to claim. An absent enabled in the mapping means true. | true |
gc.interval | duration | How often to schedule garbage collection. Unset never schedules it: “untagged and unpromoted is garbage” is a policy to adopt after a dry run, not one to inherit by upgrading. sindri gc works either way. | unset |
gc.grace | duration | Blobs seen more recently than this are kept, whatever references them. | 24h |
retention.interval | duration | How often the cleanup jobs run. | 1h |
retention.uploadMaxIdle | duration | How long a staged upload may go unwritten before it is discarded. At least 1m. | 24h |
retention.proxyStaleAfter | duration | How long past its TTL a proxy cache entry is kept to serve through an upstream outage, before retention evicts it. Also how long a cached file that upstream no longer lists is kept before its row is removed. | 168h |
scanning
Vulnerability scanning is off by default. When it is on, the worker scans hosted
publishes only; proxied content is never scanned. It needs a trivy executable, which
the -trivy release image ships. See Scanning and the severity gate and
ADR 29.
Short form: scanning: false is the same as scanning: {enabled: false}.
Short form: scanning: true is the same as scanning: {enabled: true}.
| Key | Type | Meaning | Default |
|---|---|---|---|
enabled | boolean | Scan hosted publishes for known vulnerabilities and attach the result to the artifact. Off when the section is absent. An absent enabled in the mapping means true, because writing the section signals intent. | false |
trivy | string | The Trivy executable. A bare name is looked up on the PATH. Sindri runs it as a separate process and never links it in. | trivy |
dbRepository | string | A mirror of the Trivy vulnerability database, passed as --db-repository, for a server that cannot reach the public one. Cannot be combined with skipDBUpdate. Credentials written into the reference are redacted by config show. | unset |
javaDbRepository | string | A mirror of Trivy’s Java vulnerability database, passed as --java-db-repository. Trivy fetches that database separately, and only when a scanned image or package holds a jar. An air-gapped install that scans jar-containing images sets this, or pre-seeds the Java database in cacheDir; otherwise, with skipDBUpdate, such a scan fails (fail closed). Cannot be combined with skipDBUpdate. Credentials written into the reference are redacted by config show. | unset |
cacheDir | string | Where Trivy keeps its database and caches between scans. Empty uses sindri/trivy under the user’s cache directory ($XDG_CACHE_HOME, or ~/.cache on Linux). The -trivy release image sets $XDG_CACHE_HOME to /var/cache, so there it is /var/cache/sindri/trivy. | unset |
timeout | duration | How long one scan may run before it is cancelled and retried. At least 1m. | 10m |
jobTimeout | duration | How long one whole scan job may run, across every platform of an image index and the staging in front of them, before it is cancelled, attaches nothing, and is retried with backoff. Must be at least timeout. Default 1h, or timeout when that is longer; 0s means the default, not no limit. | 1h |
skipDBUpdate | boolean | Never download the vulnerability database, and scan with the one already in cacheDir, including the Java database that Trivy fetches separately when it finds a jar. For an air-gapped server with a pre-seeded cache; a jar-containing subject fails to scan if the Java database is not in it. Cannot be combined with dbRepository or javaDbRepository. | false |
offlineScan | boolean | Pass --offline-scan to Trivy, so it makes no package lookups while scanning. Sindri always passes --skip-version-check and --disable-telemetry, so with this set Trivy makes no network request of its own. A server with a pre-seeded cache is offline, so this follows skipDBUpdate. Unlike skipDBUpdate it may be combined with dbRepository and javaDbRepository, for an air-gapped server that reaches only a mirror. Default false, or true when skipDBUpdate is set. | false |
maxUnpackedBytes | integer | The most bytes unpacked from one wheel or tarball while scanning it, so that an archive bomb cannot fill the disk. At least 1048576 (1 MiB). | 1073741824 |
rescanInterval | duration | How often every approved subject is scanned again, so a vulnerability published after approval is noticed (ADR 31). Default 24h; 0s disables the schedule, and the on-demand re-scan route still works. Otherwise at least 1m. | 24h |
notifications
Webhooks tell a receiver about a new finding on an approved artifact and about a promotion. They are server-level settings with no manifest form. Each delivery is signed and goes through the job queue. See ADR 34.
| Key | Type | Meaning | Default |
|---|---|---|---|
webhooks[].name | string | The webhook’s name, which keys its delivery log. Lower-case letters, digits, and hyphens, at most 63 characters, and unique in the list. | unset |
webhooks[].url | string | Where deliveries are POSTed. https, or http for a loopback address, and without credentials in the URL. config show, the API, and the UI print only its scheme and host, because the path often carries a token. | unset |
webhooks[].secret | string | The key that signs each delivery with HMAC-SHA256. At least 32 bytes; use ${VAR} to keep it out of the file. Redacted by config show. | unset |
webhooks[].events | list of strings | The events to send: finding.new, lifecycle.promoted, or both. At least one, with no repeats. | unset |
webhooks[].repositories | list of strings | Send only events for subjects in these repositories. Empty means every repository. | unset |
webhooks[].timeout | duration | How long one delivery attempt may take before it is cancelled and retried. More than 0 and at most 1m. | 10s |
maxAttempts | integer | How many times one delivery is attempted before it is recorded as failed, with the queue’s exponential backoff between attempts. Between 1 and 50. | 8 |
ui
The read-only web interface under /ui. It is a server-level setting with no manifest
form. Restart the server to change it.
| Key | Type | Meaning | Default |
|---|---|---|---|
docsUrl | string | Where the “Docs” link in the web interface footer, and the sign-in help, point. Set it to an internal copy of the documentation in an air-gapped install. An absolute http or https URL without credentials. | https://spjdevops.github.io/sindri/ |
Repositories, lifecycle, and defaults
These three sections describe desired state. serve reconciles them against the
database on start and on SIGHUP. sindri apply converges the same documents from CI.
A file with none of these sections leaves repositories API-managed. See
ARCHITECTURE.md section 8 and
ADR 17.
The short form below desugars into the long form (enveloped manifests) one way and
completely. testdata/config/sindri.yaml and testdata/manifests/ spell one setup both
ways, and a golden test keeps them identical.
repos
A map from repository name to its entry. A hosted, proxy, or virtual repository is distinguished by what the entry contains, not by a flag.
| Key | Type | Meaning | Default |
|---|---|---|---|
protocol | string | oci, pypi, or npm. Required for a hosted repository, and for a proxy with an explicit url. A proxy with a preset takes the preset’s protocol; a virtual repository takes its members’. | inferred, as described |
upstream | preset name or mapping | Makes the repository a proxy. A preset name, or a mapping (below). | unset |
members | list of strings | Makes the repository virtual: an ordered list of repository names. Every member must share one protocol. | unset |
type | string | hosted, proxy, or virtual. Optional; if written it must agree with what members and upstream imply. | inferred |
read | list of strings | Groups that may read. Entries are group names as the identity provider reports them, or authenticated for any signed-in caller. | defaults.<type>.read, else administrators, and machine tokens scoped to it |
write | list of strings | Groups that may write. Write implies read. | defaults.<type>.write, else administrators, and machine tokens scoped to it |
lifecycle | list of strings, or mapping | Hosted repositories only: the stages artifacts may be promoted into, as a list, or as a mapping with stages. | defaults.hosted.lifecycle, else every stage |
lifecycle.stages | list of strings | The same list, in the mapping spelling. | every stage |
An entry with neither members nor upstream is hosted. An entry with both is an
error: declare two repositories. A member written in another namespace needs its type as
a prefix, such as hosted/org/internal-py.
upstream takes a preset name or a mapping. A preset is an upstream built into the
binary, so nobody hand-types the URL, and it sets these values:
| Preset | Protocol | URL | ttl | negativeTtl |
|---|---|---|---|---|
dockerhub | oci | https://registry-1.docker.io | 1h | 5m |
ghcr | oci | https://ghcr.io | 1h | 5m |
maven-central | maven, reserved: this build does not serve it | https://repo.maven.apache.org/maven2 | 1h | 5m |
npm | npm | https://registry.npmjs.org | 1h | 5m |
pypi | pypi | https://pypi.org/simple | 1h | 5m |
A preset names an upstream, not a repository: the repository’s name is its key under
repos:, so public-js: { upstream: npm } is as valid as npm: { upstream: npm }.
sindri config show --expanded prints what each preset became.
The mapping takes these keys:
| Key | Type | Meaning | Default |
|---|---|---|---|
preset | string | A preset name, as above. | unset |
url | string | The upstream’s URL. Needed when there is no preset. | the preset’s |
ttl | duration | How long a cached answer is fresh. 0 never expires, so the cache is never refreshed and Sindri never notices upstream removing a file. Always set it for an explicit url. | the preset’s; else defaults.proxy.ttl; else 0 |
negativeTtl | duration | How long “not found” is remembered. 0 means it is not cached. | the preset’s; else defaults.proxy.negativeTtl; else 0 |
credentials | string | A key of the top-level credentials: map. | unset |
Precedence, lowest first: the preset, then defaults.proxy, then what the repository
writes. A mapping with an explicit url, and no ttl or negativeTtl here or in
defaults.proxy, leaves both at 0. An unset ttl of 0 never expires: a cached hit is always fresh and never
revalidated, so that proxy never refreshes its cache, and since SIN-54 never notices
upstream removing a file, because a refresh is what flags it. An unset negativeTtl of
0 means “not found” is not cached. Always set ttl for an explicit url.
lifecycle
The ordered stages and the evidence each requires.
| Key | Type | Meaning | Default |
|---|---|---|---|
stages | list | An ordered list. Each entry is a stage name, or a mapping with name and gates. | no stages |
stages[].name | string | The stage name, in the mapping spelling. | |
stages[].gates | list of gates | Rules to promote into the stage, in the mapping spelling. Each entry is an evidence type (a string) or a scan mapping. | no gates |
gates | map of stage to list of gates | A map from a stage name to the rules to promote into it, for example prod: [sbom, signature, {scan: {maxSeverity: high}}]. The stage must be declared in stages, and a stage’s gates are written in one place, not both. | no gates |
A gate is an evidence type, or a scan mapping that refuses a subject whose newest
Sindri scan of any platform holds a finding above a severity ceiling. A stage takes at
most one scan rule.
| Key | Type | Meaning | Default |
|---|---|---|---|
scan | mapping | A scan rule, written in place of an evidence type. | |
scan.maxSeverity | string | The ceiling: critical, high, medium, or low. high refuses only critical findings; an unrated (UNKNOWN) finding is refused at every ceiling. |
lifecycle:
stages: [dev, integration, prod]
gates:
prod:
- sbom
- signature
- scan: {maxSeverity: high}
The rule is a ceiling read from the scan evidence the worker records; ADR 30 gives the reasoning.
Lifecycle applies to hosted repositories only. Stages are organisation-wide.
defaults
Values applied to every repository of a type that does not set them itself. There is
no extends:; YAML anchors cover the rest. The keys are the repository types, and each
takes the fields of the same name on a repository.
| Key | Fields it may set |
|---|---|
hosted | read, write, lifecycle |
proxy | read, write, ttl, negativeTtl, credentials |
virtual | read, write |
Long form: manifests
sindri apply -f <file-or-directory> and sindri diff read enveloped documents,
several per file separated by ---. Every document has kind, metadata, and spec.
All three kinds describe repositories and lifecycle, so none of them has a place for
server settings.
kind: Repository
A namespaced repository’s full name is namespace/name.
| Key | Type | Meaning | Default |
|---|---|---|---|
kind | string | Repository. | |
metadata.name | string | The repository’s name. Required. | |
metadata.namespace | string | The owning team. Omit it for an organisation repository. | unset |
spec.type | string | hosted, proxy, or virtual. Required. | |
spec.protocol | string | oci, pypi, or npm. Required. | |
spec.upstream.url | string | Proxy only. The upstream URL. | |
spec.upstream.ttl | duration | Proxy only. Fresh time. Unset is 0, which never expires and never refreshes the cache, so always set it. | 0 |
spec.upstream.negativeTtl | duration | Proxy only. How long “not found” is remembered. Unset is 0: not cached. | 0 |
spec.upstream.credentials | string | Proxy only. A key of the server’s credentials: map. | unset |
spec.members[].ref | string | Virtual only. <type>/<name>, for example hosted/internal-js; org/<name> or <team>/<name> reaches across a namespace. | |
spec.access.read | list of strings | Groups that may read, or authenticated. | administrators, and machine tokens scoped to it |
spec.access.write | list of strings | Groups that may write. | administrators, and machine tokens scoped to it |
spec.lifecycle.stages | list of strings | Hosted only. The stages artifacts may be promoted into. | every stage |
The long form has no presets and no inference: what is written is what the server acts
on. sindri config show --expanded prints a short-form file in this spelling.
kind: Lifecycle
| Key | Type | Meaning | Default |
|---|---|---|---|
kind | string | Lifecycle. | |
metadata.name | string | A name for the document. Optional. | unset |
spec.stages[].name | string | The stage name. | |
spec.stages[].gates | list of gates | Rules to promote into the stage: evidence types (strings) or scan mappings, as in the short form. | no gates |
kind: OrgPolicy
Optional. Absent means every team declares freely. Only one may exist.
| Key | Type | Meaning | Default |
|---|---|---|---|
kind | string | OrgPolicy. | |
metadata.name | string | A name for the document. Optional. | unset |
spec.mode | string | centralized (only organisation documents declare repositories), delegated (teams declare freely), or hybrid (teams declare their own, and the mandatory repositories must exist). | delegated |
spec.mandatoryRepos[].name | string | An organisation repository that must exist. | |
spec.mandatoryRepos[].locked | boolean | Teams may reference it and never override it. | false |
spec.namespaces[].name | string | A team namespace. | |
spec.namespaces[].admins | list of strings | Groups that may apply that namespace’s manifests. | administrators only |
Ownership
The reconciler owns rows marked managed_by = config, and records which trigger owns
each: serve --config or sindri apply. The API, the reconciler, and the two triggers
never change a row another owns. The reconciler never deletes without --prune. See
ADR 17.
Upgrading Sindri
An upgrade is replacing one binary or one image. There is no separate migrate step and no upgrade tool.
What happens on startup
sindri serve applies every outstanding database migration before it accepts a
request. The migrations are embedded in the binary, so the schema a binary
needs always ships with it. They run under a Postgres advisory lock: when
several instances start at once, one migrates and the others wait, so a rolling
restart is safe.
The blob store needs nothing. Blobs are content-addressed bytes whose layout does not change between releases.
Upgrading
-
Back up Postgres. Migrations are written to be safe, but a backup is what makes any mistake recoverable.
-
Replace the binary, or change the image tag:
# Compose quickstart SINDRI_IMAGE=ghcr.io/spjdevops/sindri:<version> docker compose up -d # Binary tar -xzf sindri_<version>_linux_amd64.tar.gz sindri install -m 0755 sindri /usr/local/bin/sindri systemctl restart sindri -
Check the log for
database schema is up to date. Itsappliedfield counts the migrations this start ran.
Upgrade one release at a time. Each release’s migrations are only guaranteed to be compatible with the release before it.
Behaviour changes in 1.1
Read these before upgrading a server that other people depend on.
- An upstream that refuses Sindri’s credential is a 502. A proxy whose
upstream answers 401 or 403 now gives 502 on every protocol, and fails a
virtual repository’s walk instead of being skipped. A copy already cached
still serves. On OCI, only an anonymous proxy reads a bearer-carrying
401/403, or a refusal from an anonymous token endpoint, as “no such name”. A
proxy with credentials always fails the walk. In a virtual repository such as
[hosted, dockerhub-with-login, ghcr], an image that exists only on ghcr now gets a 502 unless the logged-in proxy is last, or runs anonymously. See ADR 14. - A deleted file’s name stays taken. Deleting an npm version or a PyPI filename from a hosted repository means it cannot be published again, even with identical bytes: the publish answers 409. Publish a new version. Hosted OCI-protocol files are unaffected, and files deleted before the upgrade are not remembered. See ADR 13 and ADR 24.
- A file upstream drops answers 404 at once. Once a proxy sees that the
upstream no longer lists a cached file, reads answer 404 straight away,
directly and through a virtual repository, lockfile installs included. The
file serves again if upstream lists it again. Its row is removed after
worker.retention.proxyStaleAfter, 7 days by default. A placed file read past its cache TTL now waits for the upstream’s answer before it serves, so an upstream that accepts connections and never answers can hold each such read for the upstream timeout, 30 seconds by default. This covers npm and PyPI. On OCI, a digest manifest and its layer blobs keep serving from placement after upstream drops them, so an image pulled upstream as malicious keeps serving by digest until its tag is evicted and the collector reclaims it, unless an administrator evicts and blocks the digest (PUT /api/v1/repositories/{name}/blocked/{digest}, see ADR 14). A whole-package 404 moves a virtual repository’s walk on, so with[private-proxy, npm]a package removed from the private upstream can resolve from the public proxy; only a hosted claim protects a private name. - A malformed provenance header is a 400. A provenance header with invalid UTF-8 or a NUL byte is rejected.
- npm is new. An npm repository needs
publicUrl, and a configuration that declares one without it no longer loads. See the configuration reference.
Behaviour changes in 1.1.1
-
npm packuments carry real publish times. Migration 00011 adds
versions.published_at, set to the insert time for every new version. Yarn 4 now installs on its default settings, so you can removenpmMinimalAgeGate: 0from.yarnrc.yml. Read the next two items first. -
Yarn 4 on defaults now holds back anything published in the last 24 hours, internal versions included. Its default
npmMinimalAgeGateis one day, and it now has a real time to compare. A version your team publishes will not install for a day. To exempt an internal scope, add it to.yarnrc.yml:npmPreapprovedPackages: ["@acme/*"]The glob form is the one that matches on yarn 4.18.1; a bare
"@acme"does not. -
There is no backfill, and removing
npmMinimalAgeGate: 0breaks versions published before the upgrade. Such a version has no recorded time and is left out oftime, because Sindri does not invent one. Yarn 4 treats a version it cannot date as quarantined, so once you remove the setting it will not install, now or later, unless its package is pre-approved as above. Pre-approve the affected scopes before you removenpmMinimalAgeGate: 0. The other way out is to set the time yourself in Postgres (UPDATE versions SET published_at = ... WHERE ..., on theversionstable). That is an operator asserting a publish time Sindri never observed, so it is your choice to make, and Sindri does not suggest it. -
A proxy downloads whole upstream documents. The proxy now asks npmjs for the full document instead of the abbreviated one, so upstream traffic, parsing, the response a client gets, and the cache all grow. A cached document gains
timeonly when it refreshes, and a repository withttl: 0never refreshes (a cached hit is fresh forever), so a document cached before the upgrade never gainstimethere. To fix that, set a non-zerottlon the proxy and reload (or runsindri apply). Thettlis read on every request and an entry’s age counts from when it was fetched, so an old entry is stale at once and the next read refreshes it. This is from reading the code, not a run of an upgraded instance. That remedy covers config-managed repositories only. The API cannot change thettlof a repository it created (it can create and delete, not update), so the way out for an API-created proxy is to delete it and create it again with a non-zerottl, which needs an admin and is refused for a repository that has promotion events. Raisingttlfrom 0 also makes the repository’s old entries, and the cached files they justified, evictable once they are older thanttlplus the stale allowance (worker.retention.proxyStaleAfter), where atttl: 0nothing was ever evicted. See ADR 24. -
A proxy backs off for 30 seconds after its upstream stops answering. Since 1.1.0 a placed npm or PyPI file read past the
ttlcontacts upstream before it serves, so a blackholed upstream made each such read wait the full timeout. After one refresh fails because the connection failed or no response headers arrived within the timeout, that repository’s documents are not refreshed for 30 seconds: placed files serve from the cache and anything else answers 502 at once. A file upstream removes during that window keeps serving until a read after the window ends refreshes the document. A 5xx does not start the window: it is a fast answer, so it fails that one request with a 502, and a stale copy still serves, as before. Nor do 401, 403, 429, an oversize or unparsable document, or a body that stalls after the headers. The window is not configurable, and is held in memory per process. A placed file whose document is still fresh is also served without loading the document. -
Two pushes are now refused. Publishing an npm tarball that has a partial block after its end-of-archive marker is refused (SIN-59). npm and pnpm install such a tarball, but yarn 1 cannot extract it. An OCI manifest whose
org.opencontainers.image.sourceororg.opencontainers.image.revisionannotation holds a NUL byte or invalid UTF-8 is a 400 (SIN-63), as a bad provenance header already was.
Behaviour changes in 1.2
1.2 adds no migration and changes no setting, so upgrading from 1.1.1 means replacing the
image or binary and nothing else. It adds the Helm chart
(ADR 28), the sindri_queue_jobs
metric, and a token: form for upstream credentials
(ADR 27). Four things behave
differently:
- A large
non an OCI tags list is capped, not refused. Above 200 it was a 400. It is now treated as 200, and the response carries aLinkheader for the next page, as Distribution does. A zero or negativenis still refused, and the management API’s page limit is unchanged (SIN-79). - OCI manifest reads honour every
Acceptline. Only the first line was read, so a Docker daemon, which sends one line per media type, could get a 404 through a proxy of a Distribution registry (SIN-78). - A PyPI proxy resolves relative file links against the project page, as PEP 503 says, not against the upstream’s base. This is what makes a devpi upstream work. The cached copy of an index page now stores its links absolute (SIN-77).
- An OCI proxy refuses a
token:credential. Configuration validation rejects one, and none is sent on an OCI request.token:is new in 1.2, so no existing configuration is affected (SIN-53).
Behaviour changes in 1.3
- Remove scan gates before rolling back to 1.2.x. A stored
scangate rule stops a 1.2.x binary from starting underserve --config, because that parser does not know thescankey and refuses it. Delete thescan:gates from the configuration, apply it, and only then start the older binary.
Behaviour changes in 1.4
- The first worker tick re-scans every approved artifact at once. With scanning on,
scanning.rescanIntervaldefaults to24hand the schedule fires on the first tick after the upgrade, enqueuing one scan per approved artifact. Expect a burst in the queue; it can trip the queue-backlog alert. If that matters, setscanning.rescanInterval: 0sbefore upgrading and set it to the interval you want once the upgrade is done, so the burst starts when you choose. See Re-scanning. - 1.4.1 changes the image base to Debian 13. The image is still distroless and static,
running as the same non-root user with the same data directory, so nothing in a
deployment changes. 1.4.1 is built with Go 1.27.4 and go-jose 4.1.9 and has no known
vulnerabilities at release. A Sindri scan of the 1.4.0 image reports Go standard
library, go-jose,
tzdata, andca-certificatesfindings, and 1.4.1 fixes them.
Behaviour changes in 1.5
- The OCI referrers API is served. A client that attached signatures or SBOMs to an
older Sindri fell back to tags named
sha256-<digest>. cosign and oras now ask the API instead and stop reading those tags. Manifests pushed before the upgrade are not listed, so attach older signatures and SBOMs again. The old tags stay and can be deleted once that is done. See Signatures and SBOMs. referrersis a reserved repository name segment. A new repository cannot have a name segmentreferrers, and a first push no longer creates one. A repository created through the API keeps working. One declared in the configuration file must be renamed before the upgrade:sindri config checkrefuses the name, andserve --configdoes not start on a file that fails the check.- The garbage collector keeps a referrer for as long as its subject. An untagged signature used to be collected after the grace period. It is now kept while a repository holds both it and the image it signs, and collected once it is deleted from that repository or the image goes.
- A signature or SBOM attached as a referrer is not scanned on publish. That is a manifest that names a subject and has neither an image config nor an image layer. Anything else is scanned as before, whether or not it names a subject.
Behaviour changes in 1.5.1
-
A proxy repository’s upstream URL may not carry credentials.
https://user:token@hostis refused when a repository is created through the API (400) and bysindri config check,serve --configandsindri apply. The error names the field and does not repeat the value. Put the secret in the server’scredentials:section and name it withupstream.credentials(credentials_refin the API):credentials: mirror: username: sindri password: ${MIRROR_TOKEN} repos: pypi-mirror: protocol: pypi upstream: { url: https://pypi.mirror.example/simple, credentials: mirror } -
Existing repositories keep working. A repository created through the API with credentials in its URL keeps authenticating, and startup logs one warning per such repository, naming only the repository. The UI,
diffandapplynow show the URL with the credentials replaced by<redacted>. To remove the warning, create a replacement repository withcredentials_refand delete the old one. A repository declared in the configuration file with credentials in its URL must be fixed before the upgrade:config checkrefuses it, andserve --configdoes not start on a file that fails the check. -
Migration 00014 is additive. It adds the table that holds blocked OCI digests. A rollback to 1.5.0 needs no database restore; the older binary ignores the table, and a blocked digest is served again until you upgrade.
-
Two scanning settings are new.
scanning.jobTimeoutbounds one whole scan job and defaults to1h(0smeans the default, and it must be at leasttimeout). A job that hits it attaches nothing and is retried with backoff.scanning.offlineScandefaults tofalse, or totruewhenskipDBUpdateis set. Neither needs a change unless you want them. See the configuration reference. -
Trivy no longer phones home. Every scan now passes
--skip-version-checkand--disable-telemetry, so no server checkscheck.trivy.devfor a newer Trivy or sends usage telemetry to Aqua. WithofflineScanon, Trivy also gets--offline-scanand makes no package lookups; an existing server withskipDBUpdateset gets it on upgrade. -
Some scan outcomes that were skipped or retried are now failed jobs. Too many platforms, a duplicate platform, an unsupported child and an index with no platforms were counted as skipped before 1.5.1; an archive over the cap and an unsafe path were retried until attempts ran out. All six now fail once, without retries, and count as
failedinsindri_scans_total. Alerts onfailedmay fire for artifacts that were counted as skipped before. -
A hosted PyPI filename belongs to one version. Publishing through the API a filename that already exists under another version answers 409
FILE_EXISTS. Deleting a filename removes it under every version of the package that holds it, and a version it empties goes too. Data written before 1.5.1 that already holds a filename twice is left as it is. -
An admin can evict and block one digest in an OCI proxy with
PUT /api/v1/repositories/{name}/blocked/{digest};DELETEunblocks it, andGET .../blockedlists them.
Behaviour changes in 1.6
- Webhook notifications are new. A
notifications:section configures webhooks forfinding.newandlifecycle.promoted. Nothing is sent until you add one; see Notifications. - Migration 00015 is additive. It adds the
webhook_deliveriestable. A rollback to 1.5.1 needs no database restore; the older binary ignores the table. - Administrators get a System page in the UI, linked from the header, with the webhooks and their delivery log. Other users do not see the link, and the page answers 404 for them.
Rolling back
Every migration stays backward compatible for one release, so the previous binary runs against the newer schema. To roll back one release, start the previous binary or image. It finds no migrations to apply, leaves the newer schema in place, and serves. A rollback does not need a database restore.
Rolling back from 1.1 to 1.0.x needs the configuration file changed first. The 1.0.x
binary does not know publicUrl or protocol: npm, so it refuses to start on a file that
has either. Remove publicUrl and the npm repositories before starting it. While rolled
back, files an upstream dropped serve again and deleted names are no longer enforced as
taken.
Rolling back from 1.1.1 to 1.1.0 needs no configuration change. A 1.1.0 server serves no
time for a hosted package, and a proxy goes back to the abbreviated document as its cache
entries refresh, so yarn 4 refuses every version again unless npmMinimalAgeGate: 0 is
back in .yarnrc.yml. Restore it before you roll back. The published_at column stays,
unused.
Rolling back from 1.5 to 1.4.x needs no configuration change. A 1.4.x server answers 404
on the referrers route, so clients go back to the sha256-<digest> tags, which were not
written while 1.5 ran: attach signatures again if you stay rolled back. Its garbage
collector also collects untagged referrers after the grace period again. The
manifest_subjects table stays, unused.
Rolling back from 1.6 to 1.5.1 needs the configuration file changed first. The 1.5.1
binary does not know notifications:, so it refuses to start on a file that has it.
Remove the section before starting it. Deliveries still queued are left in the queue table
under a job kind 1.5.1 does not run, and are sent if you upgrade again.
Rolling back further than one release is not supported without restoring the backup taken before the upgrade.
Pinning
The quickstart uses ghcr.io/spjdevops/sindri:latest so that it works first
time. For anything you depend on, pin a version tag, or a digest, and upgrade
on purpose.
Each release also publishes an image that includes Trivy, for vulnerability
scanning: the same tag with a -trivy suffix (<version>-trivy, latest-trivy).
The default image stays free of it.
Deploying with Docker Compose
This runs Sindri and Postgres on one machine, with blobs on a local volume and generated credentials. It is not the quickstart: the quickstart signs in anyone who opens a browser and has its password written in the file, so it must never be exposed.
Files
Create a directory, and save this as compose.yaml:
name: sindri
services:
postgres:
image: postgres:18-alpine@sha256:10a5c69a83035ab5239f5620d708520e8b28f5aa1f2b20143e6024532edadfb5
restart: unless-stopped
environment:
POSTGRES_USER: sindri
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?set it in .env}
POSTGRES_DB: sindri
volumes:
- postgres:/var/lib/postgresql
healthcheck:
test: ["CMD-SHELL", "pg_isready -U sindri -d sindri"]
interval: 5s
timeout: 5s
retries: 30
sindri:
image: ghcr.io/spjdevops/sindri:${SINDRI_VERSION:?set it in .env}
restart: unless-stopped
depends_on:
postgres:
condition: service_healthy
environment:
DATABASE_URL: postgres://sindri:${POSTGRES_PASSWORD}@postgres:5432/sindri?sslmode=disable
SINDRI_TOKEN: ${SINDRI_TOKEN:?set it in .env}
# Loopback only: a reverse proxy on this machine terminates TLS in front of it.
ports:
- "127.0.0.1:8080:8080"
volumes:
- ./sindri.yaml:/etc/sindri/sindri.yaml:ro
- blobs:/var/lib/sindri
healthcheck:
test: ["CMD", "/usr/local/bin/sindri", "probe", "http://127.0.0.1:8080/readyz"]
interval: 10s
timeout: 5s
retries: 30
volumes:
postgres:
blobs:
Save this as sindri.yaml, with your own publicUrl:
listen: :8080
database: ${DATABASE_URL}
storage: /var/lib/sindri
# The address clients use. npm tarball links are built from it.
publicUrl: https://sindri.example.com
auth:
# The bootstrap administrator token, for docker login and the API.
static_token: ${SINDRI_TOKEN}
For people to sign in to the UI, add auth.oidc for your identity provider. The
configuration reference lists every setting, including the S3
storage backend.
Start it
This generates the credentials once, keeps them in .env, and starts both services:
cat > .env <<EOF
SINDRI_VERSION=1.2.0
POSTGRES_PASSWORD=$(openssl rand -hex 24)
SINDRI_TOKEN=$(openssl rand -hex 32)
EOF
chmod 600 .env
docker compose up -d --wait
Keep .env safe. It holds the only copy of both secrets.
Next, put TLS in front of it with a reverse proxy, and set up backups. To upgrade, follow Upgrading.
Scanning
Vulnerability scanning is off by default. It needs the image variant that ships Trivy, so
set SINDRI_VERSION in .env to the -trivy tag (for example 1.2.0-trivy, or
latest-trivy), which is ghcr.io/spjdevops/sindri:<version>-trivy. Then add this to
sindri.yaml:
scanning:
enabled: true
Each hosted publish then gets a CycloneDX sbom and a Trivy scan, kept as evidence on the artifact. Proxied content is not scanned.
The -trivy image keeps Trivy’s vulnerability database and the scan staging area under
/var/cache/sindri/trivy. Mount a named volume at /var/cache/sindri on the sindri
service, and declare it under volumes:, so the database is not downloaded again each time
the container is recreated:
volumes:
- blobs:/var/lib/sindri
- scan-cache:/var/cache/sindri
The volume must have room for the largest image you scan, because each scan unpacks it there. Trivy downloads its database from the internet on first use. For the severity gate, what scanning covers, and mirroring the databases for an air-gapped install, see Scanning and the severity gate.
Deploying on Kubernetes with Helm
The chart runs Sindri as one replica. Upload sessions live in process memory, so a
chunked docker push would break if two pods shared the work. The chart has no replica
setting for that reason, and a restart or upgrade has brief downtime
(ADR 28).
What you need first
The chart deploys Sindri and nothing else. Bring:
- Kubernetes, and Helm 3.8 or later.
- A Postgres database. Sindri creates its schema on first start.
- An S3-compatible bucket, or a volume for the filesystem backend (see Storage).
- For people to sign in to the UI, an OIDC identity provider. The
configuration reference describes
auth.oidc.
Install
The config value is sindri.yaml. The chart writes it to a ConfigMap unchanged, so
every key in the configuration reference works here. Secrets stay
out of it: the file names them with ${VAR}, and they reach the pod from a Secret.
Save this as values.yaml, with your own publicUrl, bucket, and any other settings:
config:
database: ${DATABASE_URL}
storage:
backend: s3
bucket: sindri-blobs
endpoint: ${S3_ENDPOINT}
pathStyle: true
accessKeyId: ${S3_ACCESS_KEY_ID}
secretAccessKey: ${S3_SECRET_ACCESS_KEY}
# The address clients use. npm tarball links are built from it.
publicUrl: https://sindri.example.com
auth:
# The bootstrap administrator token, for docker login and the API.
static_token: ${SINDRI_TOKEN}
envFrom:
- secretRef:
name: sindri-env
On AWS, leave out endpoint, pathStyle, and both keys to use the pod’s ambient
credentials.
Export the five values, generating the token with openssl rand -hex 32. Then create the
Secret and install:
kubectl create namespace sindri
kubectl -n sindri create secret generic sindri-env \
--from-literal=DATABASE_URL="$DATABASE_URL" \
--from-literal=S3_ENDPOINT="$S3_ENDPOINT" \
--from-literal=S3_ACCESS_KEY_ID="$S3_ACCESS_KEY_ID" \
--from-literal=S3_SECRET_ACCESS_KEY="$S3_SECRET_ACCESS_KEY" \
--from-literal=SINDRI_TOKEN="$SINDRI_TOKEN"
helm install sindri oci://ghcr.io/spjdevops/charts/sindri --version 1.2.0 \
--namespace sindri --values values.yaml --wait --timeout 5m
The chart refuses to render without database, storage, and auth.static_token,
because Sindri’s own defaults for them are for local development.
Reaching it
Sindri needs its own hostname, because Docker requires /v2 at the root of the host, so it
cannot be served under a path. TLS ends at the Ingress and Sindri receives plain HTTP,
which needs no forwarded headers. publicUrl must be the https address clients use.
ingress-nginx is retired. The
kubernetes/ingress-nginxproject is archived, so expect no more releases or security fixes. The example below is tested against its last release, controller v1.15.1, because many clusters still run it. On a new cluster, choose another controller and apply the settings listed after the example.
Save this as ingress.yaml:
ingress:
enabled: true
className: nginx
host: sindri.example.com
annotations:
nginx.ingress.kubernetes.io/proxy-body-size: "0"
nginx.ingress.kubernetes.io/proxy-request-buffering: "off"
nginx.ingress.kubernetes.io/proxy-buffering: "off"
nginx.ingress.kubernetes.io/proxy-read-timeout: "900"
nginx.ingress.kubernetes.io/proxy-send-timeout: "900"
tls:
- secretName: sindri-tls
hosts: [sindri.example.com]
Create the certificate’s Secret, or let cert-manager create it, then add
--values ingress.yaml to your helm install or helm upgrade command:
kubectl -n sindri create secret tls sindri-tls --cert=fullchain.pem --key=privkey.pem
Those annotations are for ingress-nginx, and other controllers name them differently. F5’s
NGINX Ingress Controller, for one, uses nginx.org/ annotations. Whichever you run, set
the equivalents of:
- No limit on the request body. ingress-nginx’s default of 1 MB refuses most image layers with a 413.
- No buffering of requests or responses.
- Long timeouts, enough for your largest layer on your slowest link.
The reverse proxy guide explains why each one matters.
The Ingress routes Sindri’s public paths only. /metrics, /healthz, and /readyz carry
no authentication, so they stay inside the cluster, where Prometheus can reach them
through the Service.
Storage
With storage.backend: s3, nothing else is needed. For the filesystem backend, the chart
requires a volume, because a pod’s own disk does not outlive the pod:
config:
storage: /var/lib/sindri
persistence:
enabled: true
size: 200Gi
The volume is kept when the release is uninstalled, so helm uninstall cannot delete your
blobs. Delete the PersistentVolumeClaim yourself if you mean to.
Upgrade
helm upgrade sindri oci://ghcr.io/spjdevops/charts/sindri --version 1.2.0 \
--namespace sindri --values values.yaml --wait --timeout 5m
The chart stops the old pod before starting the new one, so a push in progress during an upgrade fails and the client has to retry it. Migrations run when the new pod starts. Read Upgrading for what they guarantee, and take a backup first.
Scanning
Vulnerability scanning is off by default. It needs the image variant that ships Trivy, so
set image.tag to the -trivy tag and turn scanning on in config:
image:
tag: 1.2.0-trivy
config:
scanning:
enabled: true
Each hosted publish then gets a CycloneDX sbom and a Trivy scan, kept as evidence on the artifact. Proxied content is not scanned.
Once config.scanning is set, the chart mounts an emptyDir scan cache at
/var/cache/sindri for Trivy’s database and the scan staging area, because the root
filesystem is read-only. It is sized by the node’s ephemeral storage, which must exceed the
largest image you scan. The database is downloaded again when the pod is replaced.
Trivy downloads its database from the internet on first use. For the severity gate, what scanning covers, and mirroring the databases for an air-gapped install, see Scanning and the severity gate.
TLS behind a reverse proxy
Sindri speaks plain HTTP and expects something in front of it to terminate TLS. A registry asks more of a proxy than a website does, and the same four things matter on every proxy:
- No limit on the request body. One image layer can be several gigabytes.
- No buffering, in either direction. Buffering writes every upload and download to the proxy’s disk first.
- Long timeouts. A large layer takes minutes. The examples allow 15 minutes on nginx and none on Traefik. Set a limit that covers your largest layer on your slowest link.
- Send the original
Hostheader, because a client follows the upload location Sindri returns.
Hide /metrics, /healthz, and /readyz. They carry no authentication, and each example
answers 404 for them. Scrape metrics from inside your network instead.
Sindri does not support cross-repository mounts, so pushing a layer that the server already holds still uploads every byte.
The examples reach Sindri as sindri:8080, its name on a shared Compose network. Use
127.0.0.1:8080 if the proxy runs on the host.
nginx
server {
listen 443 ssl;
server_name sindri.example.com;
ssl_certificate /etc/nginx/tls/fullchain.pem;
ssl_certificate_key /etc/nginx/tls/privkey.pem;
client_max_body_size 0;
proxy_request_buffering off;
proxy_buffering off;
proxy_read_timeout 900s;
proxy_send_timeout 900s;
proxy_http_version 1.1;
proxy_set_header Host $host;
# Sindri adopts this id, so its log lines match nginx's.
proxy_set_header X-Request-Id $request_id;
location ~ ^/(metrics|healthz|readyz)$ {
return 404;
}
location / {
proxy_pass http://sindri:8080;
}
}
These settings were also used by hand to push and pull a single 3.3 GB layer.
Caddy
Caddy obtains the certificate itself, and has no body limit or timeout by default.
sindri.example.com {
@operational path /metrics /healthz /readyz
respond @operational 404
reverse_proxy sindri:8080 {
flush_interval -1
}
}
Traefik
Traefik’s 60-second read timeout breaks any long push, so the static configuration turns it off:
entryPoints:
websecure:
address: ":443"
transport:
respondingTimeouts:
readTimeout: 0
writeTimeout: 0
providers:
file:
filename: /etc/traefik/dynamic.yml
The router, in dynamic.yml. tls: {} serves Traefik’s default certificate, so add your
certificate or a certResolver to it:
http:
routers:
sindri:
rule: "Host(`sindri.example.com`) && !Path(`/metrics`) && !Path(`/healthz`) && !Path(`/readyz`)"
entryPoints: [websecure]
service: sindri
tls: {}
services:
sindri:
loadBalancer:
servers:
- url: http://sindri:8080
Operating Sindri
Backup and restore
Sindri keeps state in two places, and a backup needs both. Postgres holds what exists: repositories, tags, placements, and the lifecycle ledger. The blob store holds the bytes. Neither is any use without the other.
Back up Postgres first, then the blobs. The order decides which kind of mismatch a restore can have:
- Bytes without rows are harmless. Garbage collection removes them eventually.
- Rows without bytes are the failure: Sindri lists an artifact it cannot serve.
Taking the dump first means every row in it refers to bytes already written, so the later copy includes them. Don’t run garbage collection between the two steps, because it could delete a blob the dump still refers to.
On the Compose deployment:
docker compose exec -T postgres pg_dump -U sindri -Fc sindri > sindri.dump
docker run --rm -v sindri_blobs:/data:ro -v "$PWD":/backup alpine:3.20 \
tar czf /backup/blobs.tar.gz -C /data .
To restore, onto the same machine or a new one with the same compose.yaml, sindri.yaml,
and .env:
docker compose stop sindri
docker compose up -d --wait postgres
docker compose exec -T postgres pg_restore -U sindri -d sindri --clean --if-exists --no-owner < sindri.dump
docker run --rm -v sindri_blobs:/data -v "$PWD":/backup alpine:3.20 \
tar xzf /backup/blobs.tar.gz -C /data
docker compose up -d --wait sindri
Anything pushed after the backup is gone after a restore. Clients get a “not found” and push it again.
With managed Postgres or S3, the same order applies with your provider’s tools: take the database snapshot first, then copy the bucket. Bucket versioning protects the bytes without a copy, as long as old versions outlive your oldest database snapshot.
Back up .env or your Secrets separately. The token and passwords are in neither backup.
Garbage collection and retention
The worker runs inside serve and does two different jobs, configured under
worker.
Retention is on by default and runs hourly. It discards abandoned uploads after
retention.uploadMaxIdle and evicts stale proxy cache entries after
retention.proxyStaleAfter.
Garbage collection deletes blobs nothing refers to, and is off until you schedule it. “Untagged and unpromoted is garbage” is a policy to adopt on purpose, so try it first:
- Run
sindri gc --dry-runto list what a collection would delete, and check the list. Without--dry-runthe command really deletes. - Then set
worker.gc.intervalto schedule it.
Blobs seen within worker.gc.grace (24 hours by default) are always kept, which protects
uploads in progress.
Stopping one bad digest
An OCI proxy keeps serving a cached digest after upstream drops it. To stop one digest in one proxy repository without deleting the repository, an administrator evicts and blocks it:
curl -X PUT -H "Authorization: Bearer $TOKEN" -H 'Content-Type: application/json' \
-d '{"reason":"CVE-2026-0001"}' \
"localhost:8080/api/v1/repositories/hub/blocked/sha256:..."
The digest is unplaced there, its tags and cache entries are removed, and layers no other
image in the repository uses are unplaced with it. The repository then answers 404
(MANIFEST_UNKNOWN or BLOB_UNKNOWN) for it, by digest or by a tag that resolves to it,
and never fetches it from upstream again. The same digest in another repository is
unaffected. The bytes go at the next collection. GET .../blocked lists the blocks with
who set them and why, and DELETE .../blocked/{digest} lifts one. In a virtual
repository, a member that blocks a digest counts as a miss, so the walk continues and
another proxy member can still serve the same digest. To stop the image for clients
pulling through a virtual repository, block the digest in every proxy member that can
fetch it.
Metrics and alerts
GET /metrics serves Prometheus metrics with no authentication, so keep it off the public
internet. Sindri’s own series:
| Metric | Meaning |
|---|---|
sindri_http_requests_total | Requests by method, matched route, and status |
sindri_http_request_duration_seconds | Request duration by method and route |
sindri_queue_jobs | Background jobs by state: queued, running, failed |
sindri_scans_total | Scan job attempts by result: succeeded, failed, or skipped (nothing scannable). Present with value 0 only when scanning is enabled |
sindri_scan_duration_seconds | Duration of scan job attempts, in seconds |
sindri_webhook_deliveries_total | Webhook delivery attempts by result: delivered, retried (it will be tried again), or failed (no attempts left, or the receiver refused it for good). Always present |
sindri_webhook_delivery_duration_seconds | Duration of webhook delivery attempts, in seconds |
sindri_approved_findings | Approved subjects whose newest Sindri scan lists at least one finding of a severity (CRITICAL, HIGH, MEDIUM, LOW, UNKNOWN, all always present). Present only when scanning is enabled |
sindri_build_info | The running version and commit, always 1 |
A starting set of alerts, assuming the scrape job is named sindri. Tune the thresholds to
your traffic:
groups:
- name: sindri
rules:
- alert: SindriDown
expr: up{job="sindri"} == 0
for: 5m
labels: {severity: critical}
# The database or the blob store is unreachable. Needs something calling
# /readyz, which the Compose healthcheck and the chart's probes both do.
- alert: SindriNotReady
expr: sum(rate(sindri_http_requests_total{route="/readyz",status="503"}[5m])) > 0
for: 5m
labels: {severity: critical}
# Storage failures during a request surface here as 5xx responses.
- alert: SindriHighErrorRate
expr: |
sum(rate(sindri_http_requests_total{status=~"5.."}[5m]))
/ sum(rate(sindri_http_requests_total[5m])) > 0.05
for: 10m
labels: {severity: warning}
- alert: SindriQueueBacklog
expr: sindri_queue_jobs{state="queued"} > 100
for: 30m
labels: {severity: warning}
# Failed jobs are kept for 30 days, so alert on new ones.
- alert: SindriJobsFailed
expr: delta(sindri_queue_jobs{state="failed"}[1h]) > 0
labels: {severity: warning}
# An approved artifact has a CRITICAL finding in its newest scan. Approval is not
# revoked for you; see "Re-scanning" in the scanning guide.
- alert: SindriApprovedCriticalFinding
expr: sindri_approved_findings{severity="CRITICAL"} > 0
for: 1h
labels: {severity: warning}
# A webhook delivery ran out of attempts, so a receiver missed an event.
# The delivery log shows which one; an administrator can redeliver it.
- alert: SindriWebhookDeliveryFailed
expr: increase(sindri_webhook_deliveries_total{result="failed"}[1h]) > 0
labels: {severity: warning}
Sizing
No load test has been published yet, so these say what grows rather than giving numbers. Measure your own deployment against them.
- Blob storage grows with unique content: identical layers and files are stored once however many repositories hold them. Plan for your published artifacts plus everything your proxies cache.
- Postgres holds metadata only and stays small compared to the blobs. It grows with
the number of artifacts and the lifecycle ledger, which is append-only.
database.maxConnsdefaults to 10. - Memory follows concurrency, more than stored data. Blobs are streamed rather than held in memory, but an npm proxy holds each upstream package document in memory while it serves it, so a very large package costs more.
- Temporary space: npm publishes are spooled to the temp directory while they are
validated, so allow more than your largest package. The chart’s
tmp.sizeLimitsets this on Kubernetes. - CPU goes mostly to hashing, because every uploaded byte is digested.
One replica is the supported size for now, so scale it up rather than out.
Upgrading
See Upgrading. Take a backup first.
Migrating from Verdaccio
You can move a team from Verdaccio to Sindri without a flag day. Sindri proxies your Verdaccio, hosts new publishes itself, and serves both through one repository, so clients change one line and Verdaccio can be switched off once nothing reads it. This page shows each step, and the script that checks it runs the commands below with the substitutions listed in What this was checked against.
The method uses three npm repositories:
- a proxy,
verdaccio, whose upstream is your Verdaccio, so everything you have already published stays installable; - a hosted repository,
internal-js, where new versions are published; and - a virtual repository,
javascript, over both, which is the only address clients use.
The virtual repository lists the hosted repository first, and that order is a
rule, not a preference. A name that hosted has ever held is claimed: the
proxy is never asked for it, so a package published to internal-js can never
be replaced by one of the same name from Verdaccio or from npmjs. For npm the
claim covers the whole scope, so one published @acme/* package claims every
@acme/* name. That has a consequence for the order of the steps below, which
Move the history before you switch anything
explains. See ADR 24.
You need a Sindri server with an npm repository’s publicUrl set (see
Configuration), npm 10 or later, and a Verdaccio 5 or 6
that the Sindri server can reach over HTTP or HTTPS. These steps were checked
with Verdaccio 6.11 and npm 10.9. Examples write the two servers as
https://verdaccio.example.com and https://sindri.example.com.
1. Give Sindri a token on Verdaccio
Sindri reads your packages as a Verdaccio user, so make that user. A dedicated
account such as sindri-proxy keeps Sindri’s reads apart from people’s in
Verdaccio’s log. It must be allowed to read every package you want to migrate,
which means it must be named in, or match, each access: rule in Verdaccio’s
configuration. Sign in as that user with npm login, then ask Verdaccio for a
token:
npm token create --registry https://verdaccio.example.com/
npm prints Created publish token <token> after it asks for the account’s
password. Keep the token in your secret store and give it to the Sindri server
as VERDACCIO_TOKEN. Verdaccio’s npm token create makes a token that works
as a Bearer token, which is what Sindri sends.
2. Declare the repositories
Add this to the Sindri configuration, next to your listen, storage,
database, and auth settings:
publicUrl: https://sindri.example.com
credentials:
verdaccio:
token: ${VERDACCIO_TOKEN}
defaults:
hosted: { read: [authenticated], write: [team:platform] }
proxy: { read: [authenticated] }
virtual: { read: [authenticated] }
repos:
verdaccio: { protocol: npm, upstream: { url: "https://verdaccio.example.com", ttl: 10m, negativeTtl: 1m, credentials: verdaccio } }
internal-js: { protocol: npm }
npm: { upstream: npm }
javascript: { members: [internal-js, verdaccio, npm] }
token: makes Sindri send Authorization: Bearer <token> to the upstream, and
only to the upstream’s own origin: a tarball link in a Verdaccio document that
names another host is refused, and never receives the token. See
ADR 27 and the
credentials reference.
The npm member is the public registry, last, so a package Verdaccio does not
hold still installs. Leave it out if your Verdaccio is the only source you want.
Replace team:platform with the group that publishes.
The upstream.url must be the address Verdaccio writes into its tarball links.
Sindri fetches a tarball only from the upstream’s own host and under its base
path, because the token goes with the request. A Verdaccio that advertises a
different public URL (its url_prefix, or VERDACCIO_PUBLIC_URL) than the one
Sindri reaches it at has its packuments served but every tarball refused with a
502, and the log says tarball URL is on another host. Point upstream.url at
the public one.
3. Move the history before you switch anything
Do this before any client reads from Sindri and before the first publish to
internal-js. Publishing @acme/legacy to internal-js claims the whole @acme
scope. From then on, through javascript, a Verdaccio-only version of
@acme/legacy, and every other @acme/* package that is not yet in internal-js,
is not found. The import below is itself a series of publishes, so the scope is
claimed from the first one, and a client that read javascript meanwhile would
find unimported packages missing. Until you switch the clients in step 4 they keep
reading Verdaccio, and nothing looks different to them while this runs.
Importing is a pack from Verdaccio and a publish to Sindri, once per version, for every package of the scope. The client needs the Verdaccio token for this step only:
//verdaccio.example.com/:_authToken=${VERDACCIO_TOKEN}
First list what there is. This script asks Verdaccio’s search for every package of
the scope, then for each one’s document (it asks for 250 hits at a time, and goes on by what
comes back, so a server that caps the page lower is still read to the end; it fails if
the count falls short of the total the search reports), and prints one name version
line per version, oldest first by semantic-version order, so 1.10.0 follows
1.2.0. It uses only Node’s own fetch. Save it as inventory.mjs:
const url = process.env.VERDACCIO_URL.replace(/\/$/, "");
const scope = process.env.SCOPE;
const headers = { Authorization: `Bearer ${process.env.VERDACCIO_TOKEN}` };
async function get(path) {
const res = await fetch(url + path, { headers });
if (!res.ok) throw new Error(`${path}: ${res.status}`);
return res.json();
}
const split = (v) => {
const [core, ...pre] = v.split("+")[0].split("-");
return [core.split(".").map(Number), pre.join("-")];
};
const numeric = (id) => /^\d+$/.test(id);
function comparePre(a, b) {
if (a === b) return 0;
if (a === "") return 1;
if (b === "") return -1;
const x = a.split("."), y = b.split(".");
for (let i = 0; i < Math.min(x.length, y.length); i++) {
if (x[i] === y[i]) continue;
if (numeric(x[i]) && numeric(y[i])) return x[i] - y[i];
if (numeric(x[i]) !== numeric(y[i])) return numeric(x[i]) ? -1 : 1;
return x[i] < y[i] ? -1 : 1;
}
return x.length - y.length;
}
function compare(a, b) {
const [ca, pa] = split(a), [cb, pb] = split(b);
for (let i = 0; i < 3; i++) if (ca[i] !== cb[i]) return ca[i] - cb[i];
return comparePre(pa, pb);
}
const size = Number(process.env.PAGE_SIZE || 250);
const found = new Set();
let total;
for (let from = 0; ; ) {
const page = await get(`/-/v1/search?text=${encodeURIComponent(scope)}&size=${size}&from=${from}`);
if (typeof page.total === "number") total = page.total;
const before = found.size;
for (const hit of page.objects) found.add(hit.package.name);
// The server may return fewer than asked, so go on by what came back.
if (page.objects.length === 0 || found.size === before) break;
from += page.objects.length;
}
if (total !== undefined && found.size < total) {
throw new Error(`search listed ${found.size} packages but reports ${total}`);
}
const names = [...found].filter((n) => n.startsWith(scope + "/")).sort();
for (const name of names) {
const doc = await get("/" + name.replace("/", "%2f"));
if (process.argv[2] === "tags") {
for (const [tag, version] of Object.entries(doc["dist-tags"])) console.log(name, tag, version);
} else {
for (const version of Object.keys(doc.versions).sort(compare)) console.log(name, version);
}
}
Run it once for each scope you own, and read the list before going on:
VERDACCIO_URL=https://verdaccio.example.com SCOPE=@acme node inventory.mjs > inventory.txt
VERDACCIO_URL=https://verdaccio.example.com SCOPE=@acme node inventory.mjs tags > tags.txt
inventory.txt holds the versions and tags.txt holds Verdaccio’s dist-tags, one
name tag version line each. The account that made the token must be able to read
every package in them; a package it cannot read is not in the list.
The import goes through the list in order. A version already on Sindri is skipped,
so an interrupted import can be run again. Every version is published under a
throwaway tag, sindri-import, because npm publish otherwise moves latest to
whatever was published last, and the history goes in oldest first. When a package
has all its versions in, its real tags are copied from tags.txt and the throwaway
is removed. If sindri-import is already one of your tags, pick another name in
both places:
while read -r name version; do
if [ -n "$(npm view "${name}@${version}" version --registry https://sindri.example.com/npm/internal-js/ </dev/null 2>/dev/null)" ]; then
continue
fi
tarball="$(npm pack "${name}@${version}" --silent --registry https://verdaccio.example.com/ </dev/null)"
npm publish "./${tarball}" --access public --tag sindri-import \
--registry https://sindri.example.com/npm/internal-js/ </dev/null
done < inventory.txt
for name in $(cut -d' ' -f1 inventory.txt | sort -u); do
npm dist-tag ls "${name}" --registry https://sindri.example.com/npm/internal-js/ </dev/null 2>/dev/null |
grep -q '^sindri-import:' || continue
awk -v n="${name}" '$1 == n { print $2, $3 }' tags.txt | while read -r tag version; do
npm dist-tag add "${name}@${version}" "${tag}" --registry https://sindri.example.com/npm/internal-js/ </dev/null
done
npm dist-tag rm "${name}" sindri-import --registry https://sindri.example.com/npm/internal-js/ </dev/null
done
Only a package that still has sindri-import is touched, so running this again
does not move a tag you have since set by publishing. Check that the tags match
what Verdaccio had; this prints each package and its tags:
for name in $(cut -d' ' -f1 inventory.txt | sort -u); do
echo "${name}"
npm dist-tag ls "${name}" --registry https://sindri.example.com/npm/internal-js/ </dev/null
done
Remove the Verdaccio line from ~/.npmrc afterwards.
A package first published to Verdaccio after your inventory is not in
internal-js. Through javascript it is not found, because the scope is
claimed. Run the inventory, the import, and the tag copy again before you switch the
clients: the second run imports only what is new.
What the import does not carry over:
- Publish times. An imported version has Sindri’s publish time, the moment
you imported it, not Verdaccio’s. That matters to a client with a minimum
release age, such as yarn 4’s
npmMinimalAgeGate: an imported version counts as new until the age has passed. - Deprecations.
npm deprecatemarks live in the document, not in the tarball, so a deprecated version arrives not deprecated. Apply them again withnpm deprecate "<name>@<version>" "<message>" --registry https://sindri.example.com/npm/internal-js/. - Anything that is not in the tarball or a dist-tag: Verdaccio’s access rules, its list of owners, and the account that published each version. Sindri’s own repositories and tokens decide who may read and publish.
4. Switch the clients
The history is in Sindri, so clients can change. A client needs the registry, and
a token for it. Put the registry in the
project’s .npmrc:
registry=https://sindri.example.com/npm/javascript/
replace-registry-host=verdaccio.example.com
Put the token in the user’s ~/.npmrc, at path level, as shown. A key for the
host alone (//sindri.example.com/:_authToken) is not enough, because Sindri’s
repositories live under /npm/<name>/. ${SINDRI_TOKEN} is npm’s own
environment reference, so the file holds no secret:
//sindri.example.com/npm/javascript/:_authToken=${SINDRI_TOKEN}
//sindri.example.com/npm/internal-js/:_authToken=${SINDRI_TOKEN}
Scopes need nothing more. A scope is the first part of the name, and the
virtual repository resolves @acme/legacy as it resolves left-pad. A
@acme:registry= line that points a scope at Verdaccio must be removed, or that
scope bypasses Sindri. The Verdaccio token line goes too, once you have done
the import in step 3: a client that has no Verdaccio credential cannot go around
Sindri to reach it.
The second line of the project file is the lockfile setting. The next section explains it.
5. Lockfiles keep the old host
package-lock.json records the URL each tarball was fetched from, in
resolved. For the public registry npm rewrites that URL to whatever
registry is set to. For any other host, and a Verdaccio is another host, it
keeps the old URL: npm ci goes straight to Verdaccio, past Sindri, and works
only because your clients can still reach it. A client with no Verdaccio
credential fails instead, with a 401 from Verdaccio.
Two fixes work with npm 10.9, and they are meant to be used together:
replace-registry-host=<host>, as in the project file above, makes npm rewrite the tarball links on that one host to the configured registry at install time. Write the hostname alone, without a port: npm 10.9 compares it with the link’s hostname, soverdaccio.example.com:4873matches nothing and the install still goes to Verdaccio. The existing lockfile then installs through Sindri with the same versions and integrity hashes. The file itself is not changed, and still names Verdaccio.- Regenerating the lockfile writes Sindri’s URLs into it. npm resolves again when it has no lockfile, so versions may move within their ranges:
rm package-lock.json
npm install
Use the first to cut over today, and the second as you next update each
project’s dependencies; then drop the setting. npm ci is the install command
the first fix is for:
npm ci
Do not use replace-registry-host=always, which the npm documentation offers
for this. It also rewrites the links Sindri writes, and because Sindri’s
repositories live under /npm/<name>/, npm doubles that path
(/npm/javascript/npm/javascript/...) and the install fails with a 404 for
any version npm resolves fresh, such as one you publish after the switch.
6. Publish new versions to Sindri
Publishing goes to the hosted repository, not the virtual one. Point the
package’s own .npmrc at it:
registry=https://sindri.example.com/npm/internal-js/
npm publish --access public
Clients that install through javascript see the new version beside the
history, because both are in internal-js.
7. Switch Verdaccio off
When nothing reads Verdaccio but Sindri, stop publishing to it, remove
verdaccio from the javascript members, and then stop Verdaccio. Do not
remove the proxy before the history is imported (step 3): until a package is
imported, the proxy is what keeps its versions installable. Once it is gone, regenerate any lockfile that still names
Verdaccio, and drop replace-registry-host.
What this was checked against
The commands above run against a real Verdaccio 6.11.1 container that requires a
login for @acme/*, with npm 10.9.9 on Node 22. Sindri authenticates to it with
a token: credential made by npm token create; the check fails if Sindri
cannot read Verdaccio’s private package.
- Scoped packages (
@acme/legacy) work with Verdaccio’s tarball links, which are/@acme/legacy/-/legacy-1.0.0.tgzand so pass the proxy’s strict tarball rules. - A client with no Verdaccio credential installs the lockfile’s tarball through Sindri, and Verdaccio’s log shows the tarball was read by the Sindri account.
- A hosted name is never served from the Verdaccio proxy, even when the proxy is listed first.
Not checked here: a Verdaccio that stores tarballs in S3 and redirects to them, GitHub Packages, and pnpm and yarn against this layout. A redirect that leaves the upstream’s origin loses the token by design.
The check runs the page’s configuration, client files, and commands out of the
page itself, with these substitutions: the example hosts verdaccio.example.com
and sindri.example.com become the hosts the check runs on, and
replace-registry-host names Verdaccio’s host without a port. Two commands are
changed. The lockfile command’s rm package-lock.json becomes rm -f, because
that copy of the project has no lockfile left to remove. The check’s own
publishes to Verdaccio and its comparisons of tags are its own commands, and not
the page’s.
The history import runs with two or more versions published out of order, a
version that sorts differently as text and as a number (1.10.0 against
1.2.0), and a prerelease. After the import, the check compares every package’s
dist-tags on Sindri with Verdaccio’s, and asserts that sindri-import is gone and
that a deprecation was not carried over.
Migrating from devpi
You can move a team from devpi to Sindri without a flag day. Sindri proxies your devpi index, hosts new uploads itself, and serves both through one repository, so clients change one line and devpi can be switched off once nothing reads it. This page shows each step, and the script that checks it runs the commands below with the substitutions listed in What this was checked against.
The method uses three PyPI repositories, and a fourth that is optional:
- a proxy,
devpi, whose upstream is your devpi index, so everything you have already uploaded stays installable; - a hosted repository,
internal-py, where new releases are uploaded; - a proxy of the public index,
pypi, if your devpi index inherits fromroot/pypiand your clients rely on that; and - a virtual repository,
python, over those, which is the only address clients use.
The virtual repository lists the hosted repository first, and that order is a
rule, not a preference. A project name that hosted has ever held is claimed:
the proxies are never asked for it. The claim is per project, by its normalized
name (PEP 503, so Acme_Lib and acme-lib are one project), and it covers the
whole project, not a version. The consequence is described in
Move the history before you switch anything
and decides the order of the steps: import first, then switch clients, then upload.
You need a Sindri server that can reach your devpi over HTTP or HTTPS, a devpi
server that serves PEP 691 JSON indexes, which is what Sindri asks for (check with
curl -H 'Accept: application/vnd.pypi.simple.v1+json' <index>/+simple/<project>/),
and pip and twine on the clients. These steps were checked with devpi-server 6.21,
pip 26.3, and twine 7.0. Examples write the two servers as
https://devpi.example.com and https://sindri.example.com, and the old index as
acme/prod.
1. Give Sindri an account on devpi
Sindri reads your packages as a devpi user. A dedicated account such as
sindri-proxy keeps Sindri’s reads apart from people’s in devpi’s logs. Create it
as root, with a password from your secret store (here DEVPI_PASSWORD):
devpi user -c sindri-proxy password="$DEVPI_PASSWORD"
devpi-server 6.21 has no per-index read permission of its own: an index is readable
by anyone who can reach the server, and uploads are limited by the index’s acl_upload.
Whether Sindri needs a login at all depends on how you front devpi. If devpi is
open on a private network, leave out credentials below. If a reverse proxy
requires a login for reads (the devpi-lockdown plugin with nginx’s
auth_request does this, and is what this page was checked against), the account
needs only to be able to sign in. Sindri sends it as HTTP Basic.
2. Declare the repositories
Add this to the Sindri configuration, next to your listen, storage,
database, and auth settings:
credentials:
devpi:
username: sindri-proxy
password: ${DEVPI_PASSWORD}
defaults:
hosted: { read: [authenticated], write: [team:platform] }
proxy: { read: [authenticated] }
virtual: { read: [authenticated] }
repos:
devpi: { protocol: pypi, upstream: { url: "https://devpi.example.com/acme/prod/+simple", ttl: 10m, negativeTtl: 1m, credentials: devpi } }
internal-py: { protocol: pypi }
pypi: { upstream: pypi }
python: { members: [internal-py, devpi, pypi] }
The upstream URL is the index’s +simple address, with the user and index in it.
Sindri adds the project name and asks for the JSON form. The credential goes only
to the upstream’s own origin (scheme and host): a file link in a devpi document
that names another host is fetched without it. See the
credentials reference.
Links in devpi’s documents are relative (../../+f/...). Sindri resolves them
against the project page they came from, as PEP 503 says, so devpi needs no
--outside-url setting for Sindri’s sake.
pypi is last, so a project that devpi does not hold still installs from the
public index. Leave it out if devpi’s bases are empty and you want no public
source. If your devpi index inherits from root/pypi, devpi already serves the
public packages through the devpi member, and pypi is a second path to them;
keep it only if you plan to drop root/pypi from devpi first. Replace
team:platform with the group that uploads.
If your index inherits from other devpi indexes that you own, declare one proxy
for each, and list each in members after devpi.
3. Move the history before you switch anything
Do this before any client reads from Sindri and before the first upload to
internal-py. Uploading acme-lib 1.5.0 to internal-py claims acme-lib. From
then on, through python, the devpi versions of acme-lib are not in the index
and are not served, even a version you never uploaded to Sindri. There is no merge
of hosted and proxied files for one project. Other projects are unaffected: the
claim is per project, by its normalized name, so an upload to acme-lib does not
hide acme-legacy. So import every project, with every file, first. Until you
switch the clients in step 4 they keep reading devpi, and nothing looks different
to them while this runs.
Importing is a download from devpi and an upload to Sindri, for every file. This script lists every project on the index and every file of each, which is every version in the form devpi stores it, and downloads them. It prints one line for each file, so its output is the inventory. It uses only the Python standard library. It sends the login only to devpi’s own origin (scheme and host): a file link that names another host is fetched without it, and a redirect to another host drops it. The account is the one from step 1, or any that can read the index:
import base64, json, os, pathlib, urllib.parse, urllib.request
base = os.environ["DEVPI_INDEX_URL"].rstrip("/")
index = base + "/+simple/"
login = base64.b64encode(f"{os.environ['DEVPI_USER']}:{os.environ['DEVPI_PASSWORD']}".encode()).decode()
out = pathlib.Path("devpi-export")
out.mkdir(exist_ok=True)
def origin(url):
parts = urllib.parse.urlsplit(url)
return parts.scheme, parts.netloc
class DropLoginOffOrigin(urllib.request.HTTPRedirectHandler):
"""Drop the login from a redirect that leaves devpi's origin."""
def redirect_request(self, req, fp, code, msg, headers, newurl):
new = super().redirect_request(req, fp, code, msg, headers, newurl)
if new is not None and origin(newurl) != origin(index):
new.remove_header("Authorization")
return new
opener = urllib.request.build_opener(DropLoginOffOrigin)
def get(url, kind="application/vnd.pypi.simple.v1+json"):
headers = {"Accept": kind}
if origin(url) == origin(index): # a link to another host gets no login
headers["Authorization"] = "Basic " + login
return opener.open(urllib.request.Request(url, headers=headers))
with get(index) as page:
projects = [p["name"] for p in json.load(page)["projects"]]
for name in projects:
with get(index + urllib.parse.quote(name) + "/") as page:
detail = json.load(page)
base_url = page.geturl() # relative links resolve against the page, after redirects
for f in detail["files"]:
print(name, f["filename"])
with get(urllib.parse.urljoin(base_url, f["url"]), "*/*") as src:
(out / f["filename"]).write_bytes(src.read())
DEVPI_INDEX_URL=https://devpi.example.com/acme/prod DEVPI_USER=sindri-proxy \
DEVPI_PASSWORD="$DEVPI_PASSWORD" python3 export-devpi.py
Save the script as export-devpi.py first. An index that inherits from others
lists only its own projects here, so run it for each index you own, and not for
root/pypi. Check the list against what you expect, then upload the files. Set
SINDRI_TOKEN to a token that may write to internal-py; twine reads the
password from TWINE_PASSWORD, which keeps it off the command line:
TWINE_USERNAME=token TWINE_PASSWORD="$SINDRI_TOKEN" \
twine upload \
--repository-url https://sindri.example.com/pypi/internal-py/upload \
devpi-export/*
An imported file keeps its bytes, and so its hash, and has Sindri’s upload time. Sindri’s files are immutable. Uploading a file again with the same bytes succeeds, so an interrupted import can be run again; a file with the same name and different bytes is refused, and the upload fails for it. devpi’s test results and documentation are not part of the index and are not moved.
A project first uploaded to devpi after your export is not in internal-py, so
through python it is still served from the devpi proxy. Run the script and the
upload again before the first upload to that project: the files already
there are uploaded again unchanged.
4. Switch the clients
A client needs the index address and a token. pip.conf holds the address, and
holds no secret:
[global]
index-url = https://sindri.example.com/pypi/python/simple/
pip finds pip.conf at ~/.config/pip/pip.conf (%APPDATA%\pip\pip.ini on
Windows), in /etc/pip.conf, or where PIP_CONFIG_FILE points. pip config debug lists the files it read. The token goes in ~/.netrc (mode 600), which pip
reads when the index URL has no credentials. Sindri ignores the user name, so
token is only a label:
machine sindri.example.com
login token
password YOUR_SINDRI_TOKEN
If you would rather keep the token in a keyring than in a file, name the user in
the index URL and tell pip to ask the keyring command:
[global]
index-url = https://token@sindri.example.com/pypi/python/simple/
keyring-provider = subprocess
keyring set https://sindri.example.com/pypi/python/simple/ token
keyring set asks for the token. pip runs the keyring command from its PATH,
and deliberately ignores one installed in its own environment, so install it
apart from pip, for example with pipx install keyring. (twine, which loads
keyring as a library, needs it in twine’s own environment instead; step 7.)
Then look for everything that still names devpi and remove it. Each of these keeps a client reading devpi directly, or worse, beside Sindri:
index-urlandextra-index-urllines inpip.conf,requirements.txt(-i,--index-url,--extra-index-url), andconstraints.txt;- the
PIP_INDEX_URL,PIP_EXTRA_INDEX_URL, andUV_*index variables in CI and Dockerfiles; [easy_install] index_urlinsetup.cfgor~/.pydistutils.cfg;index_urlfor devpi intox.iniandpyproject.toml([tool.uv],[[tool.poetry.source]]); and- the
devpi usesetting on a machine:devpiCLI users keep working against devpi until the server goes, but theirdevpi uploadshould becometwine upload(step 7).
5. Do not keep --extra-index-url
The old habit with devpi is a second index on the command line:
pip install --index-url https://sindri.example.com/pypi/internal-py/simple/ \
--extra-index-url https://sindri.example.com/pypi/devpi/simple/ acme-lib
Do not do this, even if both addresses are Sindri’s. pip does not treat the
indexes as an ordered list. It reads every one, merges all the files it finds for
the name, and installs the highest version, wherever that came from. Whoever can
publish a higher version of acme-lib to any of those indexes, including the
public one, is installed in place of the version you meant. That is dependency
confusion, and an extra index is how it enters.
A Sindri virtual repository is the replacement. It asks its members in order and
answers from the first one that holds the project, and a project that internal-py
has ever held is answered from internal-py alone. pip is given one index and
there is nothing to merge. Give every tool (pip, uv, tox, CI) the one python
address and no second index.
With the example above, a version of acme-lib that exists only on devpi is
installed, and a hosted version that is lower is ignored. Through python, the
hosted version is what you get. The gate shows both.
6. Check the clients without devpi
A client that holds no devpi credential cannot go around Sindri. Install a project the old index holds:
pip install --no-cache-dir acme-legacy==1.0.0
With the page’s pip.conf, ~/.netrc, and no devpi address anywhere, the file
comes from Sindri’s python repository, from the copy you imported in step 3. The
same filename has the same SHA-256 on both sides. A project that only devpi holds
is served by the proxy, which reads it from devpi as sindri-proxy.
7. Upload new releases to Sindri
Uploads go to the hosted repository, not the virtual one. Name it once in
~/.pypirc, without the token:
[distutils]
index-servers = sindri
[sindri]
repository = https://sindri.example.com/pypi/internal-py/upload
username = token
twine asks the keyring for the missing password, under the repository URL and the user name. Store the token there once:
keyring set https://sindri.example.com/pypi/internal-py/upload token
python -m build
twine upload --repository sindri dist/*
On CI, set TWINE_USERNAME and TWINE_PASSWORD from the secret store instead,
and leave the keyring out. devpi upload and devpi push do not talk to Sindri;
replace them with the two commands above. Clients that install through python
see the new release beside the history, because both are in internal-py once the
history is imported.
8. Switch devpi off
When nothing reads devpi but Sindri, stop uploading to it, remove devpi from the
python members, and then stop devpi. Do not remove the proxy before the history
is imported: the proxy is what keeps those versions installable. Remove the
sindri-proxy account when the server goes.
What this was checked against
The commands above run against a real devpi-server 6.21.0 in a pinned python
image, with devpi-web 5.2.0 and devpi-lockdown 2.0.0 behind nginx 1.28 so that
reads need a login. Sindri authenticates to it as sindri-proxy with a
username and password credential, and the check fails if Sindri cannot read
devpi’s index or its files. pip 26.3 and twine 7.0.0 run in a second container of
that image, with an empty home directory and a generated pip.conf, so nothing
from the machine that runs the check is read.
- A client with no devpi credential installs through Sindri, and nginx’s log in
front of devpi shows the file was read by
sindri-proxyand not by the client. pip.confwith~/.netrc,pip.confwithkeyring-provider = subprocess, andtwine uploadwith the password in a keyring all authenticate; the pip keyring case fails when the keyring is emptied.- The
--extra-index-urlform installs the devpi-only version of a project that hosted also holds, and thepythonrepository installs the hosted one. - A project is hidden from the proxy by one upload to hosted, and returns when its history is imported.
The check runs one process for Sindri and one container each for devpi, nginx,
and the clients, on one host; it does not isolate the machine’s network, and it
needs access to pypi.org, where pip, twine, and the public pypi member read
from. The keyring is a plain file backend (keyrings.alt), which tests the
keyring command’s contract, not an operating system’s secret store.
Not checked here: a devpi that serves HTTPS with a private certificate authority, devpi’s replica mode, and indexes that inherit from other devpi indexes.
The check runs the page’s configuration, client files, and commands out of the
page itself, with these substitutions: the example hosts devpi.example.com and
sindri.example.com become the hosts the check runs on, the netrc’s
YOUR_SINDRI_TOKEN becomes a token, machine names the container’s address for
the host, the check adds one trusted-host line to pip.conf because its Sindri
speaks plain HTTP, and in the publish block dist/* names the directory the check
built into, with python -m build run by the check’s own pinned build step. The
export script is also run against two small local listeners, one that serves a
devpi-style index whose file links point to a second host and redirect to it, to
see that the login never reaches that host.
Migrating from Harbor
You can move a team from Harbor to Sindri without a flag day. Sindri proxies your Harbor, hosts the images you move or push itself, and serves both through one repository, so clients change one registry name and Harbor can be switched off once nothing reads it. This page shows each step, and the script that checks it runs the commands below with the substitutions listed in What this was checked against.
Read the last section first. The check ran against a registry standing in for Harbor that uses Harbor’s token flow, not against Harbor itself. Statements about Harbor’s own behavior, which the check could not see, are marked “not checked”.
The method uses three OCI repositories:
- a proxy,
harbor, whose upstream is your Harbor, signed in as a robot account, so every image you already have stays pullable; - a hosted repository,
internal, where new images are pushed and where the history you want to keep is copied; and - a virtual repository,
images, over those two, which is the only address clients use.
The virtual repository lists the hosted repository first, and that order is a rule,
not a preference. An image name that hosted has ever held is claimed: the proxy
is never asked for its manifests. The claim is per image name (the whole path after
the repository name, such as acme/app), it covers every tag and digest of that
name, and it applies to manifests, not to blobs. The consequence is described in
Move the history before you switch anything
and decides the order of the steps: copy first, then switch clients, then push.
You need a Sindri server that can reach your Harbor over HTTPS, a Harbor robot account
that can pull from the projects you are moving, and Docker on the clients. Examples
write the two servers as https://harbor.example.com and
https://sindri.example.com, and the Harbor project as acme.
How Harbor concepts map
| In Harbor | In Sindri |
|---|---|
Project acme, repository app | The image name acme/app. The project is the first part of the name, and passes through the harbor proxy unchanged. |
A robot account robot$acme+sindri | For Sindri’s own reads of Harbor: a username and password credential on the harbor proxy. For your clients and CI: machine tokens, which are Sindri’s own. |
| A project’s members and roles | read and write on a repository, by group; see below. |
| Project quotas, retention rules, immutability rules | Not carried over; see What Sindri does not do yet. |
Sindri’s access rules attach to a repository, not to a path inside one. If your Harbor
projects have different audiences, give each audience its own hosted repository and
list each in the virtual repository’s members. Image names inside a hosted repository
must then match what the proxy serves: a name is acme/app in both. One
internal repository, as below, is the right start if one group may read everything.
1. Give Sindri a robot account on Harbor
Sindri reads your images as a Harbor robot account with pull permission on the
projects you are moving. Create it in Harbor; how is Harbor’s business and was not
checked. Harbor robot names look like robot$<project>+<name> (not checked). The
$ is the part that goes wrong: an unquoted $acme is an empty variable to the shell, which silently turns the
name into robot+sindri. Single-quote the name, and keep the secret in your secret
store:
export HARBOR_ROBOT_USER='robot$acme+sindri'
# HARBOR_ROBOT_PASSWORD comes from your secret store.
If the robot’s secret is revoked or stops working, Sindri’s reads of Harbor fail with a refusal that appears in Sindri’s log as a warning, and the proxy no longer serves tags it has not cached. That is the behavior of Sindri’s side, and the check exercises the refusal path only through the stand-in.
2. Declare the repositories
Add this to the Sindri configuration, next to your listen, storage, database, and
auth settings:
credentials:
harbor-robot:
username: ${HARBOR_ROBOT_USER}
password: ${HARBOR_ROBOT_PASSWORD}
defaults:
hosted: { read: [authenticated], write: [team:platform] }
proxy: { read: [authenticated] }
virtual: { read: [authenticated] }
repos:
harbor: { protocol: oci, upstream: { url: "https://harbor.example.com", ttl: 10m, negativeTtl: 1m, credentials: harbor-robot } }
internal: { protocol: oci }
images: { members: [internal, harbor] }
A robot account is a username and password credential. A token: credential is
refused on an OCI proxy: an OCI registry exchanges the name and secret at its token
realm for a short-lived token, and Sindri does that exchange for you. See
ADR 27 and the
credentials reference. The values are read from
the environment when the server loads the file, so the $ in the robot’s name needs
no escaping in the file.
The credential goes only to Harbor’s own origin. Harbor’s token realm, usually
https://harbor.example.com/service/token, is on that origin, so it gets the robot’s
login. A realm on another host gets it only over HTTPS, and a download that an upstream
redirects to another host is fetched without it (Sindri’s own tests cover the redirect;
the stand-in does not redirect). Check where your Harbor’s realm is: curl -sI https://harbor.example.com/v2/
prints it in www-authenticate.
ttl is how long Sindri trusts a tag it cached from Harbor before asking again. A
tag that moves in Harbor (latest) is therefore up to ttl stale through the proxy.
Digests do not move. Replace team:platform with the group that pushes.
3. Give your clients and CI tokens
A client needs the registry name and a token, and the copy in step 5 needs the push
token, so make the tokens first. Sindri issues machine tokens through
its API, which only an administrator may call. A puller needs read on everything it
pulls. A pusher needs write on internal:
printf 'Authorization: Bearer %s\n' "$SINDRI_ADMIN_TOKEN" |
curl -fsS -X POST https://sindri.example.com/api/v1/tokens \
-H @- -H 'Content-Type: application/json' \
-d '{"name":"ci-pull","role":"read"}'
printf 'Authorization: Bearer %s\n' "$SINDRI_ADMIN_TOKEN" |
curl -fsS -X POST https://sindri.example.com/api/v1/tokens \
-H @- -H 'Content-Type: application/json' \
-d '{"name":"ci-push","role":"write","repository":"internal"}'
Each response holds the token once, in token. Put it in your secret store as
SINDRI_PULL_TOKEN and SINDRI_PUSH_TOKEN. These replace Harbor’s robot accounts for
your clients and CI: one token per use, revocable on its own. Give a puller an
unscoped read token (as above). A token scoped to one repository, such as
images, cannot pull through it, because a virtual repository answers from its
members and the token is not scoped to them.
The header goes to curl on its standard input (-H @-), so the token never appears
on a command line, where ps and shell history would show it.
4. Take the inventory
Before you copy anything, list what Harbor holds. A robot account can list repositories
and tags over the registry API, with crane, a single static binary. The commands
below run crane from its published image and need only the two credentials:
printf '%s' "$HARBOR_ROBOT_PASSWORD" | crane auth login harbor.example.com -u "$HARBOR_ROBOT_USER" --password-stdin
printf '%s' "$SINDRI_PUSH_TOKEN" | crane auth login sindri.example.com -u token --password-stdin
crane auth login stores each credential for its own registry, in
~/.docker/config.json. This page has no script of its own that handles credentials: a
home-made script that keeps its Authorization header across a redirect would send the
robot’s secret to whatever host the registry redirects a download to (some registries
redirect to object storage). Use a maintained client such as crane, skopeo, or
oras instead. Whether crane drops the header on a cross-host redirect was not
checked here, because the stand-in does not redirect.
for repo in $(crane catalog harbor.example.com | grep '^acme/'); do
for tag in $(crane ls "harbor.example.com/$repo"); do
echo "$repo $tag"
done
done
This prints one repository tag line for every tag of every repository in the acme
project. Check the list against what you expect.
The stand-in lets the robot call /v2/_catalog. Not checked: whether your Harbor
does. If it refuses the robot, list the project’s repositories in another way, such as
Harbor’s own API or UI, and feed the names to the crane ls and crane copy lines
below in place of crane catalog. The check did not run any Harbor API call.
An image is a manifest, and for a multi-architecture image the manifest is an index that points at one manifest per platform. The inventory lists tags, and a tag can be an index. The copy below handles both.
5. Move the history before you switch anything
Do this before any client reads from Sindri and before the first push to internal.
Pushing acme/app to internal claims acme/app. From then on, through images,
Harbor’s tags of acme/app are not served, even a tag you never pushed to Sindri:
images/acme/app:1.0 answers 404 while harbor/acme/app:1.0 still serves it. There is
no merge of hosted and proxied tags for one name. Other image names are unaffected:
the claim is per name, so a push to acme/app does not hide acme/tools. So copy
every image and every tag you keep first. Until you switch the clients in step 6 they
keep reading Harbor, and nothing looks different to them while this runs.
Copying is a registry-to-registry copy of the manifests and blobs, not a
docker pull, docker tag, and docker push, because a docker round trip can
rewrite an index: the local daemon keeps only your platform’s image, and pushes one
platform back as a single manifest with a different digest. crane copy copies the
manifest bytes as they are, and for an index every manifest it lists, so the digests
are the same on both sides. --all-tags copies every tag of a repository, and
--no-clobber leaves a tag that already exists in Sindri alone, so the command can be
run again after an interruption without moving a tag someone has pushed to internal:
for repo in $(crane catalog harbor.example.com | grep '^acme/'); do
crane copy --all-tags --no-clobber "harbor.example.com/$repo" "sindri.example.com/internal/$repo"
done
Then compare, tag by tag, the digest Harbor reports with the digest Sindri reports. The command exits non-zero on the first difference:
for repo in $(crane catalog harbor.example.com | grep '^acme/'); do
for tag in $(crane ls "harbor.example.com/$repo"); do
a=$(crane digest "harbor.example.com/$repo:$tag")
b=$(crane digest "sindri.example.com/internal/$repo:$tag")
if [ "$a" = "$b" ]; then echo "ok $repo:$tag $a"; else echo "MISMATCH $repo:$tag $a $b"; exit 1; fi
done
done
What is preserved: every manifest and index byte, so every digest, and every tag you
list. A deployment that pins image@sha256:... keeps working. What is not: Harbor’s
own metadata. Tags’ push and pull times, scan results, labels, signatures and SBOM
attachments (they are separate artifacts that refer to the image, see below), and
immutability rules do not move. crane copy copies the image it is given; it does not look for other
artifacts that refer to it. Copy signatures and SBOMs separately if you rely on them
(not checked).
An imported image has Sindri’s push time, and its blobs are shared with every other image that has the same layers.
An image first pushed to Harbor after your copy is not in internal, so through
images it is still served by the harbor proxy. Run the copy again before the first
push to that image: --no-clobber skips every tag already there.
6. Switch the clients
The history is in Sindri, so clients can change. Change the registry name in image references, from harbor.example.com/acme/app
to sindri.example.com/images/acme/app, in Dockerfiles, Compose files, and
Kubernetes manifests. A client signs in with the token as the password; the user name
is not checked:
printf '%s' "$SINDRI_PULL_TOKEN" | docker login sindri.example.com -u token --password-stdin
docker pull sindri.example.com/images/acme/app:1.0
Kubernetes imagePullSecrets and container runtime mirror settings were not checked.
The pulled image has the digest Harbor had for the tag, because Sindri passed Harbor’s
manifest through unchanged. docker pull prints it on its Digest: line.
7. Check the clients without Harbor’s credential
A client holds only the Sindri token. Sindri holds the robot, so a read that reaches
Harbor comes from the robot account. The images you copied are now Sindri’s own, so
pulling one does not reach Harbor at all. An image that only Harbor has, such as one
pushed to Harbor after the copy, is read through the harbor proxy. In the check, the
stand-in’s request log shows the robot’s login for such an image, no read of a copied
one, and no request from the client. Look at your Harbor’s access logs the same
way (not checked): a person’s account still pulling the images you moved means that
client still talks to Harbor.
8. Push new images to Sindri
CI pushes to internal, with the push token. Clients that pull through images see
the new tag beside the history, because both are in internal once the history is
copied. Pushes go to internal, never to images: a push to a virtual repository
is refused.
printf '%s' "$SINDRI_PUSH_TOKEN" | docker login sindri.example.com -u token --password-stdin
docker tag acme-app:2.0 sindri.example.com/internal/acme/late:2.0
docker push sindri.example.com/internal/acme/late:2.0
The example pushes acme/late, an image first pushed to Harbor after the copy above,
to show why the copy has to be complete. After the push, ask for its Harbor tag
through images:
printf 'Authorization: Bearer %s\n' "$SINDRI_PULL_TOKEN" |
curl -s -o /dev/null -w '%{http_code}\n' -H @- \
-H 'Accept: application/vnd.oci.image.index.v1+json' \
https://sindri.example.com/v2/images/acme/late/manifests/1.0
It prints 404: the push claimed acme/late, and Harbor’s 1.0 is no longer
served, while harbor/acme/late:1.0 still has it. Run the copy again, and 1.0 is
in internal beside the new tag.
9. Pull by digest, with Harbor off
When nothing but Sindri reads Harbor, stop pushing to it, remove harbor from the
images members, and then stop Harbor. Do not remove the proxy before the history is
copied (step 5): until an image is copied, the proxy is what keeps its tags pullable. Remove the robot account when the
server goes.
Pulling by digest from internal is the proof that the history is Sindri’s own:
printf '%s' "$SINDRI_PULL_TOKEN" | docker login sindri.example.com -u token --password-stdin
docker pull "sindri.example.com/images/acme/app@$DIGEST"
DIGEST is the value crane digest printed for the tag you copied, and docker pull
prints the same value on its Digest: line.
What Sindri does not do yet
Be sure none of these is on your list before you switch Harbor off:
- Vulnerability scanning. Sindri does not scan images until M11a, so anything Harbor’s scanner gives you today has no equivalent. Scan the images some other way in the meantime; see ADR 23.
- Replication. Sindri has no replication between servers.
- Referrers from before the move. Sindri serves the OCI referrers API from 1.5, for what is pushed to a hosted repository. A proxy repository answers with an empty list, so signatures and SBOMs attached to an image in Harbor are not discoverable through the proxy: attach them again after you publish to hosted. See Signatures and SBOMs.
- Project quotas. Sindri has no per-project storage limit.
- Tag retention and immutability rules. Nothing is carried over from Harbor’s. Sindri has its own lifecycle stages and garbage collection, which work differently.
- Harbor’s robot-account permission model. A Sindri machine token has a role
(
read,write, oradmin) and optionally one repository or namespace. /v2/_catalog. Sindri does not serve it, so clients that list repositories through it do not work. Use the API or the UI.- Cross-repository blob mounts. A client that tries one is given a normal upload session, which costs a re-upload of the layer.
- A proxy’s tag list.
tags/listthroughimagesorharborshows the tags Sindri has cached or hosted, not what Harbor holds, so a client that lists tags to discover versions sees only what has already been pulled or copied.
What this was checked against
The commands above ran against a registry standing in for Harbor, not against
Harbor. The stand-in is the Distribution registry 2.8.3 (registry:2; Harbor’s registry
component is based on it, which was not checked) behind nginx 1.28, with cesanta/docker_auth 1.14.0 as its token server. It
reproduces the part of Harbor this page depends on: an anonymous request is refused
with a Bearer challenge, a robot named robot$acme+sindri exchanges its secret at a
token realm for a token that is good for pulling from the acme project only, and the
token goes to /v2/. nginx serves the registry and the realm from one origin, as
Harbor does, and the check fails if the stand-in lets an anonymous caller in. It has
none of Harbor’s API, projects, quotas, replication, scanner, audit log, or
redirect-to-object-storage blob downloads, and a real Harbor can differ in ways this
does not show. The robot-account listing through the API in step 4 was not run for that
reason. Run the steps against a Harbor you can afford to read from before you trust
them with a production one.
The check ran Sindri from this repository’s build, Docker Desktop’s Docker 29 for the
pulls and the push, and crane (go-containerregistry v0.21.0) from its published
image for the copy. Every image is pinned by digest in the script. It reads the
commands out of this page and makes only these substitutions: harbor.example.com
becomes the stand-in and sindri.example.com becomes the server on :8080, each as
the address the command runs against (this host for curl, the host’s name for
docker and crane); the page says HTTPS and the check speaks plain HTTP; and crane
runs through a wrapper in a container that adds --insecure and nothing else. The
check also seeds the stand-in itself, builds the local acme-app:2.0 image, and
pushes an extra image to the stand-in after the copy, as the page’s step 8 describes. What it asserts:
- The proxy authenticates to the stand-in with a
usernameandpasswordcredential whose name contains a$, quoted as shown. A client with no Harbor credential pullsacme/app:1.0through Sindri at Harbor’s digest. - A token scoped to the
imagesrepository cannot pull through it. - The inventory lists exactly the tags of the
acmeproject and leaves out the project the robot may not read. - After the copy, every tag has the digest Harbor reports (the images are
multi-architecture indexes), the copy can be run again, and
images/acme/appserves its tags, all before any client is switched. - A pull of a copied image through
imagesis served frominternal, and the stand-in never sees a request for it. An image pushed to the stand-in after the copy is read through the proxy with the robot’s login. - One push to
internal/acme/late, an image not yet copied, makesimages/acme/late:1.0answer 404 whileharbor/acme/late:1.0still answers, andacme/tools:1.0is unaffected. Running the copy again serves it. - With the stand-in stopped, a pull of the image by digest through
imagessucceeds frominternal. - The robot’s password and the machine tokens appear in no log.
The check is one process for Sindri and one container each for the registry, the token
server, nginx, and each crane run, on one host. It does not isolate the machine’s
Docker daemon, whose image cache and insecure-registry list are the machine’s, or its
network: the seed images come from Docker Hub. It runs plain HTTP where the page says
HTTPS. crane reads no configuration from the machine that runs the check.
Architecture decision records
Each record states one decision: its context, the decision, its consequences, and the alternatives that were rejected and why. Records are never rewritten to say something different. A later record amends or supersedes an earlier one and links back to it (ADR 1).
The list is in the sidebar, in the order the decisions were made.
1. Record architecture decisions
- Status: Accepted
- Date: 2026-09-21
Context
Sindri will be built incrementally across many separate working sessions, most of them with an AI assistant that starts each session without memory of the previous one. Any decision that is not written down will be re-litigated, and often re-decided differently.
Decision
We keep architecture decision records in docs/adr/, numbered sequentially, in the
lightweight format Michael Nygard described. One file per decision. Each states the
context, the decision, the consequences, and explicitly what was rejected.
Every decision a future session might plausibly reopen gets a record. The rejected alternatives matter as much as the choice.
Consequences
CLAUDE.mdpoints here, so a session reads the decision instead of re-making it.- Superseding a decision means a new record that references the old one. Records are never edited to say something different after the fact.
- There is a small tax on making decisions, which is the point.
2. Go, as a single binary with no runtime dependencies
- Status: Accepted
- Date: 2026-09-21
Context
The product promise is “starts with one Compose file, grows to a Kubernetes installation, one binary, not two products”. The competition’s weight is the thing we are selling against, so operational lightness is a feature and not an implementation detail.
Decision
Go, latest stable, compiled to a single static binary. Migrations, web assets, and
templates are embedded with embed.FS. One binary with several operating modes, never a
second product for “small” versus “large”.
Concretely this rules out a Node build step for the UI, which is why the UI is Go templates plus htmx.
Consequences
- Deployment is copying one file. Upgrading is replacing one file.
- Strong concurrency primitives for parallel uploads and background jobs.
- Natural fit with the Kubernetes and OCI ecosystem, whose libraries are Go.
- The UI is less ergonomic to build than a React application would be. Accepted: the v1 UI is read-only browsing, which templates handle well.
Rejected
- Rust. Comparable single-binary story and better raw throughput, but the OCI, Helm, and Kubernetes client ecosystem is Go, and we would hand-roll what we could import.
- Java or Kotlin. What Nexus and Artifactory chose. A JVM to operate and tune is precisely the weight we are positioning against.
- Separate frontend build. Breaks the single-binary promise the whole product rests on.
3. A content-addressable store with placement metadata
- Status: Accepted
- Date: 2026-09-21
Context
Sindri is multi-protocol. Five protocols could mean five storage layouts and five implementations each of lifecycle, promotion, policy, and scanning. That is exactly the accumulated complexity we criticise Nexus for, and it would be self-inflicted.
We also need deduplication: the same base-image layer appears in hundreds of images, and the same blob can arrive both through a proxy and through a hosted push.
Decision
One content-addressable store keyed by sha256. A blob is stored exactly once per digest.
Repository membership is placement metadata in Postgres, not a second copy.
Lifecycle, promotion, policy, and evidence live once in the core, above the CAS and below the protocol adapters. Adapters translate their wire format to core operations and own no storage layout.
Because deduplication makes every blob physically reachable regardless of who pushed it, every read must check placement before touching storage (invariant I2).
Consequences
- A third protocol adapter is genuinely cheap, which is the claim the architecture exists to support.
- Large storage savings on layers and wheels.
- Deletion cannot be a file delete. It is unlinking a placement, and reclamation is the garbage collector’s reachability pass.
- The placement check is a hard security boundary. Skipping it in one handler is a cross-tenant data leak, so it is a single shared function and a named invariant test.
Rejected
- Per-protocol storage trees. Simplest to start, but duplicates the core five times and makes cross-protocol lifecycle impossible.
- Reference counting for reclamation. Cheap reads, but a drifted counter either leaks
storage permanently or deletes live data, and it cannot be recomputed after the fact.
Reachability from tags and lifecycle states over
manifest_childrenis recomputable, which is worth the scan cost.
4. Lifecycle as an append-only event ledger
- Status: Accepted
- Date: 2026-09-21
Context
The differentiating idea is that an artifact is not copied between repositories as it
matures; its trust status changes. Conventional repositories model maturity as
docker-dev → docker-staging → docker-prod, copying bytes at each hop, which makes
“is this the artifact we tested?” a question of faith rather than of fact.
We also need an audit trail. “Who promoted this to production, when, and why” must be answerable months later, and audit retention is a planned commercial feature.
Decision
Lifecycle state is an append-only table, lifecycle_events, keyed by subject digest.
Promotion and revocation each append one row. No row is ever updated or deleted.
Current state is a database view selecting the latest event per
(subject_digest, repo_id, stage_id), with the key columns indexed because the admission
decision endpoint sits on the hot path of every deployment in the organisation.
Promotion applies only to hosted repositories (invariant I4).
Consequences
- Promotion is one
INSERT. Nothing is copied, and an integration test asserts the blob count in storage is unchanged across a full promotion sequence. - The audit trail is a byproduct rather than a second system, and audit retention becomes a query.
- Revocation preserves history instead of erasing it.
- Reads cost a view lookup rather than a column read. Accepted, and mitigated by indexes.
- The table grows without bound and will eventually need partitioning by time. Acceptable at v1 scale and a known follow-up.
Rejected
- A mutable status column. Faster to read and much easier to get wrong. It destroys
the audit trail, which is the feature. Explicitly guarded against in
CLAUDE.md, because “the view feels slow” is exactly how it would get introduced. - Copying between repositories per stage. The industry norm, and the thing we are arguing against: it multiplies storage and severs the identity link that lets you prove the artifact in production is the one that passed the tests.
5. Configuration as code with a reconciler
- Status: Accepted
- Date: 2026-09-21
Context
Two demands that pull against each other: teams want to create and shape their own repositories without filing tickets, and organisations want guardrails that teams cannot route around. Click-driven administration satisfies neither, because permission changes become invisible and unreviewable.
Decision
Two levels of declarative YAML. OrgPolicy sets binding guardrails including mandatory
and locked: true repositories. Repository lets teams define their own, including
virtual repositories with an explicit member order.
Manifests live in Git. A reconciler converges the database onto them and reports drift.
sindri apply -f and sindri diff -f are the interface, so existing CI drives it.
Two rules follow:
- Validation happens at write time, not per request. The download path must stay a lookup, and a misconfiguration should fail in a pull request rather than three weeks later on a developer’s machine.
- Structure is static, membership is live. Manifests name groups such as
team:payments; who belongs to that group is resolved against the identity provider at request time and never cached in the database.
Consequences
- Every permission change goes through code review.
- Configuration is reviewable, diffable, and revertible.
- Repositories created through the API are marked as API-managed and distinguished from config-managed ones, so the reconciler and the API cannot fight over the same row.
- Some administration requires a commit. That is the intent, not a limitation.
Rejected
- A Git-polling operator in v1. More moving parts and a second failure mode. A
directory-based
applythat CI calls covers the same ground; polling can come later without changing the manifest format. - Caching group membership in the database. A revoked team membership would keep granting access until someone re-applied, which recreates the invisible-admin problem this decision exists to remove.
6. OCI and PyPI first, other protocols after v1
- Status: Accepted
- Date: 2026-09-21
Context
The pitch names five protocols: OCI, npm, PyPI, Maven, and Helm. Building all five before a first release would roughly double the time to something usable, and would prove the same architectural point five times instead of once.
Decision
v1 ships two adapters: OCI and PyPI.
OCI is the anchor, because Harbor is the honest comparison and OCI is where Harbor is strong. PyPI is the second adapter because it is structurally unlike OCI: a simple index with immutable files, rather than manifests referencing layers. Two dissimilar protocols over one core is a real test of the abstraction.
npm, Maven, and Helm follow after v1, npm first because it introduces mutable metadata documents that neither v1 adapter exercises.
Consequences
- A usable release arrives in a reasonable time.
- The shared core is validated against two genuinely different shapes, so the claim that a third adapter is cheap is tested rather than asserted.
- Helm is nearly free later, since Helm charts are already OCI artifacts.
- Teams needing npm or Maven cannot adopt Sindri at v1. Accepted, and stated plainly in the roadmap rather than left as an implied promise.
Rejected
- OCI only. Would not test the multi-protocol core at all, and multi-protocol is the entire differentiator against Harbor. A second adapter arriving later would likely find the abstraction wrong, after the core had hardened around one protocol.
- All five in v1. Roughly doubles the work for diminishing architectural information.
7. A configuration surface that scales down: short form, long form, one reconciler
- Status: Accepted
- Date: 2026-09-21
- Relates to: ADR 5, Configuration as code, which this extends rather than supersedes
Context
ADR 5 settled that configuration is declarative YAML in Git, converged by a reconciler.
It described that configuration in one shape: enveloped kind/metadata/spec
documents, applied with sindri apply -f.
That shape was designed for the organisation with many teams, and it fits that case well.
It fits the opposite end badly. A single team running Docker Compose has no organisation
to govern, one file rather than a directory, and one process rather than a cluster.
Handing them an OrgPolicy document, a kind envelope around every repository, and a
separate apply step is ceremony with nothing bought for it.
That matters more here than it would elsewhere. “Starts with one Compose file” is the product’s central promise, and small and mid-sized teams are the first adoption target. A configuration surface that feels like Kubernetes to a two-person team contradicts the pitch at the exact moment of first impression.
Two observations shaped the decision. First, the Kubernetes feel comes mostly from the workflow, the separate apply step against a reconciler, rather than from the envelope. Second, the envelope and the workflow are independent, so they can be fixed separately.
Decision
Three parts.
A short form that desugars into the long form
One schema, one loader, two spellings. The short form is a flat sindri.yaml with a
repos: map; repository type is inferred from which key is present (members means
virtual, upstream means proxy, neither means hosted, both is an error). A virtual
repository’s protocol is inferred from its members, which must all share one protocol.
Upstreams accept a named preset. The long form is the enveloped document set from ADR 5.
Desugaring is one-way and total. The short form has no representational power the long form lacks. Loading produces long form, and nothing downstream may branch on which spelling was written.
OrgPolicy becomes optional: absent means mode: delegated with no mandatory
repositories. Adopting governance is adding a file, never migrating a format.
One reconciler, two triggers
sindri serve --config sindri.yaml reconciles on boot and on SIGHUP.
sindri apply -f <dir> reconciles from CI against a running server. The reconciler is identical; only the
invocation differs. This removes the apply step entirely for single-node installations and
is the larger half of making the configuration feel native to Compose.
Two commands that keep the sugar honest
sindri config check validates statically, with no database and no server. sindri config show --expanded prints the desugared long form.
Consequences
- A complete two-protocol setup with lifecycle stages is about fifteen lines, and needs no apply step. That is the Compose-scale experience the pitch promises.
- The enterprise path is unchanged from ADR 5. Nothing is taken away.
config show --expandedmakes the inference inspectable, so the short form is discoverable sugar rather than magic, and it is the natural first tool when resolution order surprises someone.config checkruns in CI with no infrastructure, which suits teams whose entire deployment is a Compose file.- Two spellings are more surface to maintain and to document. Accepted, and bounded by the one-way desugaring rule plus a golden test asserting both spellings of one setup produce identical internal trees. Without that test this decision becomes two parsers that drift, so the test is part of the decision, not an implementation detail.
- Type inference means a reader cannot see a repository’s type without knowing the
inference table. Mitigated by keeping explicit
type:valid, and byconfig show --expanded.
Rejected
- Only the enveloped long form. Correct for the enterprise, actively hostile to the first adoption target, and contradicts the product’s own pitch.
- Only a flat short form. Cannot express multi-team governance, and would have to grow an envelope later under pressure, which is how configuration formats acquire two incompatible generations.
- A separate simplified config file for Compose users. The obvious shortcut and the worst outcome: two schemas, two validators, two documentation sets, and a translation layer that silently drifts. One schema with two spellings costs a desugaring pass and a golden test.
- Collapsing a virtual repository and its members into one entry, such as
python: {hosted: ..., proxy: ...}. The most tempting piece of sugar available and firmly rejected. The proxy/hosted/virtual separation is the dependency-confusion defence of invariant I5. Hiding it in configuration teaches users to stop reasoning about it, and the guarantee then erodes socially even while the code still enforces it. Sugar may make the three types cheap to declare; it may not make them invisible. extends:for repository templates. Per-typedefaults:plus YAML anchors cover the real cases. Transitive template inheritance is a well-known road to unreadable configuration. Revisit with a new ADR if per-type defaults prove insufficient.- A Git-polling operator to remove the apply step. Reconcile-on-boot achieves the same thing for the single-node case with no extra moving parts. Polling remains available later without a format change, as ADR 5 already noted.
8. Staged uploads belong to the BlobStore
- Status: Accepted
- Date: 2026-09-21
- Relates to: ADR 3, A content-addressable store with placement
Context
A blob’s storage key is the hash of its bytes, which the server may only learn after it has received all of them. That leaves a window between “bytes are arriving” and “the digest is verified”, and where those bytes live during that window decides whether an unverified payload can ever occupy a content-addressed key.
ARCHITECTURE.md section 6 originally gave BlobStore five methods, all keyed by digest:
Put, Get, GetRange, Stat, Delete. There was no way to express “write these bytes
somewhere that is not yet a content address”, so the staging step had nowhere to live
inside the storage abstraction.
Two further facts shaped the decision. OCI chunked push (M3) appends to one upload across several HTTP requests, so staging state outlives a single request. And S3 can assemble a multipart upload and copy it server side, so a commit need not move bytes through Sindri’s process at all.
Decision
BlobStore gains four methods, and staging becomes a storage concern:
CreateUpload(ctx) (UploadID, error)
Append(ctx, id UploadID, r io.Reader) (offset int64, err error)
CommitUpload(ctx, id UploadID, digest Digest) error
AbortUpload(ctx, id UploadID) error
internal/cas is the only caller. It hashes what it appended, compares that against the
digest the client claimed, and calls CommitUpload only on a match; a mismatch calls
AbortUpload. Put remains for payloads already in memory and already hashed, such as
manifests and evidence documents.
The filesystem backend stages to staging/<id> and commits with os.Rename, which is
atomic within a filesystem. The S3 backend accumulates multipart parts under a staging key
and commits with CompleteMultipartUpload followed by a server-side CopyObject; an
upload too small to have flushed a part is written straight to its content-addressed key
at commit, which is safe for the same reason Put is.
Consequences
- No unverified byte is ever reachable at a content-addressed key, on either backend. The
conformance suite asserts it, and
internal/casasserts that a rejected upload leaves neither a blob nor a staging object behind. - Committing a multi-gigabyte layer moves no bytes through Sindri on either backend: a rename on a filesystem, a server-side copy on S3.
- The interface is four methods wider, and every future backend implements them. That is the cost, and the shared conformance suite is what keeps it from becoming four methods that behave differently per backend.
- M3’s chunked upload has a home:
Appendalready returns a running offset, which is what the OCIRangeresponse header reports. - Known limit. S3 upload sessions are held in process memory, so an upload cannot be
resumed by a different instance. This is invisible in v1, where
sindri serveis one process, and it must be revisited when the post-v1 split serve modes arrive. The fix is known: recover the multipart upload by listing in-progress uploads for the staging key. That is deliberately not built before something needs it.
Rejected
- Staging to a local temporary file inside
cas. The simplest option, and the one that keeps the interface at five methods. Rejected because every S3 upload would be written to local disk and then re-uploaded, doubling I/O and requiring local disk sized for the largest artifact; and because an upload that spans several requests would have no correct home on a host that is not guaranteed to be the same one next time. - Putting bytes at the content-addressed key and deleting on a mismatch. A window in which a partially uploaded blob is readable under a digest that is not its own. That is a supply-chain vulnerability, not a race to be narrowed.
- A separate
StagingStoreinterface. KeepsBlobStoreunchanged, but thencasbranches on whether a backend supports staging, and a backend without it silently takes a different, weaker write path. One interface, one conformance suite, no branch.
9. One configuration loader, built in M1
- Status: Accepted
- Date: 2026-09-21
- Relates to: ADR 7, A configuration surface that scales down, which this implements
Context
M1 needs three settings: a listen address, a storage location, and a database URL. M7 adds
repos:, lifecycle:, and defaults: to the same file, with short and long forms, a
reconciler, and config check.
The tempting M1 move is a twelve-line loader: read the file, yaml.Unmarshal into a
struct, done. The cost lands in M7, which arrives to find a throwaway format in production
and ships a second one beside it. roadmap.md names this the most likely self-inflicted
wound in the plan, and it is the one failure this decision exists to prevent.
Decision
internal/config is built in M1 as the loader for the life of the project, with four
properties that are cheap now and expensive to retrofit.
Unknown keys are an error, at every level. yaml.v3’s KnownFields reaches only the
top-level document, so a section with its own UnmarshalYAML would silently ignore a
typo and keep its default. Every section therefore decodes through one strictDecode
helper that checks each key against the struct’s yaml tags. A mistyped pth: fails at
load instead of quietly writing blobs somewhere else.
Environment substitution walks parsed scalar nodes, never the raw text. ${VAR} and
${VAR:-default} are expanded after parsing, on string scalars only; $$ is a literal
dollar. An unset variable with no default is an error rather than an empty string.
Every section accepts a short form that desugars totally. listen: :8080,
storage: ./data, storage: s3://bucket/prefix, database: postgres://... and
log: debug each expand into the mapping form during loading. Nothing downstream can ask
which spelling was written. A golden test loads the same setup in both spellings and
asserts the resulting trees are identical.
Durations carry units. readHeaderTimeout: 30s is valid, 3600 is rejected.
Consequences
- M7 extends this file by adding fields and sugar rules, not by replacing a parser.
- The golden test that keeps two spellings honest exists from M1, which is when it is cheap to write, rather than from M7, which is when it is needed.
- Errors name the file, the line, and the field, because the tree is decoded through
yaml.Noderather than straight into a struct. That is the foundationconfig checkneeds in M7. - A password or bucket name containing
#or:survives substitution intact, which a text-level expansion would have corrupted or silently truncated. - More code than M1 strictly requires: roughly 400 lines instead of 50, and one reflection helper. Accepted deliberately.
- The default database URL carries the development credential from the Compose file, so
sindri serveworks aftermake upwith no configuration at all. It is annotated forgosecwith that justification and must never reach a deployment manifest.
Rejected
- A minimal M1 loader, rewritten in M7. The wound this ADR exists to avoid. By M7 the throwaway format is in running deployments, and replacing it is a migration rather than a refactor.
- Expanding
${VAR}over the raw file before parsing. Shorter, and how most tools do it. A value containing YAML punctuation then changes the document’s structure, and every error loses its line number. - Environment variables as an override layer (
SINDRI_LISTENbeating the file). It is a second configuration system with its own precedence rules, which ADR 7 rules out.${VAR:-default}inside the file covers the same need, visibly. - Allowing an unset
${VAR}to expand to an empty string. How a storage path silently becomes the working directory.
10. OCI hosted adapter placement and anonymous /v2
- Status: Accepted
- Superseded in part by: ADR 18:
/v2is no longer anonymous - Date: 2026-09-24
- Relates to: ADR 3, A content-addressable store with placement, ADR 8, Staged uploads belong to the BlobStore
Context
M3 adds the OCI distribution-spec adapter under /v2. Two questions land at the
same time: how a layer digest becomes readable under invariant I2 before any tag
exists, and whether /v2 reuses the management API’s static bearer for M3.
A docker push uploads blobs first and only then puts a manifest that tags them.
Between those steps clients HEAD and GET the blob. CheckPlacement that only
looks at files and tags cannot admit those digests. Walking manifest_children
from tags also fails, because there is no tag yet.
Decision
repository_blobs(repo_id, digest) records that a digest was uploaded or
written as a manifest into a repository. CheckPlacement unions this table with
files and tags. manifest_children is still written on every manifest put so
garbage collection can walk the graph later; it is not the read gate for M3.
/v2 is unauthenticated in M3. The management API keeps the static bearer.
M7 wires the existing auth.Authenticator seam onto protocol adapters; inventing
a second token scheme for docker login now would be throwaway work.
Hosted OCI repositories are created on first write when absent, matching every
other OCI registry’s push UX and what distribution-spec conformance expects for
dynamically named mount destinations. Explicit /api/v1 create remains valid.
Chunked upload sessions stay in process memory on cas.Store (same v1 limit ADR 8
recorded for S3 multipart state). ResumeUpload recovers the live digester across
HTTP requests on one sindri serve process.
Cross-repository blob mounts remain unimplemented: a ?mount= POST falls back to
a fresh upload session (202), as the distribution specification allows.
Consequences
- Cross-repository blob GETs still 404: placement is per repository.
- Content-management DELETE unlinks
repository_blobs(or a tag); bytes remain for the future GC pass. - Local docker and upstream conformance run without credentials against a development binary. Production auth is an explicit M7 deliverable.
Rejected
- Placing every uploaded blob as a
filesrow under a synthetic package. Works with the existingCheckPlacement, but pollutes the management API’s package listing with OCI plumbing and confuses the PyPI naming model. - Requiring a tag before any blob is readable. Breaks the push sequence and distribution-spec conformance.
- Docker login with the static bearer in M3. Possible, but conformance and the gate scripts then need credential plumbing that M7 will replace anyway.
- Implementing cross-repository mounts in M3. Out of scope; the spec’s fallback-to-upload behaviour is enough for conformance.
11. The MinIO test image comes from Bitnami’s archive
- Status: Accepted
- Date: 2026-09-25
- Relates to: ADR 3, A content-addressable store with placement, ADR 8, Staged uploads belong to the BlobStore
Context
testcontainers-go starts a real MinIO for the storage conformance suite, the
CAS suite, and make up. M1 moved that image to quay.io because MinIO’s Docker
Hub repository had stopped serving anonymous pulls.
quay.io has since closed too. Both quay.io/minio/minio and Docker Hub’s
minio/minio now answer an anonymous manifest request with 401, for the pinned
tag and for latest alike, and quay’s API refuses unauthenticated listing. CI
failed on main before the M3 pull request ran:
starting MinIO: run minio: generic container: create container:
Error response from daemon: unauthorized: access to the requested resource is not authorized
Only machines with a warm image cache were unaffected, which is why the failure
looked local to CI and why make up was quietly broken for a fresh clone.
The suite needs a server that implements what s3store actually calls: the full
multipart sequence (CreateMultipartUpload, UploadPart, CompleteMultipartUpload,
AbortMultipartUpload) plus CopyObject, HeadBucket, HeadObject, and the
object verbs.
Decision
The image is bitnamilegacy/minio, pinned to 2025.7.23-debian-12-r5. It is
the same MinIO server, it pulls anonymously, and it publishes linux/amd64 and
linux/arm64, so Apple Silicon and CI runners agree. make up takes
bitnamilegacy/minio-client for the one-shot bucket create.
internal/testsupport drives the container directly instead of through
testcontainers’ minio module. That module hardcodes --cmd server /data, which
the Bitnami entrypoint does not accept and whose data directory its non-root user
cannot write. The module gave us three lines: an exposed port, two environment
variables, and a wait strategy. Inlining them costs less than fighting it.
The pin stays a pin: a test failure remains a change in Sindri, never a change upstream.
Consequences
- Bitnami froze this archive on 2025-08-19 and does not support it. That is tolerable precisely because the reference is pinned — an unmaintained image cannot regress under a fixed tag, only disappear.
- If the archive is pruned, the fallback is mirroring the pinned image into a
registry this project controls. Nothing about the suite changes in that case;
only the constant in
internal/testsupport/minio.goand the compose pins move. make upand the integration suite still need no credentials, so a clone still runsmake test-integrationwith nothing but Docker.- The compose volume moved from
/datato/bitnami/minio/data. A developer with an existingsindri-dev_minio-datavolume gets an empty bucket once andminio-initrecreates it. StartMinIOwaits for the entrypoint’s “MinIO setup finished!” log line as well as the health endpoint, because this image’s entrypoint runs a throwaway MinIO for about five seconds, stops it, and then starts the real one (SIN-67). A repin must recheck that wait: it depends on the pinned entrypoint, andTestStartMinIO_ReturnsOnlyOnceTheRealServerIsRunningfails if the line goes away.
Rejected
- Authenticating to MinIO’s registry in CI. Keeps the exact image, but breaks
clone-and-
make test-integrationfor everyone without credentials, and the restriction that closed anonymous access is commercial, so a free account may not grant the pull at all. - Mirroring the pinned image into GHCR now. Works, and stays the fallback, but it makes this project responsible for redistributing and retaining someone else’s binary before that cost has to be paid.
- Swapping MinIO for SeaweedFS, LocalStack, or a mock such as s3mock. All pull freely. A mock is out on principle: CLAUDE.md says real Postgres and real MinIO, not fakes, and the storage suite’s whole job is to catch what a fake would paper over. Replacing MinIO with another real server is a larger change than the failure justifies, and would be reconsidered on its own merits rather than under a broken build.
- Unpinning to
latest. Makes every future upstream change a Sindri test failure, which is the thing the pin exists to prevent.
12. PyPI hosted adapter: placement, auth, and download paths
- Status: Accepted
- Superseded in part by: ADR 18: the index, downloads, and uploads all authenticate
- Date: 2026-09-26
- Relates to: ADR 6, OCI and PyPI first, ADR 10, OCI hosted adapter placement
- Amended by: ADR 13, write-time validation and immutable files, which sets what an upload must prove before it is placed
Context
M4 adds the hosted PyPI adapter under /pypi. Placement for file protocols
already exists as files rows via registry.Publish. Several questions land
together: whether to auto-create repositories on upload (as OCI does), how to
treat twine’s mandatory Basic credentials before M7 auth, where pip downloads
files from, and how repository names that contain slashes are routed.
Decision
Placement is the files row. A twine upload is registry.Publish: bytes
land in the CAS, and a files row places them. CheckPlacement already unions
files, so invariant I2 needs no repository_blobs for PyPI. Wheel and sdist
fields such as requires_python live in files.metadata jsonb.
No auto-create. A PyPI repository must exist via /api/v1 (or later the
reconciler) before upload. Twine always targets an explicit repository URL;
creating the row on first POST would hide a misconfigured URL. This differs
from OCI, where docker and distribution-spec conformance push to undeclared
names.
Auth mirrors ADR 10 for M4. Simple index and package downloads are
anonymous so the pip install --index-url gate needs no credentials. Upload
accepts HTTP Basic because twine requires a username and password, but does
not validate identity against the static bearer. M7 wires the existing
auth.Authenticator seam onto protocol adapters; inventing Basic-token
validation now would be throwaway work.
Download path. Files are served at
/pypi/{repo}/packages/{project}/{filename}, where {project} is the PEP 503
normalized name. Simple-index links are absolute to that path and carry
#sha256={hex} fragments plus data-requires-python when known.
Slash-safe dispatcher. Repository names may contain / (same
validateRepoName as the management API). The adapter mounts at /pypi as a
plain handler and splits on /simple/, /upload, and /packages/, matching
the OCI mid-path approach.
Consequences
- Cross-repository package GETs still 404: placement is per repository.
- Operators create a hosted
protocol: pypirepository before the first twine upload; the gate script does this via/api/v1. - Local
pip installagainst a development binary needs no credentials. Production auth remains an explicit M7 deliverable. - ARCHITECTURE.md section 7 lists the
/packages/download path alongsidesimpleandupload.
Rejected
- Auto-create on first upload. Hides typos in
--repository-urland differs from the operator expectation that a private index is declared. - Validating Basic against the static bearer in M4. Twine always sends credentials; checking them against the management-API token would invent a second auth mapping that M7 replaces.
- Requiring credentials on simple/download. Breaks the roadmap gate and
every anonymous
pip install --index-urlworkflow used in development. - Serving downloads only under
/simple/.... Pip follows absolute file URLs; a dedicated/packages/path keeps the index HTML small and makes content-type and Content-Length handling obvious. - Chi
{repo}single-segment routes. Would reject valid repository names that contain slashes.
13. PyPI write-time validation, immutable files, and what the index says
- Status: Accepted
- Date: 2026-09-26
- Relates to: ADR 12, PyPI hosted adapter, ADR 3, content-addressable store
Context
A review of the M4 adapter found the upload path accepted whatever the client
asserted. The name and version form fields were trusted, the wheel’s own
METADATA was only a fallback for missing fields, the filename was stored
verbatim, and a second upload of a filename replaced the first through
UpsertFile’s ON CONFLICT DO UPDATE.
The same review found the index side describing the request rather than the
repository: download links were absolute URLs built from the Host header, the
root listing silently stopped at one page of 200 projects, content negotiation
ranked media types by position rather than by q=, and the JSON payload carried
PEP 700’s fields while declaring api-version 1.0.
Each of the upload problems is fine in isolation and wrong together. pip
derives the project and version from the filename, not from the index entry,
so an upload that
declares name=demo&version=9.9.9 while shipping evil-1.0.whl produces an
index nobody can install correctly. Replacing bytes under an existing filename
breaks the consumer who recorded that file’s hash, which is the entire promise
of a supply-chain registry. And the files unique constraint is
(version_id, filename), so one filename could exist under two versions while
the download path (/pypi/{repo}/packages/{project}/{filename}) has no version
segment to disambiguate with.
Decision
The artifact is the authority; the form fields say where it goes. Upload
extracts the wheel METADATA or sdist PKG-INFO, parses the project and
version out of the filename, and rejects the upload unless all three agree. The
project is compared after PEP 503 normalization and the version after PEP 427
escaping, so Demo.Package matching demo_package and 1.0.0+local matching
1.0.0_local are agreement, while 1.0.0 against 9.9.9 is not. Placement
uses the metadata’s version when the artifact carries one.
Filenames are validated, not sanitized. A filename must be at most 256
bytes of [A-Za-z0-9._+-], must not start with a dot or contain .., and must
end in .whl, .tar.gz, or .tgz. mime/multipart already applies
filepath.Base, so a separator never reaches the handler over HTTP; the check
exists because the download path serves the filename as one path segment and
quotes it into Content-Disposition, and a name that cannot survive that round
trip must not enter the database.
A published file is immutable. PublishParams.Immutable places the file
with InsertFileImmutable, whose DO UPDATE refreshes only derived columns and
fires only when the stored digest already equals the incoming one. Re-uploading
identical bytes is therefore idempotent (twine retries, CI re-runs), and
re-uploading different bytes returns no row, which surfaces as
registry.ErrFileExists and HTTP 409. The same publish transaction also
rejects a filename already placed under another version of the package, which
is the constraint the schema cannot express because files has no
package_id. GetFileByFilename additionally orders and limits to one row, so
even pre-existing data cannot make a download non-deterministic.
A deleted filename stays taken (SIN-52). Deleting a file from a hosted
repository records (package, version, filename) in retired_files in the
delete’s transaction. A publish checks the filename against that table after its
insert, in the same transaction, whichever version the filename was under, and
refuses with ErrFileExists (409). Without this, deleting a file freed its name
and a resolver that had already seen the filename could be served new bytes under
it. This is a behaviour change: re-uploading a deleted filename was accepted, and
is now refused even with identical bytes, because “same bytes” cannot be told
apart from “same name, new build” once the original is gone. A new version is the
way forward. The filename match is exact: a variant spelling such as our_lib for
Our_Lib is not caught, and a different filename in the same version is accepted anyway.
The rule covers every publish into a hosted PyPI repository, including the
management API’s non-immutable one, which answers 409 FILE_EXISTS. It does not
apply to hosted OCI-protocol repositories, whose API files can still be deleted
and put again. Proxy repositories record nothing, so a
cached file can be placed again. Files deleted before the migration are not
remembered.
The upload streams, and the adapter hashes once. The part is not read into
memory. It is hashed where the multipart reader left it (memory budget or a
temporary file), the client’s sha256_digest is compared against that hash, and
the same reader is handed to cas.Put as ExpectDigest. The digest passed into
the CAS is always one Sindri computed over the bytes it received, never a client
claim, because that digest is also the deduplication key: cas.Put short
circuits on Stat when the expected digest is already stored.
The index describes itself, and never the request. Download links are
root-relative paths (/pypi/{repo}/packages/{project}/{filename}). An absolute
URL has to come from somewhere, and per request the only sources are the Host
header and X-Forwarded-Proto, both client input; reflecting them puts a value
the requester chose into the index served back to it. A relative path resolves
against the origin the client actually reached, so TLS termination, a port
mapping, and a rename need no configuration.
The root index lists the repository, not a page of it. simpleRoot walks
every cursor page. A truncated root listing is indistinguishable from a complete
one to a client, which is the worst way for a package to go missing.
Content negotiation follows quality values, not header order. PEP 691
clients spell their preference with q=, and position only breaks a tie. A
client that asks for neither serialization (a browser sending */*) gets HTML.
The JSON API declares 1.1, the HTML API declares 1.0. The JSON
serialization carries PEP 700’s versions and size, so it is a 1.1 document.
The HTML serialization has nowhere to put those fields, so its PEP 629
pypi:repository-version meta tag says 1.0. One number in both places would
mean one of them is a claim the payload does not support, and clients ignore a
minor difference while rejecting a major one.
Adapter path markers are reserved repository name segments.
validateRepoName rejects blobs, manifests, tags, uploads, simple,
packages, and upload as name segments. Repository names may contain
slashes, so without this /pypi/team/packages/simple/foo/ names either the
simple index of team/packages or a download from team, and a project
legitimately called packages collides with the download route. With the
reservation, the PyPI dispatcher takes the leftmost marker segment and is
unambiguous.
Amendment (SIN-75, v1.5.1): one filename, one version
The same-package guard above ran only for Immutable publishes, which the PyPI
adapter sets and the management API does not, so an API publish could still place
one filename under two versions. The guard now runs on every publish into a hosted
PyPI repository, inside the package lock, and the API answers 409 FILE_EXISTS.
A non-immutable re-publish under the same version is still an upsert; only a
different version is refused. Proxy and npm repositories are unchanged.
Delete follows the same rule. Deleting a file from a hosted PyPI repository removes
the filename under every version of the package, records a retired_files row for
each version it was under, and removes each version it empties, in the one
transaction. The API route stays addressed to one version; a delete addressed to
a version that holds the filename removes it from all of them, and one addressed
to a version without it answers 404. npm stays version-keyed.
GetFileByFilename’s “first row” ordering can no longer choose between duplicates
for data written from now on. It remains only for data that predates this change,
which is not rewritten: a legacy duplicate is served from its lowest version until
it is deleted, and the delete clears every copy. A unique index on
(package_id, filename) stays rejected for the reason below.
Consequences
- Twine and
python -m builduploads are unaffected: both derivenameandversionfrom the same metadata the artifact carries. - A rejected re-upload leaves its bytes in the CAS unreferenced, because the CAS write precedes the placement transaction. That is GC’s problem (M8), and the alternative is a check-then-write race.
scripts/pypi-twine-gate.shstamps a unique1.0.0.postYYYYMMDDHHMMSSversion per run, because a wheel is not byte-reproducible and the gate must stay re-runnable. It also asserts the 409.- Existing repositories whose names contain a reserved segment keep working for reads but can no longer be created. No deployment has one: the rule lands in the same release as the PyPI adapter.
- M5 inherits the rule that placement never trusts a client-declared name, which is what the name-claim rule needs to be enforceable.
- Sindri must be served at the root of its origin for index links to resolve,
which is already true of
/v2for OCI clients. - The root index is rendered in memory. That is bounded by the response body it is about to write, not by the project count, so streaming it is an optimization and not a correctness fix.
Rejected
- Sanitizing instead of rejecting. Quietly rewriting a filename or picking one of two disagreeing versions leaves the index describing something other than what was uploaded. A 400 tells the publisher which of their two sources is wrong.
- A unique index on
(package_id, filename).filesreferences a version, not a package, so this needs a denormalized column and a backfill. The in-transaction guard buys the same property now; the column can come with the schema change M6 already brings. - Trusting
sha256_digestas the CAS expected digest. It is the cheapest path (dedup without hashing) and it makes a client’s claim decide what gets stored. Hashing the received bytes costs a local read of a file already on disk. - Buffering the upload to keep one hash pass. 512 MiB per concurrent upload in exchange for avoiding a local re-read of a temporary file.
- Allowing a re-upload to replace bytes when the uploader is the owner. Ownership is not the issue; a consumer who already resolved that filename is.
- Rejecting reserved segments in each adapter. Two adapters, two lists, and a third protocol arrives to find neither. The name is validated once, where it is created.
- A configured external base URL for download links. It is the right answer for exactly one deployment shape, files served from a different origin than the index, and nothing asks for that yet. Relative links are correct for every other shape and cost no configuration. Adding the key later changes a link’s spelling, not the schema.
- Reflecting
X-Forwarded-Protowhen a trusted-proxy list is configured. The same outcome as relative links, with a list to maintain and a way to get wrong. - Capping the root index with a documented limit. A limit a client cannot see is not documentation.
14. Proxy cache and virtual resolution
- Status: Accepted
- Date: 2026-09-30
- Relates to: ARCHITECTURE.md sections 2 (I4, I5) and 4, ADR 3, ADR 12
Context
M5 adds proxy and virtual repositories. Four questions land together: how an OCI path that nests an image name inside a Sindri repository is routed, how upstream failures interact with the cache, how streaming a large first pull stays correct under content-addressing, and where upstream credentials live.
Decision
OCI longest-prefix routing. On /v2/..., choose the longest existing
repository name that is a prefix of the path (equal, or followed by /). The
remainder is the image name stored as packages.normalized_name. No remainder
keeps the M3 shape: the repository name is the image and tags hang off package
_. Writes to a matched proxy or virtual repository are rejected; unknown
write paths still auto-create a hosted repository for the full name.
Negative cache is separate from positive. remote_cache.status is hit or
miss. Only an upstream 404 writes miss. A 5xx, timeout, or truncated body
leaves the row unchanged and never replaces a previous hit. Fresh miss skips
upstream; expired hit refetches and falls back to the stale hit when upstream
is down. An upstream 401/403 is a refusal, and what it means depends on the protocol (amended by
SIN-55, 2026-11-04). Sindri’s own credential failing is not evidence the name is absent, and
treating it as absence lets a later member answer for a name the refusing one exists to serve
(dependency confusion), so a refusal fails the walk. ErrUpstreamDenied wraps
ErrUpstreamUnavailable: a virtual answers 502, a direct proxy read answers 502, a stale
copy still serves, and it is never negatively cached, so a corrected credential works at
once. Docker Hub and quay.io answer 401 for a name they do not have even to a valid token,
and ghcr.io answers 403 at the token endpoint to an anonymous caller asking for an unknown
name (both checked 2026-11-04). Those stay misses (ErrUpstreamHidden, also never
negatively cached), or a virtual such as [dockerhub, ghcr] could never reach its second
member.
| Case | Result |
|---|---|
| npm or PyPI 401/403, with or without credentials | Denied |
| OCI 401/403 where the request carried a Bearer token, no credentials configured | Hidden |
| OCI 401/403 where the request carried a Bearer token, credentials configured | Denied |
| OCI token endpoint 401/403, no credentials configured | Hidden |
| OCI token endpoint 401/403, credentials configured | Denied |
| OCI 401 with no bearer challenge, or 401/403 with Basic | Denied |
The credentialed Bearer row is a user decision of 2026-11-04: a login that still gets a
token but has lost access to a private image must not fall through to a public member. The
cost is that Docker Hub answers 401 for an unknown name even to a valid login, and the two
cases cannot be told apart. In a virtual such as [hosted, dockerhub-with-login, ghcr], an
image that exists only on ghcr therefore gets a 502, unless the logged-in proxy is last or
runs anonymously. A cached bearer token counts as a Bearer request. A request redirected off-origin has lost
its Authorization header, so its 401 is Denied, not Hidden. The ghcr.io caveat: Sindri cannot
tell an anonymous refusal for a name that does not exist from one for a private name, so a
ghcr.io proxy without credentials reads both as a miss. The credentialed ghcr.io case was not
verified live (no credential was available).
Verified live on 2026-11-05 against Docker Hub and ghcr.io, at the head of the M9 gate branch
(m9-gate-v1.1.0), through a real sindri serve with anonymous dockerhub and ghcr
preset proxies and the virtual repositories [dockerhub, ghcr] and [ghcr, dockerhub].
Manifest GETs with the bootstrap token gave the same result in both orders: library/alpine
answered 200, an unknown name (no-such-org-zz/no-such-image-zz) answered 404, and
dexidp/dex:v2.46.1, which exists only on ghcr, answered 200. Only the credentialed ghcr.io
case remains unverified.
A dropped upstream file is not enforced on OCI (SIN-54). The 404-at-once rule for files upstream drops covers npm and PyPI. An OCI manifest or layer fetched by digest keeps serving from placement after upstream removes it, since the caller names the hash and the bytes cannot change. An image pulled upstream as malicious therefore keeps serving by digest until its tag is evicted and the collector reclaims it.
Decided 2026-11-05 (SIN-62): this is intended. An OCI proxy keeps serving a digest after
upstream removes it, and there is no per-digest upstream check. A digest names its bytes, so
what a caller gets cannot differ from what it asked for, and a read that needs no upstream
call keeps needing none. The price is the case above, and scheduled collection is off by
default (worker.gc.interval is zero), so the window lasts until an operator runs a
collection.
What an operator can do about a known-bad digest today, traced in the code:
- Before SIN-73 there was no way to stop one digest serving. (SIN-73 below adds it.) A proxy repository answers an OCI
DELETEof a manifest or blob with a read-only refusal (ensureWritable,internal/proto/oci/handler.go). The management API’sdeleteFileaddressesfilesrows, which npm and PyPI use; an OCI manifest and its layers are placed inrepository_blobsandtags, and no route reaches them. - The blunt option is deleting the proxy repository (
DELETE /api/v1/repositories/{name},Registry.DeleteRepository). It unlinks every placement in it, so nothing in that repository serves, good images included. A config-managed repository is refused: remove it from the configuration and apply with--prune. - Removal holds only while upstream no longer serves the digest, or the repository stays
gone. With no placement, a pull by digest or by tag goes upstream again and places the
image again (
remote.Client.FetchOCIManifest,internal/remote/oci.go: the local read comes first, and a miss falls through to the upstream fetch and cache). This holds as much after a collection has removed the bytes as before it. If upstream still serves the image, an operator who wants it gone has to keep the repository deleted or stop using that upstream. - The bytes go only when a collection runs (
sindri gc, orPOST /api/v1/gc; both need an administrator). Deleting the repository stops serving but leaves the bytes, becauseDeleteRepositorynever callscas.Delete(ADR 19).sindri gc --dry-runlists what would go. A digest that a tag in another repository still reaches is kept, since reachability is by digest. A blob is collected only when it has not been seen withinworker.gc.grace(24 hours by default), which is measured fromblobs.last_seen_at, not from when the blob was first stored. - Waiting is the other path, and it can be long or never. Retention evicts a tag once its
cache entry is older than the repository’s TTL plus
worker.retention.proxyStaleAfter(seven days by default):fetched_at < now() - (ttl_seconds + stale)(ListEvictableCacheEntries,internal/db/queries/remote.sql). Thedockerhubandghcrpresets set a one-hour TTL, so the wait there is about seven days and an hour. A repository declared withttl_secondsof zero, which the API accepts and the table defaults to, means “fresh forever”, and its hits are never evicted. Eviction removes the tag only; the digest still serves until a collection reclaims it. A digest pulled with no tag has no tag to remove, but its cache row is itself a collection root: every manifest fetch, by tag or digest, records the manifest digest inremote_cache.blob_digest(internal/remote/oci.go,PutCacheEntry), andgc.sqlroots that column and followsmanifest_children. Evicting the row (evictOne;evictPlacementskips digest references, so nothing else changes) is what unroots the image, and it becomes collectable once it is also outside the grace period. Withttl_secondsof zero the row is never evicted, so the image stays rooted and no collection takes it.
Evicting and blocking one digest (SIN-73). Three administrator routes close the gap above, for an OCI proxy repository only (anything else answers 400):
PUT /api/v1/repositories/{name}/blocked/{digest}evicts the digest and blocks it. The optional body{"reason": "..."}is kept with the actor and the time as the audit record (repository_blocked_digests, migration 00014). A second PUT changes nothing and answers 200 with the first record, so the call is idempotent, and a digest that was never placed can be blocked ahead of time.DELETEon the same path lifts the block. Nothing is placed again; the next pull fetches as for any miss.GET /api/v1/repositories/{name}/blockedlists the blocks.
Registry.EvictDigest does this in one transaction: it unlinks the digest from
repository_blobs, deletes tags that point at it and the remote_cache rows that
justified them, and for a manifest or index unlinks each descendant (through
manifest_children) that no other manifest still placed in the repository lists. Only the
requested digest is blocked; its children are not. It never touches bytes (ADR 19: the
collector reclaims them once nothing places or roots them) and never deletes
manifest_subjects rows, which every repository shares.
A blocked digest is refused before any upstream call when requested by digest (manifest,
blob, or blob HEAD), and when a tag resolves upstream to it, the refusal comes before the
placement is recorded. The refusal is registry.ErrBlocked, which wraps ErrNotFound,
so the client sees MANIFEST_UNKNOWN or BLOB_UNKNOWN with a 404. In a virtual
repository the blocked member counts as a miss, and the walk goes on to the next member
under the first-hit rules. The block is per repository: the same digest in another
repository is unaffected (I2). The placement path takes a per-digest advisory lock so an
eviction and a racing fetch cannot leave a blocked digest placed.
Mutable names go through the TTL; immutable ones do not. An OCI digest
reference, once placed, is served locally without a TTL check or an upstream call, for as
long as its placement and bytes exist. They go only when retention has evicted the cache
row and a collection has then reclaimed the image; the next pull by digest goes upstream,
and is a 404 if upstream has dropped it. Where retention or collection is not running
(scheduled collection is off by default), or the repository’s TTL is zero, the placement is
not removed and the digest serves indefinitely. An OCI tag and a PyPI
project index are mutable upstream, so they are served locally only while
their remote_cache row is fresh. A placed tag is not a reason to skip the
TTL, or latest would be pinned to its first pull for good.
A proxy index is the upstream’s index. A proxied PyPI project page lists every file the upstream index lists, with placed files taking precedence on a filename collision (their hash is one Sindri computed). Placed files are the subset fetched so far, never the whole project; a placed file the upstream later drops stays listed, because the cache keeps serving it.
Stream while staging, commit after verifying. An uncached blob or package
file streams to the client as upstream sends it, while a registry.CacheWriter
stages the same bytes (a pipe into cas.Upload.Append). At upstream EOF the
bytes are checked against the digest and length upstream promised; only then is
the staged upload committed and placed. Memory use is constant in the file
size. When verification fails after headers are sent, the adapter cuts the
connection with panic(http.ErrAbortHandler), so no client mistakes a bad body
for a complete one; OCI and pip clients verify digests themselves as well. (Amended in
M9: an abort is invisible when the response declared its length first. npm streams declare
none, and PyPI and OCI still rely on the client’s digest check. See ADR 24.) A
client that disconnects early abandons the staged copy. The upstream timeout
covers response headers and then each gap between body reads, so a slow but
steady large layer is not cut off. A HEAD on an uncached blob is an upstream
HEAD and caches nothing; a ranged GET on an uncached blob caches the whole blob
first, because ranges are served from storage.
Metadata documents (PyPI simple JSON, OCI manifests) are small and read into
memory under a 32 MiB bound that fails rather than truncates. PyPI index JSON is
stored as a blob referenced by remote_cache.blob_digest so a fresh hit can
rebuild the index without re-contacting upstream.
Manifest children before their bytes. A proxied manifest records its
manifest_children edges when it is placed, which needs a blobs row per
child before the child is fetched; an index names platform manifests that may
never be pulled. The placeholder row takes its size from the descriptor and is
inserted with ON CONFLICT DO NOTHING, so it never rewrites the size of a blob
that already exists. A placeholder has no bytes behind it: M8’s garbage
collector must treat an unplaced blobs row as absent, never as something to
delete from storage. Refined by
ADR 19: an
unreachable placeholder is collected like any other row, and deleting a blob
that has no bytes is a success.
Docker Hub’s library/. A Docker client adds library/ to single-segment
names only when talking to Docker Hub itself. A proxy whose upstream host is a
Docker Hub host adds it for single-segment images, so …/dockerhub/alpine and
…/dockerhub/library/alpine both work. They cache as two image names.
Credentials by reference, and only to the configured origin.
remotes.credentials_ref names a secret looked up through an injected
Credentials interface. The secret is never stored in Postgres and never
logged. It is sent only to the scheme and host of upstream_url: an upstream
index may link files on any host, and a credential must not follow those links.
(Amended in M9: net/http alone kept Authorization for a redirect to the same hostname on
another port, from http to https, and to a subdomain. Credentials now stop at any redirect
off the first request’s origin (scheme and host, port included), for every protocol. On PyPI
and OCI, a configured http:// upstream that upgrades to https, or a credentialed upstream
that redirects to a cdn. subdomain, therefore gets a 401 on the second request. That request no longer carries a Bearer token, so on
PyPI and OCI it is a refusal that fails the walk, as npm’s refused redirect already does
(ADR 24).)
A bearer challenge’s realm comes from the upstream and receives the credential
only over https or on the upstream’s own origin. Bearer tokens are cached per
registry host, credentials reference and image, the scope a pull token covers. The
reference is part of the key so that a token fetched with one login never answers for a
proxy on the same upstream that has another login or none (SIN-55 review). Nothing supplies secrets
yet, so the API rejects a credentials_ref until M7;
ADR 15 decides the source.
Upstream failure is a 502. An upstream that is down, or whose bytes fail
verification before headers are sent, is reported as 502 (OCI code UNKNOWN),
not as an internal error or a client error.
I4 at validate time. reconcile.ValidateRepository rejects lifecycle
stages on proxy and virtual repositories. The management API calls it on
create; M7’s reconciler will call the same function.
Consequences
- Cached bytes are placed on the proxy member, never on the virtual repository.
TestDependencyConfusion_HostedNameIsNeverServedFromProxypermanently guards the name-claim rule.- Eager background mirroring and TTL eviction remain M8.
Rejected
- Serving by digest from any repository that holds the blob. Breaks I2.
- Treating 5xx like 404 in the negative cache. Either hammers a healthy upstream after a transient outage or hides a package that appeared minutes ago.
- Storing upstream passwords in
remotes. Secrets belong outside the placement schema. - Merging versions across virtual members. First hit wins; scoring would reintroduce dependency confusion.
- Buffering upstream files in memory before serving. Simple, but memory grows with layer size and concurrency, and a first pull waits for the whole download. The first M5 draft did this under a 512 MiB cap, which also broke every larger layer.
- Holding back the final chunk until verification. It would let a failed digest end as a clean error status instead of a cut connection, but headers are already sent by then, so the status cannot change anyway.
- An optional per-digest upstream check (SIN-62). It would stop a removed image serving by digest, but it adds an upstream call to reads that need none today, and it forces a rule for an upstream that is down or refuses the check: serving anyway defeats it, and refusing makes a cached image depend on upstream uptime, which the stale-hit fallback above exists to avoid. The gap is better closed by an operator action (see above).
- Automatic
library/for every upstream. Only Docker Hub has the convention; elsewhere a single-segment name is a real name.
15. Upstream credentials: source decided, wiring deferred to M7
- Status: Accepted
- Amended by: ADR 27 (a credential may be a Bearer token)
- Completed by: ADR 17 (the
credentials:section and reference validation) and ADR 18 (no anonymous reads) - Date: 2026-09-30
- Relates to: ADR 7, ADR 9, ADR 14, roadmap M5 and M7
Context
A proxy repository may need credentials for its upstream: a private registry, a
paid mirror, or an authenticated Docker Hub account to lift rate limits. M5
stores a remotes.credentials_ref and applies credentials only to the
upstream’s own origin (ADR 14), behind a remote.Credentials interface. But
nothing supplies secrets to that interface in the running binary. A reference
was accepted when the repository was created and then failed every pull.
Two things make completing this in M5 a mistake:
- Reads are anonymous until M7. A proxy holding credentials for a private upstream would serve that upstream’s content to anyone who can reach Sindri. Credentialed proxies are only safe once RBAC can restrict who reads them.
- M7 designs the configuration that references credentials. Credentials
are named from repository definitions, which arrive with
repos:. Designing the secret section alone now risks a shape the short form must then work around, which is the “two syntaxes” failure ADR 7 exists to prevent.
Decision
Source: a credentials: section of sindri.yaml, in the one configuration
file and its one loader (ADR 9). Values use the loader’s existing ${VAR}
substitution, so the secret itself lives in the environment or a mounted
secret, never in the file:
credentials:
fancysecret:
username: ${FANCY_USER}
password: ${FANCY_TOKEN}
A repository names an entry by key, as credentials_ref does today. The
config-backed implementation of remote.Credentials is built from this section
and passed to remote.New in serve.
Rules that hold whatever M7 adds:
- A secret is never written to Postgres.
remotesholds only the reference. - A secret is never logged, and
sindri config show --expandedredacts it. - Credentials are sent only to the scheme and host of
upstream_url, and to a bearer-token realm only over https or on that same origin (ADR 14). - A reference that names no entry is a validation error when the repository is created or reconciled, never a failure at pull time.
- A proxy with credentials must not be anonymously readable. M7 decides whether that is a validation rule or a default role binding, but it is not optional.
Until M7: reconcile.ValidateRepository rejects any credentials_ref with
ErrCredentialsUnsupported, and the management API returns 400 naming this
ADR. M7 replaces the blanket rejection with a lookup against credentials:.
Public upstreams (Docker Hub anonymous, quay.io, ghcr.io public images,
pypi.org) are unaffected.
Consequences
- M5 ships proxies for public upstreams only. Its roadmap item says so.
- The credential-scoping behaviour stays under test
(
TestProxyPyPI_CredentialsStayOnUpstreamOrigincreates its repository below the API), so M7 builds on verified code rather than rewriting it. - M7’s scope gains the
credentials:section, the config-backedremote.Credentials, reference validation, and the read-access rule above.
Rejected
- Wire it in M5 with the
credentials:section. Works mechanically, but republishes private upstreams to anonymous readers until M7, and fixes a configuration shape before the rest of the config surface is designed. - Environment variables by naming convention
(
SINDRI_CRED_FANCYSECRET_PASSWORD). Needs no schema, but it is a second, implicit configuration channel thatconfig checkcannot see andconfig showcannot print, which CLAUDE.md rules out. - Secrets in the
remotestable. Puts credentials in every database backup and every read replica; ADR 14 already rejected it. - External secret managers (Vault, cloud KMS). Out of scope for v1; the
remote.Credentialsinterface is where one would plug in later. - Leave
credentials_refaccepted and fix it in M7. An accepted setting that silently breaks every pull is worse than a clear refusal.
16. Lifecycle, gates, and evidence in v1
- Status: Accepted
- Date: 2026-10-01
- Relates to: ARCHITECTURE.md sections 2 (I3, I4) and 5, ADR 4, roadmap M6 and M7
Context
M6 implements the identity layer that ADR 4 designed. Seven questions were open:
- Where do stage definitions come from before M7 brings
lifecycle:to the config file? - Who owns an artifact while pushes are still anonymous?
- What can a gate express?
- Does stage order mean anything?
- What does the decision endpoint answer for an environment it does not know?
- How is the ledger protected from rewrites?
- What does provenance promise?
Decision
Stages and gates come from the management API until M7.
PUT /api/v1/lifecycle/stages replaces the ordered stage set and the gates of each
stage in one transaction. lifecycle.ValidateStages needs no database, so M7’s
reconciler can reject a bad lifecycle: section at config check time. It then
applies the section through the same SetStages call. One validator and one writer
serve both sources. A stage that has ledger history cannot be removed
(STAGE_IN_USE). It can be reordered and its gates can change.
The owner is the repository. A subject published into hosted repository demo is
owned by repository:demo. Nothing else about the publisher is verified today: OCI push
is anonymous, and PyPI accepts any Basic username (ADR 12). M7 adds user and team owners
alongside this one, not instead of it.
A gate is one rule: evidence of a type must be present. It is stored as
{"evidence": "sbom"} in promotion_gates.rule. The decoder rejects unknown keys, so
a rule this build cannot evaluate is refused when it is written. It is never accepted
and then ignored. The evidence types are sbom, signature, scan, and
attestation. v1 stores the documents and checks that each type is present. It does
not parse them or verify signatures (roadmap scope). A refused promotion returns 409
GATE_FAILED with a missing list, in the order the stage declares its gates.
Stage order is for display only. Positions order the stages in the API and the UI.
Promotion to prod does not require a current approval at integration. A
“must pass integration first” rule would be a second rule kind. It is left out until
someone needs it, rather than being built into stage order where nobody can opt out.
Decisions fail closed. GET /api/v1/decisions always answers a well-formed question
with 200 and either approved or denied. An unknown environment is denied with
reason unknown_environment, not 404. An admission controller with a typo in its
environment name then blocks deployment instead of reading a 404 as “no policy”. A
digest is approved for a stage when any hosted repository has a current approve for
it at that stage. The approving repositories are listed in the response, but only
those the caller may read. The answer is for any authenticated caller, since an
admission controller asks with whatever credential it holds; an approval names a
repository, an actor, and a reason, which ADR 18 does not disclose to someone who
cannot read that repository. (Amended in v1.0.1, when the route-walk test found
the full list going to every caller.)
The database enforces the ledger.
- A trigger refuses
UPDATE,DELETE, andTRUNCATEonlifecycle_events. - The ledger’s foreign keys to
subjects,repositories, andlifecycle_stagesdo not cascade. Deleting a repository that has promotion history therefore fails, and the API maps that failure to 409HAS_HISTORY. Without this,ON DELETE CASCADEfromrepositorieswould erase the audit trail as a side effect of a cleanup. - Current state is the view
lifecycle_current. It is aDISTINCT ONoverlifecycle_events_current_idx. A test checks withEXPLAINthat the decision query uses that index.
Provenance is a recorded claim. Each publish path records a source_type:
oci-push, pypi-upload, or api-publish.
- OCI push takes
source_refandbuild_reffrom theorg.opencontainers.image.sourceandorg.opencontainers.image.revisionannotations. TheX-Sindri-Source-RefandX-Sindri-Build-Refheaders override them. - The other paths read the headers only.
Nothing verifies these claims. A repeat publish of the same bytes with the same claim does not add a row.
Subjects exist only for hosted content. recordSubject runs inside the hosted
publish transaction. It does nothing for any other repository type. The proxy cache
paths never call it, and TestSubjects_ProxyCacheCreatesNoSubject guards this. A subject
outlives its placements: deleting a file or manifest removes the placement but leaves the
subject, its evidence, and its ledger. The bytes have the same identity wherever they
are deployed.
Consequences
- Promotion and revocation each append one row.
TestLifecycle_PromotionStoryasserts that they change neither the stored blob count nor theblobstable. Attaching evidence adds exactly one blob per new document, which is the document itself. - Evidence blobs have no repository placement. They are read only through
/subjects/{digest}/evidence/{id}, which is scoped by subject. - Garbage collection (M8) must treat
subjectsandevidence.blob_digestas roots. The foreign keys toblobsmake a mistake here fail loudly rather than corrupt anything. Refined by ADR 19: a subject is a root only when it has ledger history or evidence, so an untagged, unpromoted image is collected. - Gate configuration changes are not audited. Only the promotions they allowed are. Auditing policy changes is a follow-up that fits the commercial audit-retention feature.
- A repository with promotion history can never be deleted through the API. An operator who really needs to delete one has to make that decision in SQL, which is deliberate.
(Amended after v1.2.0: a second rule kind, scan.max_severity, reads Sindri’s own
scans; see ADR 30.)
Rejected
- A mutable status column, for the reasons ADR 4 gives.
- Cascading deletes from repositories into the ledger. This is the default everywhere else in the schema, and here it would silently destroy history.
- Strict stage sequencing. It can be expressed later as an explicit rule kind. Built into stage order, it would be policy that nobody chose.
- The unverified caller name as owner. A Basic username or a header looks richer but records unchecked claims as ownership. Ownership is what RBAC will key on in M7.
- A
lifecycle:config section in M6. That would pull part of M7’s loader and golden-test work forward and leave M7 to finish it. The API path and the reconciler path share the same validator and writer instead. - 404 for an unknown environment. An admission controller has to map every status code to allow or deny, and a 404 is the easiest one to get wrong.
17. Config kinds, namespaces, and reconciliation
Context
ADR 7 fixed the shape of the configuration surface: one loader, a short form that desugars totally into a long form, and one reconciler with two triggers. M7 builds it, and has to settle what ADR 7 left open:
- What a team namespace is, and how a reference crosses one.
- How the long form spells a member reference, given that repository names contain slashes.
- Which kinds exist, and where
lifecycle:anddefaults:go. - What the reconciler may delete, and who owns a row when both triggers run.
- What “lifecycle configuration on a proxy” (I4) means at the repository level.
Decision
A namespace prefixes the name. metadata.namespace: payments with
metadata.name: python is the repository payments/python, on the wire and in
the database. A document with no namespace is organisation-level and keeps its
bare name. The namespace is then visible in every URL that reaches the
repository, and two teams cannot collide. org is reserved, and an
organisation repository may not be named org/....
References are type-qualified and resolve locally first. A long-form
member is ref: <type>/<ref>, for example hosted/internal-py, so the expanded
form shows every member’s type (I5 made visible). The type is checked against
the target. The ref after it resolves as follows (reconcile.ResolveRef):
- A ref without a slash is local: inside
payments,internalispayments/internal, never an organisation repository. org/<name>reaches the organisation.- Any other ref with a slash is tried locally, then taken as a full name,
which is how
search/indexreaches another team.
Every cross-boundary reference is therefore visibly one. The short form writes bare names and gets the type prefix from inference. A member outside the file must be written already qualified.
Three kinds. Repository, OrgPolicy, and Lifecycle. The short
lifecycle: section desugars into a Lifecycle document, so the long form can
express everything the short form can, which is what “total” requires.
defaults: is sugar only: it is applied while desugaring and is absent from
the long form. config show --expanded therefore prints every default written
out. Durations print in their shortest exact form (30m, not 30m0s).
Repositories own their access lists and stage restrictions. access.read
and access.write list identity-provider groups, or authenticated.
lifecycle.stages restricts which stages a hosted repository promotes into, and
promotion enforces it (NOT_PROMOTABLE). It is never accepted and ignored. On a
proxy or virtual repository it is the I4 error. Both live in
repositories.config (jsonb) beside namespace and source, so authorizing a
pull reads nothing beyond the repository row the adapter already fetches.
One row, one owner. managed_by separates API rows from config rows. The
reconciler refuses, and never overrides, a name the API created. Within config
rows, source records the trigger: file (serve –config) or apply. Each
trigger refuses the other’s rows (MANAGED_ELSEWHERE). A deployment uses one
trigger per namespace. The type and protocol of an existing repository are
immutable (IMMUTABLE_FIELD), because changing them is a delete and a
re-create, which the reconciler never does implicitly.
Pruning is opt-in. A config-managed repository in scope that desired state
no longer lists is reported as orphaned. sindri apply --prune deletes it.
serve --config never deletes. A repository with ledger history still cannot
be deleted (HAS_HISTORY, ADR 16). Scope is the namespaces the applied
manifests speak for. A namespace absent from an apply is never emptied by it.
One transaction. Validation against the database, the organisation policy,
the stages (through lifecycle.SetStagesIn, the writer the API also uses), and
the repositories commit together or not at all. diff is the same reconcile,
rolled back, so the two cannot disagree.
Locked repositories and team scope. An OrgPolicy lists mandatory
repositories. hybrid and centralized require them to exist, and locked
marks the row. A namespace administrator, named in OrgPolicy.namespaces or
holding a namespace-scoped admin token, may apply only that namespace. Any
document that targets a locked or organisation repository is refused
(LOCKED). Only a global administrator changes a locked repository.
centralized refuses namespaced documents outright.
Credentials (ADR 15, completed). The credentials: section of sindri.yaml
backs remote.Credentials through an atomically swapped store. An unknown
reference fails config check (when the file carries the section) and every
reconcile. config show redacts secrets. A reload installs new credentials
before reconciling and restores the old ones if the reconcile fails.
Consequences
- One sindri.yaml with fifteen lines brings up a working two-protocol setup on boot. The gate script shows it, with a docker push into a repository nobody created by hand.
- The golden test (
TestManifests_ShortAndLongFormsAreIdentical) compares trees. The integration test (TestReconcile_ShortAndLongFormsProduceIdenticalDatabaseState) compares database state, excluding only thesourcekey, which records the trigger rather than the state. Both were checked to fail when the desugarer drops a field. - Teams that want to move a repository between triggers must delete and
re-create it, or edit
sourceby hand. That is rare enough to leave explicit. - A team that removes its last repository leaves its namespace out of the apply, so nothing is pruned. Orphans are still reported by a diff of any manifest that names the namespace.
Rejected
- Namespace as ownership metadata only, names global. It avoids changing
URLs, but
team/xwould then be ambiguous between a team reference and an organisation repository whose name contains a slash, and two teams could fight over one name. - Bare member names in the long form. Shorter, but the expanded form would then hide the hosted/proxy split that I5 depends on.
- Pruning by default. Pure GitOps convergence, but a bad merge would delete a repository’s packages. For a registry, the asymmetry favours reporting.
- Letting both triggers manage the same rows. Simple until they disagree. Then a SIGHUP silently reverts what CI applied, which is the invisible fight ADR 5 rules out.
- Storing the last applied manifests to compute diffs. A second source of
truth. Diffing against the live rows also reports drift made behind the
reconciler’s back, which is what
diffis for. defaults:as a long-form kind. It would be a template mechanism by another name, the road toextends:that ADR 7 closed.
18. Authentication and RBAC in v1
- Status: Accepted
- Date: 2026-10-02
- Relates to: ADR 5, ADR 10, ADR 12, ADR 15, roadmap M7
- Supersedes: the anonymous
/v2of ADR 10 and the anonymous index of ADR 12
Context
Until M7 only /api/v1 checked anything, and it checked one shared token.
/v2 and /pypi were anonymous. M7 must deliver OIDC, group-to-role mapping,
RBAC on every route, and machine tokens. Two constraints shape the design:
- docker, pip, and twine are not browsers. They speak HTTP Basic, sent after a challenge. The authorization code flow alone cannot serve them.
- Membership must be live (ADR 5). A group change at the identity provider must take effect without anything in Sindri being re-applied, and must never be cached in the database.
Decision
One credential channel. Every credential arrives as a Bearer token or as the password of HTTP Basic. The username is ignored. The credential’s shape picks its verifier:
| Credential | Shape | Verified against |
|---|---|---|
| Machine token | sindri_ + 32 random bytes | SHA-256 lookup in machine_tokens |
| Identity-provider token | a JWT | the provider’s JWKS: signature, issuer, audience (client id), expiry |
| Bootstrap token | anything else | auth.static_token, constant-time compare |
People use an ID token as the password. docker login -u me -p <id token>
and an index URL carrying the token are how humans authenticate CLI clients.
Groups and the username come from configurable claims of the token presented
with each request. Membership is therefore live to within one token’s lifetime,
and the database holds no group data at all. The integration test changes a
group at a stub provider and sees access granted and withdrawn with no
database write. Administrators are a provider group (auth.admins).
Machine tokens for CI are scoped to one repository, one namespace, or
(admin only) the server, with one role: read, write, or admin. Only a
hash is stored. The token is shown once, and revoking it keeps the row so the
ledger’s token:<name> actors stay meaningful.
The bootstrap token stays as the administrator credential before a provider exists and the break-glass path after. Running with the development default logs a warning.
No anonymous access in v1. Only /healthz, /readyz, /metrics, and
/auth/* are open. That makes ADR 15’s rule hold by construction: a proxy
holding credentials is never anonymously readable. A configuration that grants
anonymous or * is refused at write time. authenticated is the widest
grant. Amended by ADR 24: npm’s two login
routes also answer without a credential header.
One authorization function. auth.Authorize(principal, repository, role)
is pure and reads only the repository row, which now carries its access lists.
The download path stays a lookup. Write implies read. Admin implies
everything. Pushing to an unknown OCI name creates a repository and therefore
needs admin. A caller who may not read a repository is told it does not exist,
so names are not disclosed. A caller who may read but not write gets 403. Each
surface keeps its own error shape: OCI UNAUTHORIZED and DENIED, PyPI plain
text, management API FORBIDDEN.
Virtual repositories answer only from readable members. Read on a virtual repository lets a caller address it. Each member that answers must be readable too, or a team could republish another team’s private repository by wrapping it in a virtual one. A name claimed by an unreadable hosted member is a miss. It never falls through to a proxy, so invariant I5 is unaffected.
Browsers use the authorization code flow with PKCE, state, and nonce at
/auth/login. The verified ID token becomes the sindri_session cookie:
HttpOnly, SameSite=Lax, and Secure over https. Plain http is accepted only on
loopback. The cookie is honoured only on GET and HEAD, and only by the
read-only UI guard and /auth/whoami. The API and the adapters never read it,
so a cross-site request cannot borrow a session to change anything.
Provider outages do not take the registry down. Discovery is lazy and retried with backoff. Until it succeeds, provider tokens are refused, and machine and bootstrap tokens keep working.
Consequences
pip installanddocker pullneed credentials. The gate scripts show the spelling:docker login, andhttps://token:<secret>@host/pypi/<repo>/simple/.- A revoked group membership stops working when the user’s current token expires. Short-lived ID tokens are the operator’s lever, and the ADR states the bound honestly rather than claiming immediacy.
- API-created repositories and repositories from before M7 grant nothing until access is added, so only administrators reach them. That fails closed.
- Subjects are authorized through their owning repositories: reading evidence needs read on a repository that published the digest.
Rejected
- Groups from the userinfo endpoint on every request. Truly live, but every pull would depend on the provider’s availability and latency, and the download path would stop being a lookup.
- Personal access tokens minted at browser login. The token would carry the groups of the moment it was minted, which is cached membership under another name (ADR 5).
- The Docker token-service protocol (
/v2/token). It adds a second credential exchange and a signing key to operate, for no gain over Basic on a TLS-terminated endpoint. - An
anonymousgrant. Useful for public mirrors, but it needs a validator rule to keep credentialed proxies private and a test per adapter. It can be added later without a format change. - Session cookies on the API. That would need CSRF tokens on every mutating route. Bearer tokens for scripts and cookies only for the read-only UI avoid the problem entirely.
19. Garbage collection: roots, write intent, and the sweep
- Status: Accepted
- Date: 2026-10-11
- Relates to: ADR 3, ADR 8, ADR 13, ADR 14, ADR 16, roadmap M8a
- Refines: ADR 16’s “subjects are roots”, ADR 14’s placeholder rule
Context
Deduplication means one blob can be placed in many repositories, so deleting a placement never deletes bytes (ADR 3). Something has to reclaim bytes that nothing references any more, without ever reclaiming bytes a push in flight is about to depend on. That is the classic registry data-loss bug, and two facts made it concrete here:
- Bytes land before metadata. Every write path stores bytes in the CAS and only then commits the placement transaction. A collector that deletes the bytes in between loses them, and the placement commits pointing at nothing.
- Deduplication skips writes.
cas.Putandcas.PutBytesdo not write bytes the store already holds. If the collector deletes them after that check, the skipped write never happens.
A grace period on blob age does not close either race on its own:
blobs.created_at was first-seen time, so an old blob pushed again looked
old.
Decision
Roots. A blob is live when a root reaches it, directly or through
manifest_children:
tags.target_digestfiles.blob_digestremote_cache.blob_digest, every hit, regardless of ageevidence.blob_digest, andevidence.subject_digest- every subject with a row in
lifecycle_events
repository_blobs is not a root: a layer uploaded and never named by a
manifest is garbage. A subject with no ledger history and no evidence is not
a root either, so an untagged, unpromoted manifest is collected along with
its subjects, subject_owners, and provenance rows. This refines ADR 16,
which made every subject a root and so would have kept every image ever
pushed.
Write intent. blobs.last_seen_at is touched before any byte is written
or relied on. cas calls a Reserver, implemented in package db so that
cas stays below the database:
PutBytesreserves before its dedupStat.Upload.Commitreserves after the digest verifies and beforeCommitUpload.Putwith a claimed digest touches before its dedupStat. A touch only refreshes an existing row, so an unverified claim never creates one.
Each call commits on its own. Every placement’s UpsertBlob also touches.
gc.New refuses a cas.Store without a reserver.
Mark. One recursive query in a REPEATABLE READ READ ONLY transaction
lists blobs that are unreachable and last seen before the grace period
(default 24h). The dry run is the mark alone.
Sweep. One READ COMMITTED transaction per candidate:
- Lock the blob row with
FOR UPDATE SKIP LOCKED. A row someone else holds is in use, so it is skipped. - Re-check the grace period against the row as it is now.
- Lock the subject row, if any, so a promotion or evidence attach blocks.
- Re-check every inbound reference.
- Delete the dependent rows and the blob row.
- Delete the bytes, still holding the lock.
- Commit.
A writer whose intent committed first is seen by the re-check. A writer that arrives during the sweep blocks on the lock. When it gets the row, the row and the bytes are gone, so it writes both again. Parents go first, and the sweep repeats passes until one deletes nothing.
Placeholders. ADR 14’s placeholder rows have no bytes. They are collected like anything else, and deleting a blob that has no bytes is a success.
Proxy content stays a root while its cache entry exists, so the collector
never reads TTLs. Retention evicts a hit once it is older than the
repository’s ttl plus worker.retention.proxyStaleAfter, together with the
proxy tag or files it justified. After that the collector reclaims the bytes
through ordinary reachability. ttl: 0 means fresh forever and is never
evicted. The stale allowance is what still serves a cached copy through an
upstream outage.
A cached file that a refresh showed upstream no longer lists is flagged
(files.upstream_gone_at, SIN-54) and stops serving at once, whatever its cache entry
says. Retention removes the flagged row, and the version and package rows it empties,
once the flag is older than the same stale allowance, even when the repository’s ttl
is 0. Rows only: the collector reclaims the bytes through ordinary reachability. The
flag is never set on a hosted row, and the deletion joins on repository type like the
rest of eviction.
Interfaces. sindri gc talks HTTP to a running server, as apply does.
GET /api/v1/gc/candidates is the dry run, POST /api/v1/gc queues a
collection, and GET /api/v1/jobs/{id} reports on it. All three are
administrator-only. Scheduled collection is off by default
(worker.gc.interval: 0), because “untagged is garbage” is a policy to adopt
after a dry run, not one to inherit by upgrading.
Consequences
- No unreferenced bytes are kept forever, and no referenced bytes can be deleted by a race. Each guard has a test that was run with the guard removed and failed: the reservation order, the dedup touch, the sweep’s re-check, the grace re-check, and deleting bytes before the commit.
- A failed commit after the bytes were deleted leaves a row without bytes, which is the state a placeholder is always in. The next run collects it.
- A hosted manifest whose layer was collected before it arrived gets
MANIFEST_BLOB_UNKNOWNand is pushed again. Before this ADR that case was a 500. - Rows from before the upgrade count as seen at the upgrade, so nothing is collectable until one grace period after it.
- Known limit. Bytes written by an M7 binary whose placement transaction then failed have no row, so the collector cannot see them. That is a storage leak, never a safety problem. Reclaiming them needs a storage listing, which is deferred until someone needs it.
- Mixed versions. An M7 binary writing beside an M8 collector writes
bytes without an intent and is not safe. Upgrade every server before
running
sindri gc.
Rejected
- Reference counts. Every placement and edge write would become a counter update. A missed decrement leaks and an extra one deletes live data, and reachability is still needed to audit the counts.
- Committing, then deleting bytes. Between the commit and the delete, a writer’s dedup check finds the bytes and skips the write, and then they are deleted. The test for it fails with exactly that loss.
- A grace period alone. It protects new blobs, not a push that deduplicates against an old one.
repository_blobsas a root. Nothing would ever be collected from a hosted repository, because every upload is placed.- TTL evaluation in the collector. It would delete the cached copy that the stale fallback serves during an upstream outage, and it would put remote semantics into a component that otherwise knows only reachability.
- A
BlobStorelisting to sweep orphaned bytes. It would widen every backend and the conformance suite to recover a pre-upgrade leak the write intent now prevents.
20. A queue table and a background worker
Context
M8a brings the first background work: garbage collection, evicting stale proxy
cache entries, and cleaning up abandoned uploads. ARCHITECTURE.md section 9
already required that background work go through a queue table, even while
sindri serve runs everything in one process. That is what keeps the post-v1
--api-only and --worker-only modes a configuration change. What remained
open was the shape of the table, how claims stay safe, and where the clock
comes from.
Decision
One jobs table, claimed with FOR UPDATE SKIP LOCKED. Any number of
workers claim concurrently and never share a job. A claim takes a lease. The
worker renews it every third of its length, and completing, failing, or
releasing a job checks that the caller still holds the lease. A worker that
dies holds its job only until the lease runs out. After that the next poll
requeues it and counts the attempt. A failed attempt is retried with
exponential backoff, capped at an hour, until max_attempts is reached.
Dedupe keys. A partial unique index allows one queued or running job per
dedupe_key. Enqueueing an active key returns the existing job instead of
creating another. This one mechanism covers three cases:
POST /api/v1/gctwice returns one job.- A scheduled collection and one asked for by hand never overlap.
- Two workers’ schedulers racing each other insert one row between them.
Schedules. Each worker enqueues a kind when nothing of that kind is
active and nothing succeeded within the interval. Retention runs hourly by
default. Collection is not scheduled unless worker.gc.interval is set.
The database is the clock. Every time the queue compares or records comes
from Postgres’s now(), so workers on different hosts agree on when a lease
ran out. Tests move rows with SQL instead of faking a clock.
kind carries no CHECK constraint, and a worker claims only the kinds it
has handlers for. A binary that was rolled back leaves newer kinds queued
instead of failing them or refusing to start.
Wiring. worker.Run takes a queue and handlers, nothing else, and stops
when its context ends. A job still running at that point is handed back
without counting the attempt. serve starts the worker beside the HTTP
server when worker.enabled is true (the default), and stops it before the
database pool closes. A test fails if that order is reversed. With the worker
off, jobs wait for a worker elsewhere.
One sanctioned exception: upload sessions in process memory. An OCI
chunked upload’s session lives in the memory of the process that opened it
(ADR 8). A job claimed by another process could not reach it, so expiring
idle sessions runs on a ticker inside each serving process. The durable half,
staging state in storage, goes through the queue: the purge_uploads job calls
BlobStore.PurgeUploads. That method also removes state a crashed process
left behind, which no session knows about.
Consequences
- The split serve modes stay a flag. The API and the worker share no memory, only the table.
- A crashed worker delays its job by at most one lease, two minutes by default, and never runs it twice at once.
- Finished jobs are deleted after 30 days by the purge job, so the table does not grow without limit.
BlobStoregainsPurgeUploads, which every backend implements and the conformance suite checks, including after a restart. On S3 it lists multipart uploads without a prefix and filters by key on the client, because MinIO returns nothing for a prefix that is not a whole object key. It needss3:ListBucketMultipartUploads. A bucket lifecycle ruleAbortIncompleteMultipartUploadis a sensible second safety net.
Rejected
- A goroutine and a ticker per task. This is the simplest option, and it is what the upload session exception does. For everything else it would tie background work to the serving process, which is the coupling section 9 exists to prevent.
- An external queue (Redis, NATS, SQS). It would add a second piece of stateful infrastructure for a workload measured in jobs per hour. Postgres already gives transactions, row locks, and a clock.
- Advisory locks instead of leases. A session lock dies with its connection, which ties a job to the database connection that claimed it. It also leaves no record of who held a job and when.
- Application clocks. With two workers on two hosts, clock skew would decide when a lease ran out.
21. A read-only UI, and a quickstart with a development identity provider
Context
v1 promises a read-only web UI: repositories, packages, and artifact detail with digest, owner, provenance, evidence, and per-environment lifecycle status. The stack was already decided: Go templates and htmx, embedded, because a Node build would break the single-binary promise. Four questions were left open:
- how pages address repositories whose names contain slashes
- what stops a page from leaking another team’s data
- how a browser signs in when no identity provider is configured
- how a stranger gets a working UI in the quickstart, given that v1 has no anonymous access
Decision
Server-rendered pages from the API’s services. internal/ui renders with
html/template from registry, lifecycle, and evidence, at the same layer
as api. htmx is used only for “load more”. web/ embeds the templates, CSS,
htmx, and fonts, so nothing loads from a CDN and the UI works air-gapped.
web/VENDOR.md records each vendored file’s checksum, and a test enforces it.
Routing. Repository names contain slashes, so a page within a repository
follows a /-/ separator:
/ui/r/team/app/ui/r/team/app/-/package?name=web/ui/r/team/app/-/artifact?digest=…
A lone - is now a reserved name segment, so the split is never ambiguous.
Assets are served under a hash of their contents, /ui/static/{hash}/…, and
cached as immutable.
Authorization is the API’s, page by page.
- Every repository shown passes
auth.Authorize. - A repository the caller cannot read gets the same 404 as one that does not exist.
- A virtual repository lists only members the caller can read.
- An artifact page is scoped to a repository and checks placement first (invariant I2).
- Owners and lifecycle state from other repositories are shown only when the caller can read those repositories.
- Evidence appears as metadata only. Its documents stay behind the API, which authorizes each subject.
A test walks the router, so a route added without an authorization case fails it.
A strict Content-Security-Policy. The policy is default-src 'none',
with 'self' for script, style, font, and connect. Forms, framing, and base
URLs are not allowed. A test fails any template with inline script, inline
style, or an event-handler attribute, so nothing tempts a later change to
loosen the policy.
Amended 2026-11-17 (SIN-98). The “sign-in is not configured” page is the one
exception. internal/auth serves it before anyone has signed in, and the UI’s
assets sit behind sign-in, so it cannot load sindri.css. It carries a single
inline stylesheet, admitted by its sha256 hash in that page’s own policy
(default-src 'none', no script, no forms, no framing), and a test recomputes
the hash. The alternative, an unauthenticated stylesheet route, was rejected:
it would be an anonymous path, which ADR 18 refuses.
Amended 2026-11-17 (SIN-96). The UI policy’s form-action is now 'self'
instead of 'none', so the repository list’s filter can be a plain
<form method="get" action="/ui/">. Every form in a template must be a GET
with the method written out, and a test fails any that is not. This is safe
because the UI still has no write path: the session cookie is honoured only on
GET and HEAD, so a form that posted would be refused with 401 and do nothing, and
a GET form can only reach the same read-only pages a link reaches. The sign-in
help page’s policy in internal/auth stays at form-action 'none'. The
alternative, links and htmx only, was rejected: the text box would not work
without JavaScript, and the filter state would not be a URL a browser can
submit by itself. Global search (SIN-101) reuses the same form-and-GET
pattern and needs no further change to the policy.
Sign-in.
- Browsers sign in through ADR 18’s authorization code flow. The session cookie is honoured only on GET and HEAD, and the UI’s only forms are GET forms (the filter), which cannot change anything.
- Sign-out is an htmx POST to
/auth/logout, which answers withHX-Redirect. - Without
auth.oidc, the guard answers a browser with a page explaining how to configure it. It never sends a Basic challenge: a browser caches Basic credentials and attaches them to cross-site requests, and every write route accepts Basic, because that is what docker, pip, and twine send. GET /redirects to/ui/.
The quickstart runs Dex. deploy/quickstart/compose.yaml runs Postgres,
Dex, and Sindri:
- Dex’s mock connector signs in one example user in the
authorsgroup, andauthorsadminister the server. - Sindri shares Dex’s network namespace, so
http://localhost:5556is the issuer for both the browser and the server. Sindri needs no configuration field for that. docker loginuses the bootstrap token fromSINDRI_TOKEN.- The file says, in capitals, that it is for development only.
Release.
- goreleaser builds linux and darwin binaries for amd64 and arm64.
- It also builds a multi-architecture image on pinned distroless
static:nonroot, with no shell and user 65532. The image copies binaries goreleaser already built and has no RUN step. sindri probe URLexists so Compose and Kubernetes have a healthcheck in an image without curl.
The gate runs docs/quickstart.md, read from the document itself, in a fresh
docker:dind daemon.
Consequences
- The UI adds about 220 KB of assets to the binary, mostly fonts.
- Every page costs a few queries per repository it shows. A registry has tens or hundreds of repositories, so the home page filters and groups them by namespace, pages them 200 at a time, and reads their figures (packages, last publish) in one aggregate query for the page, never one per row. Other listings page by 50.
- Signing out from the UI ends the Sindri session but not the identity provider’s own. A provider with a live session signs the user straight back in, which is normal for OIDC relying parties.
- The quickstart’s Compose file and the document can never drift apart: the gate diffs them.
Rejected
- A single-page app. It would need a Node build, which the single-binary rule forbids, and a second rendering of authorization decisions the server already makes.
- Basic-auth fallback in the browser when OIDC is absent. This is the CSRF hole described above. An operator without a provider uses the API with a token.
- An anonymous read-only UI. ADR 18 refuses anonymous access everywhere, and a UI-only exception would be the one place a misconfiguration exposes names.
issuerUrlanddiscoveryUrlconfiguration to let Sindri reach Dex under a different host than the browser does. Sharing the network namespace solves the quickstart without a configuration field that only the quickstart needs.- Google Fonts or a CDN for htmx. That would add a third-party origin to the policy, and a request leaving every viewer’s browser.
- Serving evidence documents from the UI. They can be large and hold sensitive detail. The API already authorizes them per subject.
22. After v1, serve polyglot app teams first
- Status: Accepted; the Helm chart’s place and the announcement’s timing are amended by ADR 25
- Date: 2026-10-13
- Relates to: pitch.md sections 1, 6, and 7, ADR 6, roadmap “After v1”
Context
v1 shipped with OCI and PyPI, hosted, proxy, and virtual repositories, lifecycle and evidence, configuration as code, OIDC, and a read-only UI. The list of possible next steps is long: a docs site, a better README, npm and Maven, CVE scanning and SBOMs, a Helm chart, the admission webhook, split serve modes. Built in arbitrary order, each one is useful but none of them makes Sindri the obvious choice for anyone.
The pitch already names the audience in general terms: small and mid-sized teams, won through open-source adoption before enterprise. Within that audience there are at least three different first users, and each one orders the work differently.
Decision
The first audience is the polyglot app team. These teams run Python services and a JavaScript frontend, and today they stitch together Harbor, Verdaccio, and a homegrown PyPI server. The next phase is done when such a team can retire all three. This is the gap pitch.md section 1 names.
The order is v1.0.1, M9 npm, M10 adoptable, M11 scan to evidence.
- v1.0.1 closes what the v1 checklist pass found: no route-walk authorization
test on
/api/v1, Helm over OCI verified only by hand, and a flaky testcontainers reaper. - npm comes before the docs site. Without npm this audience cannot drop Verdaccio, so docs would sell something they cannot fully use yet. The README is enough for early adopters until then.
- M10 makes Sindri adoptable by someone who has never seen it: a docs site, a generated configuration reference, migration guides from Verdaccio, devpi, and Harbor, and an operations guide. Migration means a Sindri proxy in front of the old registry, not an import tool.
- M11 adds scanning, because Harbor already scans with Trivy and a team will not replace it with something that does less. ADR 23 decides how.
No public announcement before M10. First impressions come from the docs, so the docs come first.
Docs live in the repository, published as a site, not in a GitHub wiki. A wiki is not versioned with the code and is not reviewed in pull requests.
Consequences
- The Helm chart, split serve modes, and the admission webhook move behind M11. A polyglot team usually runs a VM or Compose, so a Helm chart for Sindri does not change whether they can adopt it.
- Maven waits. It is a third protocol for a different audience.
- The admission webhook, the clearest demonstration of the thesis, waits for the Kubernetes milestone. The decision endpoint gets production use first, which is what the v1 roadmap wanted anyway.
Rejected
- Kubernetes platform teams first. They would put the Helm chart, HA, and the admission webhook first. That competes with Harbor on Harbor’s home ground, where Harbor is mature and multi-protocol support matters least.
- Security-first teams first. They would put scanning, SBOMs, signature verification, and the webhook first. That is where the pitch expects revenue, but selling the paid layer before there are users of the free one reverses the open-core strategy in pitch.md section 7.
- Docs first, then npm. It is better if an announcement is near, and none is planned. It would polish the onboarding for a product the target team cannot yet fully switch to.
- npm and docs in one milestone. It makes one coherent launch, but it would be the largest milestone yet, and CLAUDE.md works one milestone at a time.
23. Scanning runs as a queue job, and scanning is open source
- Status: Accepted; the open-core line is superseded by ADR 33
- Date: 2026-10-13
- Relates to: ADR 16, ADR 20, ADR 22, pitch.md section 6, roadmap M11
Context
v1 stores evidence (sbom, signature, scan, attestation) and gates
promotion on its presence (ADR 16). It never reads the documents. CI can run a
scanner and attach the report, but nobody can enforce “no critical
vulnerabilities”, only “a scan exists”. And nothing notices when a new CVE is
published against something already approved for prod.
The polyglot team ADR 22 targets wants SBOMs and scans for images, wheels, and npm tarballs in one place, without editing every pipeline, and wants to hear about new CVEs in what is deployed. Harbor already scans images with Trivy, so scanning decides whether this team switches.
There was also a contradiction to settle. pitch.md section 6 puts the advanced policy engine, with the example “no prod promotion without an SBOM”, in the paid tier. v1 already ships that exact gate as open source.
Decision
Sindri runs the scanner itself, as an optional job on the queue table.
- A
scanning:section in the one configuration loader, off by default, names thetrivyexecutable and an optional mirrored vulnerability database, for air-gapped installs. - A hosted publish enqueues a
scanjob. The worker runs Trivy and attaches a CycloneDXsbomand ascanresult to the subject as evidence, through the existing write path. Trivy covers OCI images, Python, and npm with one tool. - A daily job re-scans every subject currently approved for any stage. A new finding adds evidence and shows in the API, the UI, and a metric. It never rewrites the ledger.
- Gates get a second rule kind,
{"scan": {"max_severity": "high"}}. The decoder keeps rejecting rules it cannot evaluate. - The binary and the default image stay free of dependencies. Trivy is an external executable, and a second release image includes it.
The open-core line. Free, as everything one team needs: scanning, SBOM generation, the severity gate, and every presence gate, including “no prod without an SBOM”. Paid, as governance across many teams: per-CVE waivers with expiry, licence policy, org-wide rules teams cannot override, and compliance reports. This keeps the pitch’s rule (“one team free, many teams paid”) and moves its example to the free side, where v1 already put it. pitch.md’s table is updated in M11.
Consequences
- The worker gains a job that can run for minutes and fetch a vulnerability database. Leases (ADR 20) already handle long jobs. Air-gapped installs need the mirror setting from the start, not as an afterthought.
- A scan result is a claim about a point in time. The decision endpoint answers from the ledger and the current gates. Re-scans add evidence, and the ledger stays the record of what was approved and when.
- Once a deployment splits the worker from the API, scanning moves with the worker and needs no further design.
Rejected
- Ingest only. Sindri would parse CycloneDX, SPDX, SARIF, and Trivy JSON that CI attaches, and never run a scanner. It is the least work, but every team must wire up every pipeline, and nothing re-scans when a new CVE appears. That misses the audience.
- A separate scanner service. A
sindri-scannerprocess would take jobs over the API and post evidence back. The isolation is clean, but it is a second deployable and breaks the one-binary promise. The queue table already makes running the worker apart a configuration change later. - Trivy as a Go library inside the binary. The dependency tree is large, it ties Sindri’s release cadence to Trivy’s, and it makes the scanner impossible to swap or upgrade on its own.
- Scanning in the paid tier. A small team would not choose Sindri over Harbor without it, and the free tier exists to win exactly that team.
24. The npm packument is derived, dist-tags are pointers, and virtual repositories do not merge
Context
npm is the third adapter. Its per-package metadata document, the packument, changes on every publish, and its dist-tags move. OCI and PyPI have nothing like it. The core was also built around the first two protocols in ways npm breaks: package names fold PEP 503 style, and download links are root-relative.
Client behaviour below was captured from npm 10.9.9 on Node 22 against a logging server. pnpm and yarn were not captured; the M9 gate covers them.
Decision
The packument is derived from rows on each read, and never stored. It cannot drift from
what is placed, and dist.* is always Sindri’s. One response serves both the full and the
abbreviated Accept types; npm accepted it for both.
A version’s manifest comes from the tarball, not the request. At publish Sindri reads
package/package.json from the tarball and keeps it in files.metadata, with the computed
integrity and shasum. The publish body’s versions entry only has to agree on name
and version; if it disagrees, the publish gets a 400. Every other client field is ignored,
so what the packument says is what the tarball holds, and manifest confusion has nowhere to
start. Sindri parses tarballs with its own strict grammar, which accepts the forms npm pack
and tar-stream write and refuses the rest, because a second parser that disagrees with an
installer is how manifest confusion returns. A filename with a colon, or ending in a dot or a
space, is refused at publish, since Windows reads it differently, and so is any other spelling
of package.json at depth one or less, in any case or as the NTFS short name PACKAG~1.JSO.
The manifest is stored in jsonb, so publish also refuses nesting past 64 levels, a number
longer than 1000 bytes, and an exponent past ±64. jsonb writes out every digit on read, so
1e1000 would be small to publish and large in every packument after it.
Integrity is checked at write time, and client values never reach a reader. A body
carries one version and one attachment. Sindri hashes the decoded bytes before cas.Put. A
declared dist.integrity or dist.shasum that disagrees is refused and nothing is stored
or placed. A correct one is discarded like any other client value. The blob key stays
sha256. The filename is built from name and version, because the client’s attachment key
contains a slash (@acme/ui-1.0.0.tgz) and its dist.tarball is its own guess. The body is
streamed under PyPI’s 512 MiB bound.
A published version is immutable, even for identical bytes. InsertFileImmutable
treats identical bytes as a no-op, which is right for PyPI but not here, so the publish
transaction refuses any version that exists. The answer is a 409 with an error field,
which npm prints as E409. registry.Publish refuses an npm publish without
ExclusiveVersion, so no caller can opt out.
Dist-tags are pointers to versions, outside the identity model.
dist_tags(package_id, tag, version_id) cascades from both parents. A dist-tag is not a
placement and not a GC root: the files row already is both, and I2 and GC do not change.
It is not a subject and not a lifecycle event, so promotion (I3) does not see it. The
subject is the tarball’s digest, with a new kind npm-tarball.
Tag moves are recorded. Moving latest changes what a plain install gets, so each
change appends to dist_tag_events (repository, package, tag, from and to version, actor,
time). The table is append-only by trigger, and holds no foreign key to the package or
version, so it outlives a delete. A package always has a latest: the first publish sets
it whatever --tag says, npm dist-tag rm latest is refused, and if latest’s version is
deleted, the packument reports the highest non-prerelease version, or the highest prerelease
if that is all there is, until someone sets a tag. DeleteRepository writes no events: its
tags cascade away unrecorded, and the repository’s earlier events remain.
npm deprecate writes one field. The client GETs the packument with ?write=true and
PUTs the whole document back without _attachments, sending deprecated: "" to clear. A
PUT with no attachments therefore reads only versions[*].deprecated, into a new nullable
versions.deprecated. Only "" clears: a listed version whose field is absent or null stays
as it is, so a client holding a stale document cannot erase a message someone added since. An
unknown version is refused, a message with a control character is a 400, and everything else
in the body, dist-tags and dist included, is ignored. It is not recorded, because it cannot
change which bytes an install resolves.
npm names key exactly. normalizePackageName folds @acme/ui to acmeui and merges
foo.bar with foo_bar. Those are different npm packages, so one could take over the
other’s claim. Normalization becomes per protocol. The npm key is the full name, scope
included. Hosted publishes refuse uppercase. Claim lookups compare in lowercase, so a hosted
jsonstream also claims a legacy upstream JSONStream; that over-claims in the safe
direction.
A hosted scope is claimed by its rows. A hosted repository holding any @acme/* name
claims every @acme/* name. The name-claim rule in ARCHITECTURE.md section 4 otherwise
applies unchanged, and claimOwner and walkMembers already have the right shape.
A virtual repository does not merge packuments. The first member that has the package
supplies the whole document, as I5 and PyPI’s ListPyPIFiles already work. A claimed name
never contacts a proxy. Merging is what the roadmap’s warning describes, and removing it
removes the bug rather than guarding against it. This overrides the roadmap’s “merging
packuments across members”.
Proxy packuments are cached as upstream sent them and rewritten per read. They live
under the existing ttl. Each read rewrites dist.tarball to the repository the client
asked for, including a virtual one, so installs stay behind auth.Authorize and placement.
Upstream dist.integrity is verified when a tarball is cached. (Amended in M9 when the
proxy was built; the paragraphs below say what “as upstream sent them” came to.)
A proxy asks for the whole document. (Amended in v1.1.1, SIN-60; M9 asked for the
abbreviated form and rejected this.) Sindri sends Accept: application/json, so the cached
document carries upstream’s time map and readme, and passes time through unchanged.
npm install --before, pnpm’s release-age setting and yarn 4’s npmMinimalAgeGate all read
time, and yarn 4 refuses every version it cannot date. The abbreviated form made all
three fail through a proxy. The costs, accepted:
- Upstream traffic. Every refresh downloads the whole document. Measured on
2026-11-05, full against abbreviated:
typescript15.9 MB against 8.8 MB,@types/node11.2 MB against 2.3 MB,next31.5 MB against 25.7 MB,aws-sdk10.6 MB against 3.8 MB. - Parsing. Each refresh parses the larger document, and each read rewrites it. The largest real document is well inside the 128 MiB read bound.
- Larger responses to clients. A client of a proxy gets the whole document, since one
document answers every
Accepttype. Clients of a hosted repository are unaffected. - Cache size. The cached document is that much larger, per package, under the
existing
ttl.
It restores “as upstream sent them” to its plain meaning, with two exceptions the rewrite
drops: the top-level _attachments, which is a publish payload and can carry tarball bytes,
and each version’s _resolved, which names upstream’s own tarball URL and would point a
client past Sindri. A document upstream sends with no time stays without one: Sindri
never invents a timestamp.
Hosted packuments carry time, and only real times. versions.published_at is set by
the column default when a version is inserted, and migration 00011 adds it as nullable.
Each version’s entry is that time, written as npm does, in UTC with milliseconds.
created and modified are the earliest and latest of those. A version with no time is
left out of the map, and a package with none has no time at all. There is no backfill:
versions published before 1.1.1 have no recorded time, the migration leaves them NULL, and
a guess would be an invented timestamp. Yarn 4.18.1 quarantines a version missing from
time (tested: a row set back to NULL gets YN0016 again), so such a version does not
install on defaults. An operator who wants one to install can pre-approve its scope in yarn
(below), or set its published_at by hand, which is the operator asserting a time Sindri
never observed. A proxy cache entry gets time only when it next refreshes, after its
ttl; with ttl: 0, which is fresh forever, it never does until a non-zero ttl is set.
Yarn 4’s npmPreapprovedPackages exempts an internal scope from the gate. The gate
verifies ["@acme/*"] on yarn 4.18.1; a bare scope name ("@acme") does not match.
The packument is parsed with exact keys and its name must match the request. Go’s
struct decoding is case-insensitive and would read a DIST that npm ignores. A version that
cannot be served safely (a bad version string or filename, a malformed entry) is left out
with any dist-tag naming it. Two versions claiming one filename are a 502, because choosing
between their hashes would depend on map order. Sindri also reads dist.integrity as the
strongest of sha512, sha384, and sha256, falling back to sha1 from the SRI string or
dist.shasum; the blob key stays sha256.
A tarball is fetched only from the upstream’s own host and base path. dist.tarball is
author-supplied, and the fetch carries the upstream’s credential. The scheme and host are
forced to the upstream’s, userinfo and fragment are dropped, and the resolved path must stay
under the upstream’s base path on a segment boundary. Dot segments and encoded separators
are refused in decoded or encoded form, to any depth of encoding, rather than cleaned. A
redirect that leaves the first request’s origin is refused, and credentials stop at any such
redirect for every protocol: net/http alone kept Authorization for the same hostname on
another port. A redirect to the same origin is followed, because registries move tarballs on
their own host, but credentials stop at any hop outside the base path or with an unsafe path.
So an open redirect on a shared host cannot carry them to another tenant’s path, and a
tarball that really needs them there fails rather than authenticates.
A version with neither integrity nor shasum is listed, and its tarball is a 502.
Sindri will not cache bytes it cannot check. The same answer covers a tarball URL off the
upstream.
An uncached proxy stream declares no length. The hash is known only after the last byte,
so a declared Content-Length would frame the response as complete before an integrity
abort could land. Chunked framing makes the abort visible to npm. A placed tarball declares
its length. This refines ADR 14, which still holds for PyPI and OCI: both declare a length
on an unverified stream and rely on the client checking the digest. A placed tarball is served
as it was cached even if upstream later changes that version’s hash, and the client then
fails with EINTEGRITY.
In a virtual repository the first member with the package owns its tarballs. For a proxy member, “has the package” means its packument resolves, and that is checked before any placed copy is read. A tarball the package’s document does not list, or lists and upstream lacks, is a 404 when it is not already placed, and a later member is not asked, including from outside a nested virtual. Otherwise a second proxy could supply a tarball for a version the first member’s document never offered.
FetchNPMTarball fetches the packument before it looks for a placed copy, so the check is
of the file as well as the package: a version upstream has dropped is flagged by the refresh
and answers 404, directly and through a virtual (SIN-54, below).
An upstream 5xx, or a document that fails to parse, fails the walk with a 502. A 404 or a
negative cache entry is a miss and the walk moves on. A 401/403 is a refusal and fails it
too, below. A stale document still
answers from its own member during an outage, so an outage cannot change which member a
name resolves to, and an outage on a proxy does not touch a claimed name, since the proxy is
not contacted. Only hosted members claim: a proxy’s cached packages rows look like hosted
rows, and claimOwner is what keeps them out. Names through a virtual use validReadName,
ASCII only, and a hosted member compares exactly while the claim compares in lowercase. So
JSONStream against a hosted jsonstream is claimed and then a 404.
A 401 or 403 from a proxy member fails the walk with a 502. SIN-55 decided on 2026-11-04
that a refusal fails the walk on all three protocols (ADR 14 has the rule table and the OCI
exceptions): the broken thing is Sindri’s own upstream credential, not the package’s
presence. The risk it closes is real. With members [private-proxy, public-proxy], a broken
credential on the first would otherwise make a private name resolve from the public proxy for
as long as the credential stays broken. A refusal is never negatively cached, so that would
not have been bounded by the negative TTL either. A stale private document keeps answering
from its own member, as it does in an outage, because a refusal is also unavailable. A claim
by a hosted member still holds, so this affects only names that live upstream on a private
registry.
An npm packument is bounded at 128 MiB, and each read parses all of it. PyPI pages and
OCI manifests keep 32 MiB; a packument lists every version and real ones are large
(renovate is 36.6 MB, next 25.7 MB, measured 2026-11-03). Over the bound is a 502 that
neither poisons the cache nor displaces a good stale copy, and the reason is logged with the
repository and package name, never the URL, headers or body. The cost is that every read,
cached or not, loads and parses the whole document, and there is no request coalescing, so
concurrent cold reads of one package each fetch it.
A file upstream has removed stops serving at once. Every refresh that gets an answer
from upstream tells the registry which files the package still lists: a 200 document names
the tarball filenames it lists, and a 404 names none. A placed file the answer does not list
gets files.upstream_gone_at, and a file it lists has the flag cleared, so a file upstream
lists again serves again from the next refresh. A flagged file is invisible to the
adapter-facing reads (the tarball and file reads, the file listing) and to the placement
check, so neither a direct read nor a virtual walk can reach it, and that holds for a
version pulled as malicious as much as for any other. FetchNPMTarball and the PyPI file
read fetch the document before they serve a placed copy, so a stale entry refreshes on a
lockfile-only install that never reads the packument. Only an answer sets the flag: a 5xx, a
401/403 (ErrUpstreamDenied is an outage here) or a document that does not parse says
nothing about the files, and the placed copy still serves. Retention removes a flagged row,
and the version and package rows it empties, once it has been flagged longer than
worker.retention.proxyStaleAfter; the collector reclaims the bytes later. Hosted rows are
never flagged. A document whose versions were dropped as unservable (Dropped) lists only
the versions the parser kept, so a placed file of a dropped version is flagged, which is the
safe direction. A PyPI 200 is believed only if it is this project’s index: a document with no
files list, or whose name normalizes to another project, is refused as unavailable and
flags nothing, as a packument with the wrong name is for npm. A missing name alone is
accepted, and files: [] is a real answer that upstream lists nothing. PyPI walks the same way: a proxy member whose index resolves owns the
answer for its project’s files, so a file it no longer lists is a 404 and a later member
listing the same filename is not asked. A member whose project answers 404 still moves the
walk on.
Rejected: keeping a placed file serving until retention collects it, as this ADR first did. It is the more available choice, but it serves a version upstream pulled for a reason, including malware, for as long as the cache entry is renewed, and a virtual and a direct read disagreed about one file. The accepted cost is that a pinned install breaks after a left-pad style unpublish, until upstream lists the file again. A second cost: a placed file read past its TTL now waits on upstream before it serves, because the refresh decides whether the file is still listed. With an upstream that accepts connections and never answers, each such read could wait the whole upstream timeout (30 seconds by default) before the placed copy serves. SIN-61 added the backoff below.
A failed refresh backs the repository off for 30 seconds, and a fresh read parses nothing
(SIN-61, v1.1.1). The state is a map from repository to the time it may be asked again, held
on remote.Client, in memory and per process, so a restart or another replica costs one
wait. The 30 seconds is a constant, not configuration. Only the upstream not answering at
all starts it: a connection that fails, or a timeout before the response headers arrive,
marked by an error of its own (errUpstreamDown). A 5xx is not a trigger. It is an answer,
and a fast one: it fails that one request as ErrUpstreamUnavailable with a stale copy still
served, exactly as before SIN-61, and costs the next request no more than a healthy
upstream would. The backoff exists to stop reads queueing on a wait, and a 5xx has none. A
timeout counts only while waiting for headers. A body that stalls after a 200 is read
outside the request, fails that read, and starts nothing. ErrUpstreamUnavailable is not
the trigger either, because a 5xx, an oversize or unparsable document and a 401/403 wrap it
too, and one package’s bad document must not turn away every other package of the
repository.
noteRefresh is the whole rule. A successful refresh or a 404 clears the backoff, since
either shows the upstream answering. 401, 403, 429, a 5xx and a document that does not
parse change nothing: they start no backoff and end none. 429 is not a trigger because it is
a fast answer that says the caller is going too fast, not that the upstream is down, and
a fixed 30 second window would be a guess at a Retry-After Sindri does not read; it also
says nothing about the other packages of the repository.
During a backoff, a stale document is read from the cache without contacting upstream,
a placed file serves through the placement check as always (I2), a file already flagged as
gone is a 404, and any other read fails at once as ErrUpstreamUnavailable, so a client
sees the 502 a real outage gives and a virtual walk fails as before, without asking the next
member. On a fresh document the
upstream_gone_at flag is authoritative, since the refresh that stored the document set it.
A placed file, or a flagged one, is then answered from the files rows alone and the
document is not loaded or parsed. A file that is neither placed nor flagged still needs the
document, to find where it lives. Both hold through a virtual repository.
Two costs. A file upstream removes while the repository is backing off keeps serving until a read after the window ends refreshes the document. That is no sooner than 30 seconds after the last failed refresh, and later if no read comes, since nothing refreshes in the background. The read that refreshes restarts the window if it fails too. And “only the first read waits” is true per window, not per concurrent read: reads already in flight when the first failure lands have already started their own wait, and each one’s failure restarts the window.
The estimate for a 500-package lockfile install at 16 concurrent reads against a blackholed upstream, every document past its TTL, is derived, not measured. Without a backoff the reads go in 500 / 16, about 32 rounds that each wait the 30 second timeout: roughly 16 minutes. With it, the first 16 reads are in flight together and all fail at about 30 seconds; the other 484 find the repository backing off and serve their placed copies at once, so the install takes roughly 30 seconds, or about 60 if it is still running when the window ends and one more read has to find out the upstream is still down. A figure that assumed the first read alone waits would be too low by that in-flight round.
A hosted package row survives the deletion of its last file. The claim is the packages
row, so deleting a file removes the version when emptied and keeps the package, hidden from
listings and absent on reads. A virtual still answers 404 for the name and does not ask a
proxy. Publishing to it reuses the row. Deleting the repository releases the claim, but
DeleteRepository refuses a repository that has promotion events, so such a repository’s
claim has no release path today. An accidental publish of @types/foo there blocks
@types/* through that virtual until its members are restructured. It fails closed. This
covers PyPI as well as npm. Rows lost to deletes made before this fix cannot be recovered,
so such a name stays unclaimed until it is published again.
dist.tarball is absolute, from a new top-level publicUrl. ADR 13’s root-relative
links do not work for npm. With a clean cache, install failed with ENOENT on
/npm/team/internal/rel/-/rel-1.0.0.tgz; with a warm cache it succeeded and wrote a
file:../../.. path into package-lock.json. The Host header stays rejected for ADR 13’s
reason. config check requires publicUrl when any npm repository exists, with the https
rule auth.oidc.redirectUrl has. It must be the origin in the client’s registry=: npm
sent no token to a tarball on another host, which Sindri would answer with a 401. A reload
reports that a changed publicUrl needs a restart.
Routes live under /npm/{repository}/ and are parsed from r.URL.EscapedPath(), since
clients send @acme%2fui and a decoded path loses the boundary. - is already a reserved
segment and @ is illegal in a repository name, so neither can occur in one. The leftmost
- segment splits the path:
| Path after the repository | Meaning |
|---|---|
{name}, @scope%2fname, @scope/name | packument GET, publish or deprecate PUT |
{name}/-/{file}.tgz, @scope/name/-/{file}.tgz | tarball |
-/package/{name}/dist-tags[/{tag}] | dist-tag GET, PUT, DELETE |
-/whoami | caller’s subject |
-/v1/login | constant 404 |
-/user/org.couchdb.user:{name} | login |
npm login verifies a credential, and issues nothing. Plain npm login POSTs to
-/v1/login. On a 404 it prompts for a username and password and PUTs them to -/user/...,
then stores the token from the response as _authToken. Sindri takes the password as an
existing OIDC, machine, or bootstrap token, checks it with Chain.Verify, and returns that
same token. The username is ignored, as auth.Credential already ignores it for Basic. A
failure is a 401, and the answer does not vary with the repository, so it cannot probe for
names.
Neither login route can authorize through auth.Authorize, because the client sends no
credential header. They expose no repository data, the credential simply travels in the
body, and each gets a named case in the npm route-walk test. They are the only exception to
security rule 7. The body holds a secret and is never logged (rule 4).
Migration 00008 is additive. It widens the protocol and kind CHECK constraints and
adds the two tables and the column. An older binary ignores all of it, and the rollback path
of running the previous binary does not run Down. Down, if run, keeps repositories, packages,
versions, and files, and restores the old constraints as NOT VALID, so it succeeds with npm
rows present. It does drop dist_tags, dist_tag_events, and versions.deprecated.
The preset stays npm. It is what presets.go and ARCHITECTURE.md already say, and it
matches pypi. The roadmap’s npmjs changes.
Checked against installers (SIN-51)
scripts/npm-tarball-differential.sh installs each tarball shape the parser accepts from a
local file with the npm on PATH (10.9.9 in the recorded run) and pnpm 10.34.9 and yarn 1.22.22,
which the script fetches at those exact versions. Installs use --ignore-scripts in temp
directories. The whole installed package.json is compared, key by key and by exact key, with the
sanitized manifest inspectManifest returned, not only its name, version and description. The
harness is internal/proto/npm/tarball_differential_test.go, behind the differential
build tag. Each tarball holds the real manifest and placeholder files. Shapes a client could misread
also hold a decoy, a second package.json with a different name, version and description,
where the misreading would land: a whole package/package.json entry inside the body of an
entry that could be misframed (the slash-ended, ..-cut and split-character names, the pax
size, tar-stream’s PaxHeader), or a name that a reader ignoring the ustar prefix or a pax
path would take as the manifest. The shapes of real tools’ forms (npm pack, no owner, NUL
typeflag, directories, zero blocks, pax keys, pax with no path) have no decoy: there is
nothing in them for a reader to land on. Where a decoy is installed, a disagreement shows
which document was read. The test fails if a shape’s parser outcome differs from the expected one, if a
client errors outside a named allowlist, or if no negative control shows a client
installing the decoy.
The recorded run had 64 candidate shapes (excluding controls): 44 accepted and compared, 20
refused and so skipped. Of the 132 client rows, all agree and none is a client error. One shape,
7 stray zero bytes after the end marker, was accepted in the earlier run: yarn 1.22.22 cannot
extract such a tarball (“Unexpected end of data”) while npm and pnpm install it. yarn reads no
manifest from it, so it was not manifest confusion, but a package that installs with two clients
and fails with a third is one a publisher cannot reproduce. SIN-59 decided to refuse it at
publish: after the end marker the parser accepts only whole 512-byte blocks of zeros. The shape
is now on the refused list, and the allowlist of tolerated client errors is empty. This applies
to hosted publishes only: publish.go is the one caller of the parser, and a proxied tarball is
stored as the upstream sent it and never passes through it. Five JSON-level shapes (a repeated
name, a repeated version and description, NAME before and after name, and Version
and Description beside the lower-case keys) show that all three clients and Sindri keep the
last value of a repeated key and treat a key that differs in case as a different key. Every agree row installed the
name, version and description the parser read, not the decoy’s.
| Shape | npm | pnpm | yarn |
|---|---|---|---|
| npm pack, pax path | agree | agree | agree |
| npm pack, ustar prefix | agree | agree | agree |
| tar-stream form | agree | agree | agree |
| npm form with no owner | agree | agree | agree |
| NUL typeflag | agree | agree | agree |
| directories with and without a slash | agree | agree | agree |
| manifest after other files | agree | agree | agree |
| extra zero blocks | agree | agree | agree |
| duplicate name key, last wins | agree | agree | agree |
| duplicate version and description keys | agree | agree | agree |
| NAME key before name | agree | agree | agree |
| NAME key after name | agree | agree | agree |
| Version and Description keys beside the lower-case ones | agree | agree | agree |
| manifest split over prefix and name | agree | agree | agree |
| manifest named by a pax path over a short name | agree | agree | agree |
| pax with every allowed key | agree | agree | agree |
| pax with no path | agree | agree | agree |
| pax size repeating the header’s | agree | agree | agree |
| pax path over a name ending in a slash | agree | agree | agree |
| pax path over a name cut after a parent segment | agree | agree | agree |
| pax path over a name cut inside a character | agree | agree | agree |
| ustar prefix naming a nested package.json | agree | agree | agree |
| decoy manifest as a plain second file | agree | agree | agree |
| decoy manifest one directory down | agree | agree | agree |
| decoy manifest two directories down | agree | agree | agree |
| decoy manifest under the NTFS short-name lookalike | agree | agree | agree |
| pax path replacing PaxHeader | agree | agree | agree |
| pax path replacing package/cut-short/ | agree | agree | agree |
| pax path replacing package/cut-short. | agree | agree | agree |
| pax path replacing package/cut-short | agree | agree | agree |
| pax path replacing package/c: | agree | agree | agree |
| pax path replacing package/foo:bar.js | agree | agree | agree |
| pax path replacing package/nested/package.json | agree | agree | agree |
| pax path replacing package/nested/c:/package.json | agree | agree | agree |
| pax path replacing package/c:/nested/package.json | agree | agree | agree |
| pax path replacing //server/share/package/nested/package.json | agree | agree | agree |
| pax path replacing //?/c:/package/nested/package.json | agree | agree | agree |
| pax path replacing ab:/package/nested/package.json | agree | agree | agree |
| pax path replacing package/1:/package.json | agree | agree | agree |
| pax path replacing package/package.jso | agree | agree | agree |
| pax path replacing package/package.json.js | agree | agree | agree |
| pax path replacing package/nested/PACKAG~1.JSO | agree | agree | agree |
| pax path replacing package/PACKAG~1.JSON | agree | agree | agree |
| pax path replacing package/README~1.JSO | agree | agree | agree |
Negative controls check that the comparison can see a disagreement. They are shapes the parser refuses, because an installer takes the decoy, sent to the clients anyway:
| Negative control (refused by the parser, sent anyway) | npm | pnpm | yarn |
|---|---|---|---|
| second manifest | DISAGREE | DISAGREE | DISAGREE |
| manifest under another top directory | DISAGREE | DISAGREE | DISAGREE |
| manifest in upper case | DISAGREE | agree | DISAGREE |
Not tested (SIN-58): Windows name handling. Drive roots, 8.3 short names, trailing dots and spaces, UNC roots and backslashes cannot be exercised on this platform, so those refusals rest on reasoning and Unix reproductions only. The “upper case” control also depends on the filesystem: this run was on macOS, whose default filesystem folds case.
Consequences
- A third protocol did need a schema change, and it also needed per-protocol normalization in the core. The third adapter is still mostly an adapter, but “cheap” has these limits.
- Sindri gets its first origin setting, used only by npm.
testdata/config/sindri.yamlhas to carry it, and a wrong value breaks installs or pins a bad host into lockfiles. - An OIDC token stored by
npm loginexpires with the token, so people re-run login, and CI uses machine tokens. Issuing machine tokens stays admin-only. - A fork of one
@types/*package in a hosted repository blocks all of@types/*through any virtual repository containing it. It fails closed with a 404; the fix is a separate hosted repository or a new name. - A scope has no claim until its first publish. Nothing can depend on an internal package before it exists, so this is accepted.
- Two proxies in one virtual repository do not combine versions; the first with the package wins. A team that needs otherwise can reorder the members.
npm viewshows no readme, because the packument omits it.- The login path carries the username npm prompted for, so a token typed there by mistake would reach the access log, which records the path. The password travels in the body and stays out of it.
- Tag moves are recorded and OCI tag moves still are not. Bringing OCI in line is separate work.
- A name claim now survives deleting a package’s last file, as section 4 says “ever
published” means. A deleted version number is now refused too (SIN-52): deleting a
hosted file records its version in
retired_filesin the same transaction, and a publish checks that table after its exclusive insert, so the insert’s wait for an in-flight delete makes the tombstone visible. The refusal isErrVersionExists, the same 409 as a live version, and it applies to identical bytes as well: this is a behaviour change, because republishing a deleted version used to succeed. Versions deleted before migration 00009 are not remembered and can still be published again. Only hosted npm and PyPI repositories retire anything: a proxy and a hosted OCI-protocol repository do not. - Versions published before 1.1.1 have no recorded publish time and are left out of the
timemap, so yarn 4 quarantines them (see above). There is no backfill. - The proxy downloads and caches whole upstream documents, which costs upstream traffic,
parsing, response size and cache size. Sindri serves upstream’s
time, sonpm install --beforeand release-age settings work through a proxy. - A proxy takes only tarballs on its own host under its base path, with no off-origin
redirects. Registries that write
%2finto a tarball URL, or redirect downloads to a CDN, get a 502 or are left out. Bearer credentials and private upstreams are SIN-53. - A refused credential on a proxy member fails the walk with a 502 rather than letting it fall to the next member (SIN-55).
Rejected
- Storing the packument. A second source of truth, rewritten on every publish, that can disagree with placement.
- Serving the manifest from the publish body. npm’s own manifest-confusion problem: the metadata promises one set of dependencies and the tarball holds another.
archive/tarplus per-shape checks. Go and node-tar disagree on too many header shapes to list: review reproduced more than a dozen where Sindri read onepackage.jsonand npm installed another, and each fix only exposed the next.- Reusing
tagsfor dist-tags. It targets a digest, and a row counts as a placement and a GC root, so a dist-tag could keep a deleted version’s tarball readable. - Recording tag moves in
lifecycle_events. Its actions are approve and revoke, every row needs a stage, and it is keyed by digest. A tag move is none of those. - Fetching abbreviated packuments from the upstream. This was the M9 choice, and
v1.1.1 reversed it: the abbreviated form has no
time, so yarn 4 on defaults,--beforeand release-age settings all failed through a proxy. - Backfilling
published_atfor existing versions. The only candidate is the migration time or the first-read time, and both are made-up publish times. A client gating on age would trust them. - Declaring a length on a proxied tarball and aborting on a bad hash. The length frames the body as complete, and net/http then computes the end of the response from it, so the abort cannot be told from a finished download.
- Cleaning a
dist.tarballpath. Normalizing dot segments and encodings is the behaviour a hostile author depends on. Refusing the spellings leaves nothing to agree on. - Refusing a same-origin redirect outside the base path. It would break registries that move tarballs on their own host. Stopping the credentials closes the same risk.
- Failing the walk on a refusal for npm only. Smaller, since npm resolves through its own closures, but it would leave the protocols different. SIN-55 chose all three, with Docker Hub, quay.io and ghcr.io’s refusals of unknown names kept as misses (ADR 14).
- Merging packuments per version. A hostile
99.0.0can appear under a name it should never reach. ADR 14 already rejected merging, and I5 forbids it. - Declaring scopes in config. It closes the first-publish gap at the cost of a field that can drift from what is published.
- The Host header for
dist.tarball. Client input reflected into a document that lockfiles then pin. - npm’s web login. It needs a pending-login table, an anonymous polling endpoint, and a token minted for a user. A minted token cannot carry groups, which ADR 18 says are never stored.
- Minting a token at the login route. Same objection, and a machine token cannot stand in for a person.
- Treating an identical re-publish as idempotent, as PyPI does. The roadmap refuses it, and a publish also moves a dist-tag, so a silent no-op would leave it unclear whether the tag moved.
25. The announcement requires M10, a Helm chart, and the first half of M11
- Status: Accepted
- Date: 2026-11-05
- Amends: ADR 22 (the Helm chart’s place, and when the announcement happens)
- Relates to: ADR 23, roadmap “After v1”
Context
ADR 22 allowed a public announcement once M10 was done, and put the Helm chart behind M11 because a polyglot team usually runs a VM or Compose. Planning the sprints after v1.1.0 asked what Sindri must honestly offer on the day it is announced. Security is the product, so docs alone were not enough to say so.
Decision
The announcement follows v1.3.0 and requires:
- OCI, PyPI, and npm, with the other formats promised for later.
- The docs of M10.
- Deployment guides for Docker Compose and for Kubernetes through a Helm chart.
- This claim, and its limits: with scanning enabled, every hosted publish is scanned, and promotion is refused above a severity. Scanning stays off by default, as ADR 23 decided. Cached proxy content is not scanned, because it has no subject. The claim’s wording follows what the M11a ADR decides each protocol’s scan covers, since a wheel or an npm tarball declares ranges and its scan goes less deep than an image’s.
A hardening release, v1.1.1, comes before M10. It fixes what a first adopter or a security reader would hit first, such as yarn 4 refusing every package on its default settings (SIN-60).
The Helm chart moves into M10, alone. It runs one replica, because upload sessions live
in process memory (internal/cas/cas.go) and a chunked push would break across replicas.
Several replicas, split serve modes, and the admission webhook stay in Later. ADR 22’s
audience does not change: this adds a way to deploy, not a new first user.
M11 splits. M11a (v1.3.0) is the config section, scan on publish, the severity gate, and the Trivy image, which is what makes the claim true without extra installs. M11b (v1.4.0, after the announcement) is the daily re-scan, the vulnerability UI, and the referrers API.
Consequences
- The announcement is later than ADR 22 implied, by the two M11a sprints.
- At announcement, a CVE published after an artifact was scanned is not flagged until M11b. The announcement must not imply otherwise, and ADR 22’s reasoning that Harbor users expect scanning is only partly met until then.
- Kubernetes users get a chart with no high availability at first, and the guide says so.
- The M10 gate gains a
kindcluster.
Rejected
- Announcing at M10, as ADR 22 allowed. It is sooner, but it invites security-minded readers before Sindri can enforce anything about vulnerabilities.
- All of M11 first. The re-scan and the UI strengthen the claim but are not needed to make it, and the referrers API is independent of it.
- More protocols first. Each is a milestone of its own, and these three cover the audience ADR 22 chose.
- A multi-replica chart from the start. It needs shared upload sessions and an audit of per-process state, which is work no first adopter on one team has asked for.
- Leaving the chart in Later and documenting Compose only. That was ADR 22’s position. The project owner wants Kubernetes covered on announcement day.
26. The docs site is built by mdBook from plain markdown, and lychee checks its links
Context
M10 asks for a docs site built from docs/ and published on every release. The pages that
exist (quickstart, configuration reference, upgrading, and the ADRs) are plain markdown
that GitHub renders today, and the quickstart’s commands are read out of the page by its
gate script. Whatever builds the site must not make those pages worse to read in the
repository, or harder for a script to parse.
The generator is build tooling. ADR 2’s single-binary promise is about what an operator runs, so a docs toolchain does not break it. It does add a dependency to CI and to a contributor’s machine, and that cost should stay small.
Decision
mdBook builds the site. docs/book.toml and docs/SUMMARY.md are the only
generator-specific files. Every page stays a plain markdown file with relative .md links,
so it reads the same on GitHub as on the site. mdBook rewrites those links to .html and
adds search, a sidebar, and a print view.
lychee checks every link in the built site, anchors included, offline. make docs
builds the site into ./site and fails on a broken internal link or a missing anchor.
Links to other sites are checked by make docs-links-external, which is not part of the
gate: a gate that fails because someone else’s server is down teaches people to ignore it.
Both are pinned binaries, checked against a sha256 before use.
scripts/install-docs-tools.sh downloads them, and make tools and CI both run it. mdBook
publishes no checksums, so its sums were computed from the release assets when the version
was pinned. A version bump updates the version and every sum together.
A link out of docs/ points at GitHub, at main. The site only contains docs/, so a
relative link to ARCHITECTURE.md or deploy/ would break on it. Pointing at main means
a page for an old release can link to a newer file. That is acceptable while one version
of the docs is published.
The release workflow publishes the site to GitHub Pages after the release job
succeeds, so the site never describes a version that failed to publish. CI runs
make docs on every pull request.
A directory’s index page is index.md, not README.md. mdBook renames a README.md
chapter to index.html but does not rewrite links to it. The root page, docs/README.md,
is the exception: nothing links to it by name, and GitHub shows it for the directory.
Consequences
- A new page is not on the site until it is in
SUMMARY.md. mdBook ignores a file it is not told about, and the docs tests fail on a page missing fromSUMMARY.md. - One version of the docs is published: the most recent release tag, pre-releases excluded. A patch tagged on an older release line would publish that line’s docs over the newer ones; while there is one release line that cannot happen. Docs for older versions are in the repository at their tag.
- The
github-pagesenvironment GitHub creates deploys only from the default branch, so it must be given a rule forv*tags when Pages is enabled. - The site looks plain. It works for reference documentation; a marketing site is out of scope for M10 anyway.
Rejected
- Hugo. A Go tool, and well themed. But every page needs front matter, and relative
.mdlinks only resolve with render hooks orrefshortcodes. Either waydocs/would read worse on GitHub, and the quickstart gate would have to skip the extra syntax. - MkDocs with Material. The most polished result, and common for infrastructure projects. It needs a Python toolchain in CI and on contributors’ machines, and Material went into maintenance mode in 2025, with its authors moving to a successor.
- Docusaurus, VitePress, and other JavaScript generators. They need a Node toolchain
and a
package.jsonwith a lockfile to keep current. That is a lot of supply chain for four pages and the ADRs. - A GitHub wiki. Already rejected by the roadmap: docs live in the repository, so they are versioned and reviewed with the code.
- GitHub’s own markdown rendering, with no site. It costs nothing, but has no search, no navigation across pages, and nothing checks the links.
- Versioned docs (one site per release). mdBook has no built-in versioning, and nobody needs it yet. Revisit this when two supported release lines exist at once.
27. Upstream credentials may be a Bearer token
Context
ADR 15 gave every credential a username and a password, and the proxy sent them as
HTTP Basic. A private npm registry such as Verdaccio, or a hosted one, commonly issues a
token that the client sends as Authorization: Bearer <token>. With Basic only, a team
moving from such a registry could not point a Sindri proxy at it, and the migration guide
had nothing to tell them.
Decision
A credential is either username and password, or token. Setting both, or
neither, is a validation error when the configuration loads. token is redacted by
config show like the other secrets. Loading keeps the one shape ADR 7 asks for: there
is no second spelling.
credentials:
npm-private:
token: ${NPM_TOKEN}
A token is sent as Authorization: Bearer <token>, and a password as Basic, from the
same place in internal/remote. remote.Credentials.Lookup returns a typed
remote.Credential instead of a username and password, so no caller can ignore the kind.
Both are sent only to the upstream’s own origin, exactly as in ADR 14 (whose one
exception is an OCI proxy’s username and password reaching its token realm over https). The redirect
rules that strip Authorization when a redirect leaves the origin already cover a Bearer
header, and a test now proves it. An upstream document that names another host (an npm
tarball URL) never receives the token.
A token credential on an OCI proxy is refused when the repository is written. An OCI
registry authenticates a client by exchanging Basic credentials at its token realm for a
short-lived Bearer token. A static token has no defined meaning in that exchange, and
sending one to a realm would be guessing. The error names the credential and says OCI
needs username and password. To enforce this, Credentials.Names() becomes a map from name
to kind (basic or token). A kind is not a secret, so the rule that the reconciler sees
no secrets still holds. If a reload changes a credential’s kind under a stored OCI
repository, every OCI request to that upstream fails with an error naming the credential
reference, and the token is sent neither to the registry nor to its token realm.
Rejected
- A
scheme:field (scheme: bearerbesidepassword). It lets an operator write a Bearer token into a field calledpassword, and makesbasicthe default that most people never write.tokensays what the value is, and “exactly one of” is checkable. - An npm-only token, a different section or a protocol flag. Credentials are looked up by name and sent by one function; a per-protocol token would fork that, and PyPI indexes behind a token proxy would need the same thing again. OCI is the one protocol where the kind does not apply, and that is a validation rule, not a second mechanism.
- Sending a token to an OCI token realm as the password. Registries differ on whether that works, and a silent success on one and a 401 on another is worse than a clear refusal.
Tried against a real registry
scripts/migrate-verdaccio-gate.sh runs a Verdaccio 6.11.1 container (pinned by
digest) that requires a login for @acme/*, and a Sindri proxy whose upstream
is that Verdaccio with token: set to a token made by npm token create.
Verdaccio’s own log shows Sindri’s reads of the private packument and tarball
under the token’s account, and the gate fails if the proxy cannot read the
package. The Bearer path works end to end.
The npm proxy’s strict tarball rules (ADR 24) were checked against what Verdaccio really writes:
- Scoped packages pass. Verdaccio’s tarball links are
/@acme/legacy/-/legacy-1.0.0.tgz: no%2f, a basename ending.tgz, and under the upstream’s base path. None of those rules refused them. - One rule does refuse a real configuration: the same-host rule. A Verdaccio
that advertises another public URL (
VERDACCIO_PUBLIC_URL,url_prefix) than the one Sindri reaches it at writes tarball links on that other host, and the proxy answers 502 for each, loggingtarball URL is on another host. Packuments still serve. It is not relaxed: the credential goes with the tarball request, and a link that names another host is exactly the hostile packument the rule exists for. The migration guide tells the operator to pointupstream.urlat the public URL, and the gate covers the refusal. - A cross-origin redirect was not exercised. Verdaccio serves tarballs directly. A Verdaccio with an S3 storage plugin that redirects to the bucket is unverified, as are GitHub Packages and registries that redirect tarballs to a CDN. By the redirect rules above the token is not sent there, so such an upstream may need its tarballs served without a redirect.
The same gate also found, outside Sindri, that npm 10.9.9’s
replace-registry-host=always doubles the repository path in Sindri’s own
tarball links, and that a named host must be written without its port. Both are
in the guide.
Consequences
remote.StaticCredentialsandconfig.CredentialStore.Lookupchange shape, so out-of-tree code implementingremote.Credentialsmust be updated. Sindri has no such callers.reconcile.ValidateOptions.Credentials,reconcile.New, andapi.Options.Credentialscarrymap[string]model.CredentialKindinstead of a set of names.- Existing configuration files are unaffected:
usernameandpasswordstill mean Basic.
Amendment (1.5.1): no credentials in upstream.url
upstream.url is displayed, so a secret written into it (https://user:token@host) was
shown by the UI, printed by sindri diff and apply, and carried into error text. SIN-116
closes that.
- Refused at write time. The API (400,
ErrInvalidInput) andconfig check/serve --config/applyrefuse a proxy upstream URL with a userinfo part. The message names the field and points atcredentials:; it never echoes the URL, and the old echo of a malformed URL inconfig checkis gone too. - Existing rows keep working. An API-created repository stored with userinfo still
authenticates as before: outgoing requests are not changed. Refusing to start on such a
row would brick an upgrade, so startup logs one warning per repository, naming only the
repository. Config-managed rows fail
config checkand must be fixed before the upgrade. - Every read path redacts. The UI, the diff fields from
registry.Changesandconfig showuse one helper (model.RedactUserinfo, exposed asconfig.RedactUserinfo). The API never returned the URL. Ininternal/remote, net/http masks a URL’s password in a*url.Errorbut prints the user name, sodown()strips the userinfo from it.
Rejected: stripping userinfo from outgoing requests (breaks working deployments on upgrade), and a migration that moves the secret into a credentials entry (the credentials live in the server configuration, not the database, so a migration cannot create them).
28. The Helm chart lives in this repository and is published to ghcr as an OCI artifact
Context
ADR 25 moved a one-replica Helm chart into M10, and left its location and publishing to an
ADR. Three things constrain it. Upload sessions live in process memory
(internal/cas/cas.go), so a chunked push breaks if two pods serve one upload. There is
one configuration file and one loader, and a chart is an easy place to grow a second
format by accident. And the guide’s install commands must be the ones a gate runs, so the
chart and the guide have to change together.
Decision
The chart is at charts/sindri, reviewed and tested with the code it deploys.
The release workflow publishes it to oci://ghcr.io/spjdevops/charts/sindri, after the
release job succeeds, using the registry and token that already publish the image.
The chart’s version and appVersion are the release tag. Chart.yaml in the
repository says 0.0.0-dev, and the workflow sets both when it packages. A chart version
therefore names exactly one Sindri version, and there is no chart release without a Sindri
release.
One replica, with no value to change it. The Deployment uses strategy: Recreate,
because a rolling update runs two pods for a moment and an upload in progress could land
on either.
The config value is sindri.yaml. The chart writes that block into a ConfigMap
unchanged and the one loader reads it, so every key in the configuration reference works
and the chart adds no format of its own. Secrets stay out of it: envFrom names
operator-created Secrets, and the file refers to them with ${VAR}. The chart contains no
credential, not even a development one.
The operator brings Postgres, the blob store, the identity provider, and TLS. The chart bundles none of them. A PersistentVolumeClaim is available for the filesystem backend, and is off by default.
The optional Ingress lists Sindri’s public paths rather than routing /. /metrics,
/healthz, and /readyz share the main listener and carry no authentication, so routing
everything would publish them. They remain reachable inside the cluster through the
Service.
Consequences
- The chart can’t be patched without a Sindri release. A chart-only fix ships as a patch release of Sindri.
helm installneeds Helm 3.8 or later, the first release that can pull from an OCI registry by default.- The
chartspackage on ghcr is private when first pushed and has to be made public by hand, once. - A rollout takes the server down briefly. One replica has downtime on any restart, and
Recreatemakes that explicit rather than racing uploads. - Several replicas stay a separate decision (SIN-71), and it will have to move upload sessions out of process memory first.
Alternatives rejected
- A classic Helm repository on GitHub Pages. It would allow
helm repo add, but it shares the Pages deployment with the docs site, needs anindex.yamlkept in step, and adds a second publishing path beside the registry that already holds the image. - A separate charts repository. The chart could version independently, which nobody has asked for, and the guide’s commands could drift from the chart they describe.
- Bundling Postgres and MinIO as subcharts. That makes the first install shorter and makes this project responsible for operating a database in someone’s cluster. The quickstart already covers trying Sindri with nothing installed.
- Typed values translated into
sindri.yaml. Each setting would exist twice, and the template would be a second configuration parser, which CLAUDE.md rules out. - A
replicaCountvalue that defaults to 1. A value invites being changed, and the failure it causes, a chunked push that breaks intermittently, would be hard to diagnose.
29. What a scan covers, and which scans a severity gate trusts
Context
ADR 23 decided that Sindri runs Trivy as a queue job and attaches the result as evidence. ADR 25 left one thing open: what each protocol’s scan covers, because a wheel or an npm tarball declares dependency ranges and its scan goes less deep than an image’s. The severity gate in the next sprint needs a second answer: whose scans it may believe. Evidence attached by a client is a claim by the client, and a gate that reads it can be satisfied by anyone who can publish.
Decision
What Trivy is pointed at, per subject kind.
oci-manifest: the worker writes the manifest, config, and layers into an OCI image layout in a temp directory and runstrivy image --input <layout>. The evidence claims the OS packages and language packages installed in the image, at their pinned versions. It claims nothing about what is not in the layers.oci-index: each child image manifest is scanned the same way, and the index subject gets onesbomandscanpair per platform, withplatformin the metadata. Children pushed on their own are subjects too and have their own scans. Only a BuildKit attestation (annotated as one and with platformunknown/unknown) is skipped; the label alone proves nothing. A nested index or a child of unknown media type fails the whole job with no evidence, as does any blob the publishing repository does not hold (the job names that repository, and the scanner checks placement before reading each blob). Shared layers are staged once per job and hard-linked into each platform’s layout. Two distinct children with the same platform (os, architecture, variant, os.version, os.features) fail the job with no evidence, so a gate reading the newest scan per platform cannot be shown the benign one only.pypi-dist(wheel or sdist) andnpm-tarball: the worker unpacks the archive into a temp directory, with a size cap and path traversal refused, and runstrivy rootfs. The evidence claims the package’s own name and version, and anything pinned inside the archive: a bundlednode_modules,npm-shrinkwrap.json, vendored code, adist-infooregg-info. It does not claim the declared dependency ranges, which are never resolved. An sdist withoutegg-infometadata may report nothing about itself.file: not scanned. The job succeeds and logs the unsupported kind.
Cached proxy content is never scanned, because it has no subject (ADR 16).
The evidence. One Trivy run per target produces the JSON report (scan, media type
application/vnd.aquasec.trivy.report+json), and trivy convert turns that report into
CycloneDX (sbom, application/vnd.cyclonedx+json). Both are written through
evidence.Attach and so through cas, with its write intent recorded first (ADR 19).
Metadata keys: producer, scanner, scanner_version, db_updated_at,
severity_counts (CRITICAL, HIGH, MEDIUM, LOW, UNKNOWN), coverage (image or
package), and platform for an index child. (Amended by ADR 30:
scan rows also carry vulnerabilities, and index-child rows platforms.)
Trust. Severity rules read only evidence whose metadata says producer: sindri. Only
the worker writes that key. The API always stores {} as metadata and cannot be made to
set it, so a client cannot forge a clean scan. Client-attached scans still satisfy
presence gates, which ADR 16 does not change.
Gate semantics, recorded now for the severity gate. The rule reads the newest Sindri scan per platform. If there is none, because the job is queued, failed after its retries, or the subject was published before scanning was on, the gate refuses. The ledger records which evidence ids were evaluated. A scan is a point-in-time claim, and later evidence never rewrites a decision (ADR 23).
Failures. A failing scan retries through the queue’s backoff, with the same maximum attempts as other jobs. A subject whose scan job is exhausted has no Sindri scan, so a severity gate refuses it.
Consequences
- A clean wheel or tarball scan means its own version and its pinned contents have no known
findings. It does not mean what
pipornpmwill install alongside it is clean. Teams that need that scan their lockfile in CI and attach the result for presence gates. - The announcement wording has to match these limits (ADR 25), and the scanning docs page (SIN-72) states them.
- Turning scanning on does not scan what was published earlier. Those subjects are refused by a severity gate until they are scanned.
- The scan job must pull every layer of an image into a temp directory, so disk use is bounded by image size, and archives are bounded by the size cap.
Alternatives rejected
- Resolving dependency ranges. The result would depend on the hour of the scan, so the same bytes could pass today and fail tomorrow, and it cannot be reproduced.
- Trusting client-attached scans for severity. They are forgeable by anyone who can publish.
- SARIF as the scan format. It carries severity poorly and differently per tool, and the gate needs to read it.
- Scanning an index as one image. Trivy picks one platform and the rest go unscanned.
- Scanning proxy content. It has no subject to attach evidence to (ADR 16).
- Generating the SBOM with a second tool. Two runs could disagree about what the artifact contains.
30. The severity gate: a ceiling, read from worker metadata
Context
ADR 16 gates promotion on the presence of evidence. ADR 29 decided which scans a
severity rule may believe (Sindri’s own, marked producer: sindri) and left the rule
itself open: what the number means, and how the gate reads a scan without doing
unbounded work inside the promotion transaction.
Decision
The rule is a ceiling. {"scan": {"max_severity": "high"}} means HIGH is the
highest severity allowed: the gate refuses CRITICAL findings only. medium refuses HIGH
and CRITICAL, low refuses MEDIUM and above, and critical allows every named severity.
Valid values are critical, high, medium, low, lowercase. The order is CRITICAL >
HIGH > MEDIUM > LOW.
UNKNOWN is refused by every ceiling. Trivy reports UNKNOWN when it cannot rate a
finding. Passing it would let an unrated finding through, so the gate fails closed, as
ADR 29 does for a missing scan. critical therefore refuses exactly the UNKNOWN
findings.
The gate reads metadata, not blobs. The worker writes vulnerabilities into the
scan evidence metadata: a list of {id, severity}, de-duplicated by (id, severity)
and sorted by severity descending, then id. It is always present on a Sindri scan, an
empty list when clean. The gate runs inside the promotion transaction and reads only
that jsonb, so it opens no blob and holds no object-store connection under a lock, and
the 409 can name the CVE ids.
Which scans. The newest Sindri scan per platform is read (an index has one per
platform, and every platform must pass). A newer clean scan supersedes an older failing
one. A scan without producer: sindri never counts, whatever it says.
Every platform of an index. The worker attaches an index’s platforms one after
another, so a failed job or a promotion mid-job can leave scans for only some. The worker
therefore writes platforms (the job’s full platform list, sorted) into the metadata of
each scan of an index child, including the child that has no platform, which is keyed
by the empty string exactly as the newest-scan-per-platform query keys it; a
single-manifest subject has no platform and no platforms. The newest scan per
platform may come from different jobs (a later re-scan that attached fewer platforms
combines with older ones); that is accepted, since each is still a Sindri scan of the
same bytes. The gate takes the platforms list of the newest Sindri scan as the required
set and refuses, with “scan incomplete: no Sindri scan for platform X”, when any of them
lacks a scan. An index-child scan without platforms refuses like one without
vulnerabilities: it needs a new scan.
Refusals. No Sindri scan for the subject refuses. A Sindri scan whose metadata has no
vulnerabilities key refuses and says it needs a new scan; no released build has scans,
because scanning landed after v1.2.0, so this only guards against a partial upgrade.
The ledger. An approve event records the ids of the evidence each gate read, in a
nullable evidence_ids uuid[] column, which ADR 29 requires. A presence rule records the
evidence that satisfied it, a scan rule the scans it evaluated. The column is additive,
so one version back ignores it.
Consequences
- A rule is stored as
{"scan":{"max_severity":"high"}}beside{"evidence":"sbom"}; exactly one of the two keys is set. - Metadata grows with the finding count. A scan with thousands of findings stores a few hundred kilobytes of jsonb; that is the price of reading no blob.
- A later, worse scan does not revoke an approval (ADR 23). The ledger shows what was evaluated.
- Rolling back to 1.2.x with a scan rule stored stops that binary from starting under
serve --config, because its rule parser rejects thescankey (it fails closed). Remove scan gates before rolling back.
Alternatives rejected
- Threshold semantics (
max_severity: highrefuses HIGH and above). It reads like a limit but fails on the value it names; users writehighmeaning “up to high”. - Reading the report blob inside the promotion transaction. It holds a transaction open across object-store I/O and parses megabytes under load.
- UNKNOWN passing. An unrated finding would be waved through by exactly the rule meant to catch what was not assessed.
- Counts only (
severity_counts). They cannot name a CVE, so the refusal could not tell the operator what to fix.
31. Re-scanning approved subjects, and what a new finding does
Context
A scan describes the vulnerabilities known on the day it ran. An approved subject keeps running long after that, and a CVE published next month is invisible until something scans it again. M11b closes that gap without changing what approval means.
Decision
- What is re-scanned. Every subject with a current
approverow in thelifecycle_currentview, for any stage. A schedule (job kindrescan_approved) runs everyscanning.rescanIntervaland enqueues one ordinaryscanjob per approved subject, reusing the scan job’s dedupe keyscan:<digest>, so a scan already queued or running is not doubled. - Which repository the re-scan reads from. A scan job carries a repository and reads
only blobs that repository places (I2). The re-scan uses the lowest-named hosted
owner repository (from
subject_owners) that still places the subject, checked with the predicate ofCheckPlacement. Owner rows outlive a placement (only the collector removes them), so an owner that has since deleted the subject is passed over for the next one. A subject no hosted owner places is left out of the schedule. - The ledger is untouched. A re-scan only adds evidence rows. It never writes
lifecycle_events, never revokes, and never changes a decision already made. The next promotion’s severity gate reads the newest Sindri scan, so a new finding blocks future promotions only. - A new finding. A vulnerability ID present in the newest Sindri scan for a platform
and absent from the previous Sindri scan of the same subject and platform. The worker
computes it when it attaches the scan and writes the sorted IDs as
new_vulnerabilitiesin the scan evidence metadata. A first scan has no previous one, and a scan written before thevulnerabilitieslist existed (an M11a-era scan) has no list to compare with; neither carries anew_vulnerabilitiesfield. IDs are compared, not packages. - Findings carry package detail. Each entry of the metadata’s
vulnerabilitieslist gainspackage,installed, andfixed(Trivy’s PkgName, InstalledVersion, FixedVersion;fixedis empty when there is no fix). Entries are one per (id, package, installed version);severity_countskeep their ADR 30 meaning. Older scans without these fields stay valid. - The metric.
sindri_approved_findings{severity}is a gauge read at scrape time: the number of currently approved subjects whose newest Sindri scan (any platform) has at least one finding of that severity. The labels CRITICAL, HIGH, MEDIUM, LOW, and UNKNOWN are always present. - On-demand re-scan.
POST /api/v1/subjects/{digest}/scanenqueues a scan of one subject. It needs write on a hosted owner repository of the subject. A caller who cannot read the subject gets 404; one who can read it but not write it gets 403, the same as promote, revoke, and attach (all go throughrequireSubject). It answers 202 with the job (a scan already queued or running is returned instead of a second one); an administrator gets the full job and aLocationforGET /jobs/{id}, anyone else onlyid,kind, andstate; and 409 when it cannot run:SCANNING_DISABLEDwhen scanning is off, andNO_HOSTED_REPOSITORYwhen no hosted repository the caller may write holds the subject. It is the way to re-scan an npm version, which npm will not re-publish (docs/scanning.mdpromises this). - Config.
scanning.rescanInterval, a duration, default24h.0sdisables the schedule; the on-demand route still works. Values below1mand negative values are refused.
Consequences
- A re-scan costs one Trivy run per approved subject per interval. Cost follows what is approved, not the registry’s whole history.
- An approved subject with a new CRITICAL finding stays approved. The gauge, the new finding list, and the UI show it; a person decides what to do.
- Scan evidence grows by one row per subject per interval. Retention of evidence rows is a separate question and is not decided here.
- Metadata grows by the package fields; the gate still reads only
idandseverity.
Alternatives rejected
- Auto-revoke on a new finding. It rewrites what was approved and could take production down on a CVE that has no fix yet. Revoking stays a person’s call.
- A counter of new findings. It resets on restart and is awkward to alert on. A gauge answers “is something in production vulnerable right now”.
- Re-scanning every subject. Cost grows with history, and an unapproved artifact is not running anywhere.
- Diffing by package instead of ID. A package version bump that keeps the same CVE would look new, and one CVE reported against two packages would look like two.
- Putting the interval under
worker:. It only exists when scanning is on, so it belongs beside the other scanning settings.
32. The OCI referrers API: a view over placed manifests
Context
cosign, oras, Notation, and Trivy attach a signature or an SBOM to an image by pushing a
second manifest whose subject field names the image, and they find it again through
GET /v2/<name>/referrers/<digest>. Sindri stored such manifests and ignored the field,
so nothing attached this way could be found, and the 20 conformance specs for it have
been skipped since M3. Sindri also has its own evidence model (ADR 16), which gates
promotion. This ADR says how the two relate.
Decision
- A referrer is a manifest with a
subject, and nothing more. On a hosted manifest push, Sindri records the manifest’s subject digest, media type, artifact type, size, and annotations inmanifest_subjects, keyed by the manifest’s own digest. These are facts read from the bytes alone, never from theContent-Typea client sent, and the first push writes the row for good: it is shared by every repository that places the digest, so a later push must not be able to change it. An image manifest and an index may both carry a subject. The subject does not have to exist: the specification allows a referrer to arrive first. - Referrers are never evidence. A referrer is not copied into the
evidencetable, and no gate readsmanifest_subjects. Asignatureorsbomgate is satisfied only by evidence attached through/api/v1, as before. The referrers API is for standard tooling to find what standard tooling pushed. - Placement decides what is listed (I2). The listing for a repository holds the
referrers that are placed in that repository (
repository_blobs), and no others. The same subject digest in two repositories has two separate lists. Deleting a referrer manifest by digest removes its placement, and with it the entry. As with blobs, placement is per Sindri repository, not per image name inside it. - The response.
GET /v2/<name>/referrers/<digest>needs read on the repository, like every other read. It answers 200 with an OCI image index, empty when nothing refers to the digest or the digest is unknown, and 400 for a malformed digest. Each descriptor carries the referrer’sartifactType(for an image manifest without one, its config media type) and annotations.?artifactType=filters the list and setsOCI-Filters-Applied: artifactType. Long lists are paged with aLinkheader. A manifest push with a subject answers withOCI-Subject, which tells a client that it need not maintain the fallback tag. - Hosted, proxy, virtual. A hosted repository answers from its own placements. A proxy answers with an empty index and contacts no upstream. A virtual repository answers from the first hosted member, in member order, that the caller may read and that places the subject; proxy members are passed over; if there is none, the index is empty. Lists are never merged across members (I5).
- A referrer lives as long as its subject, in a repository that holds both. The garbage collector treats a referrer as reachable when its subject is reachable and some repository places both of them. It is collected with its subject, or after the grace period once it has been deleted from that repository. A referrer whose subject never arrives is collected like any untagged manifest.
- A referrer that is not an image is not scanned on publish. A signature or an SBOM
is a document, and a Trivy run on it is noise. The test is the manifest itself: it
names a subject, it is not an index, its config is not an image config, and none of
its layers has an image layer media type. Anything that looks like an image in either
respect is scanned like any other, so a
subjectfield and an odd config type are not a way around the scan. A manifest that skips the scan has no Sindri scan, so a severity gate refuses it (ADR 30); the on-demand scan route still works. - No backfill. Manifests with a subject that were pushed before this release are stored but not listed. Pushing them again lists them.
referrersis a reserved repository name segment for new repositories, with the other adapter markers (ADR 13). The route is recognised only as the last two path segments,/referrers/<digest>, so an existing repository or image with that segment in its name keeps working.
Consequences
- A cosign signature pushed to Sindri is discoverable by cosign, and still does not
satisfy a
signaturegate. The docs say so. Reading signatures for the gate belongs with signature verification (M14). - A client that used the fallback tag scheme against an older Sindri finds its older signatures only through those tags until they are pushed again. The upgrade notes say so.
- An untagged signature is no longer collected a day after it was pushed.
- The sweep holds a referrer for as long as some repository places both it and its subject, the same conservative rule as an edge from a dead parent, so a referrer goes one pass after its subject. One race stays open: a subject pushed at the moment its long-orphaned referrer is being swept loses that referrer. The client that pushes an image pushes its signature afterwards, which writes it again.
- cosign’s older signature format uses an image config, so such a signature is still scanned, as it was before this ADR. The newer formats are not.
- A referrer pushed into repository B for a subject that lives only in repository A is not kept alive by A: it needs a tag of its own, or it is collected after the grace period. Nothing B pushes can pin bytes to A’s image, and whether B’s referrer survives says nothing about what A holds.
- oras labels a file as an image layer unless told otherwise, so an attachment made with its defaults is scanned. The docs show the layer media type that avoids it.
referrersas a reserved segment stopsserve --configon a file that declares such a repository. The upgrade notes say to rename it first.- The schema gains one table, additive, so a rollback to 1.4 needs no restore.
Alternatives rejected
- Mirroring referrers into evidence. A push by anyone with write on a repository
would then satisfy a
signaturegate without the signature being checked, and two write paths would feed one ledger input. Evidence stays an explicit act. - Deriving the list by reading manifest bodies on each request. It reads every untagged manifest in the repository per request, and validation and parsing belong at write time.
- Backfilling on upgrade. It needs a job that reads every hosted manifest. The project has no adopters with signatures to lose yet, and a re-push repairs it.
- Proxying the upstream’s referrers. Proxy content has no subject, owner, or evidence (I4), and an upstream’s referrers list is mutable in a way the cache has no rule for. Empty is honest and can be widened later.
- Rooting every referrer in the collector. A signature for an image that has been collected would live forever.
- Keeping a referrer alive through its subject alone, wherever either is placed. The first draft did this. A referrer deleted from its repository then stayed in storage for as long as the image lived, anyone with write on any repository could pin bytes to another team’s image, and the referrer’s survival told its pusher whether a guessed digest existed elsewhere. A review found it.
- Skipping the scan for every manifest with a subject, or for every one without an
image config. An image pushed with a
subjectfield, or with that and a renamed config type, would then never be scanned, which breaks the claim that every hosted image is. Reviews of the first two drafts found these. - Updating the row on a later push. A push into one repository, with a misleading
Content-Type, could then change what another repository’s list says.
33. What is open stays open, paid work is added beside it, and the CNCF is a goal
- Status: Accepted
- Date: 2026-11-16
- Supersedes: the open-core line in ADR 23, ARCHITECTURE.md section 10 as it stood, and pitch.md section 6 as it stood
- Relates to: ADR 4, ADR 16, ADR 18, ADR 22, roadmap “After v1”
Context
The pitch planned an open core: what one team needs is free, and what an organisation needs to govern many teams is paid. Its paid column listed SSO, audit logging with retention, high availability and multi-region replication, the advanced policy engine, and managed hosting. ADR 23 moved scanning and the severity gate to the free side and kept the rest.
Three things have changed since.
- The code went another way. OIDC sign-in, role-based access, the audit ledger and its API, and scanning all shipped in the open build, and high availability is M13 on the open roadmap. The documents still called some of these paid.
- Joining the CNCF is now a goal. The CNCF takes a project whose whole code is under Apache 2.0, holds its name, and expects decisions to be made on technical merit. A vendor may still sell products around such a project.
- Sign-in behind a paywall is the complaint this audience raises most about the alternatives. Having it open is a reason to choose Sindri.
Decision
This repository is Apache 2.0 and stays Apache 2.0. It will not be relicensed, and no contributor agreement that would permit a relicence will be introduced.
Nothing that is open today will move behind payment. That covers every protocol adapter, both storage backends, OIDC sign-in and role-based access, the audit ledger and its API, scanning and the severity gate, lifecycle and evidence, and configuration as code. A feature that ships open stays open.
Sign-in and high availability are not what Sindri charges for. OIDC is built in. SAML and LDAP are no longer reserved as commercial; native support is not planned, and an OIDC bridge such as Dex or Keycloak is the expected route. M13, several replicas and the split serve modes, stays on the open roadmap.
Paid work is additive and clearly separate. The maintainer intends to make a living from this, so there will be paid products. They add something new beside the open code and never take from it. The first candidates serve regulated organisations: advanced auditing and compliance, for example reports mapped to the EU Cyber Resilience Act, NIS2, or DORA, retention with guarantees, and signed audit exports. Delivery into air-gapped networks, managed hosting, and support are others. Sindri keeps the complete record either way: the ledger, the audit API, evidence, scan results, and exports of them.
What is not decided here. Whether per-CVE waivers, licence policy, organisation-wide rules, and multi-region replication are open or paid is decided when each is built, in its own record. So is the form a paid product takes: a separate program, an add-on, or a hosted service.
The CNCF Sandbox is a goal, not a commitment. An application comes once Sindri has production users, and is decided then, with the funding situation known. A donation cannot be undone: the name moves to the Linux Foundation, and decisions about contributions must be made on technical merit alone. Nothing in this record is a promise to donate. The promises above hold whether or not it happens.
Consequences
- “Open core” as the pitch drew it no longer describes the project. ARCHITECTURE.md section 10, the roadmap’s paid layer, and pitch.md section 6 are rewritten with this record. ADR 4 and ADR 16 call audit retention a planned commercial feature; that remains possible as an addition, and the ledger and its API stay open.
- The public promise is small enough to keep: Apache 2.0, and nothing taken away. A paid product can be added later without breaking it.
- Every new feature needs a conscious choice before it ships, because shipping it open is permanent.
- A Sandbox application would need work not yet done: sign-off on commits (DCO), a governance document, a code of conduct, and a check of the CNCF’s current requirements. Commercial products should have their own names from the start, so that a donation of the name “Sindri” does not affect them.
Rejected
- Keep the open core as the pitch drew it. It charges for sign-in and availability, which a small team needs as much as a large one, and the code already ships both.
- Promise that there will never be a paid tier or an enterprise edition. An earlier draft of this record said so. It is a promise about an unknown future made by someone who has to live from the work, and breaking it later would cost more trust than never making it.
- Commit to the CNCF now. The foundation brings credibility and no funding, and the step is irreversible. It is better decided when there are users and the income is known.
- A source-available licence for some directories. It is the move that produced OpenTofu and OpenSearch, and it would end the CNCF option.
- Say nothing about the business model. The announcement will be asked how the project is funded and whether it will be relicensed. An answer written down before the question is asked is more believable than one given afterwards.
34. Webhook notifications on a new finding and on a promotion
- Status: Accepted
- Date: 2026-11-16
- Relates to: ADR 20, ADR 31, ADR 33, roadmap Sprint 14 (SIN-117, SIN-112)
Context
Since ADR 31 a re-scan can find a new CVE in an artifact already approved for
production, and nothing tells anyone: the finding shows in the API, the UI, and the
sindri_approved_findings gauge, which someone has to be looking at. A promotion is the
other moment people want to hear about, because deploy pipelines and change records
start from it. Both need to leave Sindri without a person polling.
Decision
-
Two events.
finding.new: a Sindri scan attaches a non-emptynew_vulnerabilitieslist (ADR 31) for a subject that has a currentapproverow inlifecycle_currentat any stage. A finding on a subject nobody approved is not sent; it is not running anywhere. One event per attached scan evidence row and per repository holding an approval of the digest, so a multi-platform image can send one per platform, and a digest approved in two repositories sends one for each.lifecycle.promoted: a promotion (approve) commits.
Revoke, publish, and first-scan events are not sent. They can be added when adopters ask; adding an event is additive.
-
Payload. A JSON envelope:
{ "id": "<delivery id>", "event": "finding.new", "occurredAt": "2026-11-16T10:00:00Z", "sindri": {"url": "https://sindri.example", "version": "1.6.0"}, "subject": {"digest": "sha256:…", "repository": "docker", "stage": "prod"}, "data": { … } }For
finding.new,subject.repositoryis a repository holding an approval,subject.stageis absent, anddataholdsnewVulnerabilities,severityCounts,platform,approvedStages, andevidenceId. Forlifecycle.promoted,dataholdsactor,reason,eventId(the ledger row), andevidenceIds. A payload never carries a credential, a token, or artifact bytes. -
Signing. Every delivery carries
X-Sindri-Event,X-Sindri-Delivery,X-Sindri-Timestamp(Unix seconds), andX-Sindri-Signature: sha256=<hex HMAC-SHA256(secret, timestamp + "." + body)>. The timestamp is inside the signed string, so a receiver can refuse old replays. -
Delivery is a queue job. Emitting an event inserts one row per matching webhook into
webhook_deliveriesand enqueues adeliver_webhookjob, in the same transaction as the change that caused it: the promotion’s ledger row, or the scan evidence row that carriesnew_vulnerabilities. Either both commit or neither does, so a failed emit fails the attach and the job retries with nothing lost and nothing doubled. Nothing is sent on the request path (ADR 20). A delivery’s dedupe key is unique per webhook:promoted:<ledger id>, and for a findingfinding:<digest>:<repository>:<platform>:<hash of the sorted new ids>. A re-attached scan gets a new evidence id, so the key names the finding, not the row, and the same finding emitted twice sends once. -
Outcomes. A 2xx response is delivered. 408, 429, 5xx, and network errors are retried with the queue’s exponential backoff, up to
notifications.maxAttempts(default 8). Any other response, or a webhook removed from the configuration, fails the delivery at once. Redirects are not followed. The delivery row records attempts, the last status, and the last error; errors and logs name the webhook and its host, never the path, query, headers, or body. -
Redelivery. An administrator may redeliver a delivery through the API. It creates a new delivery row with the same payload and a fresh id, so the log keeps both.
-
Configuration. A server-level
notifications:section with a list of webhooks, each with aname,url,secret,events, an optionalrepositoriesfilter, and atimeout. Likescanning:, it has no manifest form. The URL must be https, or http on a loopback host, and must not carry userinfo.config show, the API, and the UI show only the scheme and host; the secret is never shown. The webhook set is reloaded on SIGHUP. -
Visibility. Admin-only API routes list webhooks and deliveries and redeliver. An admin-only
/systempage shows the webhooks, a failing-webhook status line, and the delivery log. An artifact page shows administrators the deliveries for its subject.sindri_webhook_deliveries_total{result}counts attempts by outcome. -
Open. Notifications ship in the open build and stay there (ADR 33). They are part of the security claim, not an add-on to it.
Consequences
- A new CVE in something approved for production now reaches a person through whatever receiver they point Sindri at: a chat bridge, an incident tool, or a small service.
- A receiver must verify the signature and should check the timestamp. The docs carry examples.
- Deliveries are retained as rows; pruning them is a later question, like evidence retention.
- A promotion committing at the same moment as a scan may not see that scan’s
finding.new: each reads the other’s rows only once committed. Its ownlifecycle.promotedstill goes out. - A delivery whose job ended without an outcome, such as a worker that died on the last attempt, is failed by a periodic sweep, so no row stays pending forever.
- A webhook removed from the configuration leaves its queued deliveries to fail, which the log shows, rather than vanishing.
Alternatives rejected
- Webhooks per repository, declared in manifests. Teams could own them, but the targets and secrets are an operator’s concern, and a reconciled kind doubles the golden tests for little gain while the event set is two.
- Sending inline on the request path. A slow receiver would slow promotions, and a crash between commit and send would lose the event. The queue table already solves both.
- Blocking private-network targets. Most receivers are internal. Only an administrator can configure a target, so an SSRF guard would block the common case and protect against nobody.
- Notifying on every scan with new findings. Unapproved subjects are not running, and every re-publish would page someone.
- Unsigned payloads, or a signature over the body alone. Without a signature a receiver cannot tell Sindri from anyone else; without the timestamp a captured delivery can be replayed forever.
- Slack, email, or per-user subscriptions. Each is a formatting or identity problem of its own. A webhook is the primitive they can all be built on.