Choose what this site may use

This site uses strictly necessary cookies to work and to remember your privacy choices. With your permission it would also load content hosted by other services, such as videos, maps and fonts, which then receive your network address and device data. We do not sell or share your personal information and we run no advertising. Choose Accept all, Reject all or Customise. You can change your mind at any time through Privacy choices at the foot of every page.

  • Always on

    Needed for the site to work and to remember your privacy choices. Always on.

  • Remembers settings you choose, such as the light or dark display, in your browser.

  • Loads videos, maps and other content hosted by other services. Those services receive your address and device data.

Menu Close
In this section: Learn
Start
Guides
Domain packs
Participants
Security and privacy
Pilot kits
Operations
Ecosystem

Static web sites

Source docs/ops/static-sites.md

On this page
  1. Header rules
  2. Release (path A, object storage and CDN)
  3. Release (path B, Kubernetes)
  4. Rollback
  5. A site with a server (Astro’s Node adapter)

The web front ends are static sites built with Astro (static output, the dist/ folder): the protocol network site (network-site, www.<domain>), the services site (services-site, services.<domain>: registry, log viewer, discovery, status lists, API reference) and the verifier site (verifier-site, verify.<domain>). Each build is a release with an id (lower-case letters, digits, dots and hyphens, for example 2026.11.21-1) that never changes once published. Serving a release, and rolling back, is a switch from one complete release to another, never an overwrite of files in place, so a visitor never gets the HTML of one release with the assets of another.

Two ways to serve them, from the same build and the same header rules (infra/deploy/static-sites.yaml):

Path Release lives in Switch and rollback Headers from
A. Object storage and CDN <bucket>/sites/<site>/releases/<release>/ the CDN origin path (active_release in the Terraform static-site module) Cache-Control on each object at upload; the CDN’s response-header rule for the rest
B. Kubernetes static server an image obsp-<site>:<release> (the static server with that dist/ in it) the Service selector obsp/release (releases.active in the environment file) /etc/obsp-site/headers.json, rendered into a ConfigMap

Which one is an owner decision (OD-01); the sovereign site uses B.

Header rules

  • Content-Security-Policy: default-src 'none', scripts, styles, fonts, images, manifest and fetches from the site itself only; no inline script or style, no eval; frame-ancestors 'none', base-uri 'none', object-src 'none'. The services site may also fetch from registry.<domain> and log.<domain> (those APIs must answer with CORS headers for the site’s origin); the verifier site may register its service worker.
  • Cache-Control: _astro/ (Astro’s content-hashed assets) public, max-age=31536000, immutable; every other file, HTML included, no-cache (revalidated on every request, so a switch is seen at the next page load and no purge is needed).
  • HSTS, nosniff, no-referrer, a closed Permissions-Policy, same-origin opener and resource policies.

Build requirements, checked by static_release.py check before anything is published: no inline <script> (JSON data blocks are allowed), no <style> element, no style or on… attribute, every file under _astro/ named with a content hash, every local link and asset resolves inside the build. In Astro terms: static output, and build.inlineStylesheets: 'never' so styles are emitted as files; scripts are bundled by default.

Release (path A, object storage and CDN)

npm ci && npm run build                                   # in the site's project; produces dist/
python3 infra/deploy/scripts/static_release.py check   --site services-site --dist dist/
python3 infra/deploy/scripts/static_release.py publish --site services-site --dist dist/ --release 2026.11.21-1
python3 infra/deploy/scripts/static_release.py verify  --site services-site --release 2026.11.21-1

publish refuses a release id that exists, uploads the hashed assets first and release.json (every file with its SHA-256) last, so a release without release.json is incomplete and must not be activated; verify reads every file back. Credentials: SITE_BUCKET, SITE_ENDPOINT, SITE_CREDENTIALS (variables.md).

Switch: in the Terraform variable file, set active_release to the new id and previous_release to the one it replaces; terraform plan shows only the origin path changing; a person applies it. Check the site, then the headers (curl -sI https://services.<domain>/ shows the CSP and no-cache; an _astro/ file shows immutable).

Release (path B, Kubernetes)

  1. Build the image obsp-<site>:<release>: the static-server image (non-root, read-only root file system, port 8080, applies /etc/obsp-site/headers.json) with the checked dist/ in it. The reference images infra/images/services-site and infra/images/verifier-site do this from the repository (a Node.js build stage, then infra/images/static-site); tag the result with the release id. Push it; in production record the digest under images.digests as obsp-<site>:<release>.
  2. In the environment file set releases: {active: <new>, previous: <current>}; render; review. The diff adds one Deployment for the new release, changes the Service selector and its annotations, and removes the Deployment of the release before previous.
  3. Apply. Kubernetes creates the new release’s pods; the Service changes its selector at once, but endpoints follow readiness, so check the new Deployment is ready before the switch takes effect for all traffic: kubectl -n <ns> rollout status deployment/obsp-<site>-<release with dots as hyphens>. For a switch only after readiness, apply in two steps: first with the new release as previous (it starts and warms), then swap.

Rollback

Swap the two ids (active becomes the previous release) and apply. Path A: one origin change at the CDN, effective at the next request for HTML (hashed assets of both releases stay valid, they are different files). Path B: the previous release’s Deployment is still running, so the selector change is immediate. Never delete a release that is active or previous; older releases may be deleted from the bucket after the retention the owner sets (OD-11).

A site with a server (Astro’s Node adapter)

Only if a site later needs server rendering (@astrojs/node, standalone mode): set mode: node for it in the environment file. It is then one Deployment (port 4321, HOST and PORT set, same hardening), updated by a rolling update to the image obsp-<site>:<release> with releases.active; rollback is the previous id and apply. A server-rendered services site may reach the registry and the log inside the cluster (NetworkPolicy egress); its Content-Security-Policy is then set by the server and is the site’s responsibility.