Edgeweir
Project

Architecture

Components, processes, ports, data flows, data model, and trust boundaries of the console repository.

Components

ComponentLocationResponsibility
Consoleapps/consoleWeb UI, UI endpoint /rpc, public API /api/v1, node channel, pg-boss worker; one image, one Node.js process
edgeweir-certdhelpers/certdACME and DNS helper written in Go, shipped in the console image; the worker runs it as a child process and exchanges JSON over stdin/stdout, so credentials never appear in process arguments
PostgreSQL 18External serviceThe only required dependency: application data, migration history (schema drizzle), pg-boss queues (schema pgboss), LISTEN/NOTIFY
ClickHouseCompose profile analyticsOptional; with EDGEWEIR_ANALYTICS=clickhouse it stores access logs and a copy of per-minute statistics
Nodeedgeweir-nodeGo agent and OpenResty data plane; pulls configuration and tasks over the node channel and reports status, host metrics, statistics, and logs
Regional probeedgeweir-node (probe mode)Runs no OpenResty; probes the nodes' scheduling addresses from its region and reports through the node channel's ProbeService
Console (ROLE=app|worker|all)
├── :3000  HTTP ◀── browsers, API clients
│          /node-channel (WebSocket, closed by default) ──▶ loopback connection to :8443
├── :8443  Connect-RPC (TLS + mTLS) ◀── edgeweir-node agent ── OpenResty ──▶ origins
│                                    ◀── edgeweir-node probe (regional probe) ──▶ node listeners
├── SQL, LISTEN/NOTIFY ──▶ PostgreSQL 18
├── HTTP (optional) ──▶ ClickHouse
└── child process stdin/stdout ──▶ edgeweir-certd ──▶ ACME CA, DNS provider APIs

The only contract between the console and the nodes is edgeweir.node.v1 in proto/ (current tag proto/v0.29.0). The boundary between the open core and commercial products is defined in LICENSING.en.md.

Repository layout

PathContents
apps/console/src/serverServer: app.ts (HTTP routes), bootstrap.ts (startup sequence), main.ts (production entry), dev.ts (development entry with Vite middleware in the same process), rpc/ (oRPC router and guards), node-channel/ (node channel), pki/ (internal CA), services/ (domain services), jobs/worker.ts (pg-boss queues), lib/ (environment, authentication, envelope encryption, client IP, logging), install/install.sh (node installer), downloads.ts (release mirror)
apps/console/src/webReact 19 SPA: TanStack Router file routes (routes/), TanStack Query, shadcn components (components/ui), appica wrappers (components/appica/); Paraglide messages in apps/console/messages/{zh-CN,en}.json, compiled to src/web/paraglide
apps/console/testVitest: server/ (in-process PGlite database), web/ (i18n, UI rules, preset, theme)
apps/console/e2ePlaywright specs, run by scripts/e2e.sh
packages/contractoRPC contract and zod schemas, error codes (errors.ts), node error codes (node-errors.ts), origin address rules (addresses.ts); shared by the UI, the server, and OpenAPI
packages/dbDrizzle schema (src/schema/) and plain SQL migrations (migrations/)
packages/config-compilerCompiles sites, rules, IP lists, certificate references, and platform policy into the NodeConfig IR; canonical ordering, content hash, diff
packages/rule-engineRule expression fields, phases, functions, parser (conditions, value expressions, cache rule conditions), list reference binding, and reference evaluation
packages/protoTypeScript generated from proto/ (protoc-gen-es); not edited by hand
proto/buf module edgeweir/node/v1/{node,config,probe}.proto; edgeweir-node generates its Go code from a proto/vX.Y.Z tag
helpers/certdedgeweir-certd source
helpers/http3probeHTTP/3 probe used in CI
Dockerfile, docker/Image build, container health check script, end-to-end fixtures
compose*.yml, deploy.shcompose.yml (production), compose.baota.yml and compose.baota-host.yml (宝塔 / aaPanel), compose.dev.yml (development database), compose.e2e.yml (end-to-end); deploy.sh installs and upgrades 宝塔 / aaPanel deployments
scripts/e2e.sh (end-to-end tests), image-version.sh (rolling version), bench.sh (performance baseline of cache hits, requests with a pass and challenge pages)
docs/deploy/ (deployment), guide/ (feature guides), reference/ (reference)

Processes and roles

ROLE selects what a process runs. All roles use the same image and the same database; deployment shapes and scaling: Deployment overview; all variables: Environment variables.

ROLERuns
appHTTP server, node channel, setup token, LISTEN/NOTIFY subscription
workerpg-boss queues and schedules
all (default)Everything in app and worker

Startup sequence

  1. Parse and validate the environment (lib/env.ts); on failure, list the invalid variables and exit.
  2. Wait up to 60 seconds for PostgreSQL.
  3. Apply pending migrations on a dedicated connection under an advisory lock; instances that start together run them one at a time.
  4. Check that the internal CA key's envelope was sealed with EDGEWEIR_MASTER_KEY or EDGEWEIR_MASTER_KEY_PREVIOUS, or stop. Resolve the session secret (BETTER_AUTH_SECRET, or derived from the master key; after a master key rotation, the stored original) and compare it with the HMAC check value in the database: a derived secret that differs from the one the database was used with stops startup; a new explicit value is accepted with a warning (SECURITY.en.md).
  5. Re-encrypt v1 envelopes written by older versions as v2; with EDGEWEIR_MASTER_KEY_PREVIOUS set, re-encrypt every envelope it sealed with the current master key and log how many still use it (services/envelope-rotation.ts).
  6. Load the internal CA; generate it when the database has none.
  7. app, all: before setup, create or read the setup token and write it to the log; start LISTEN; issue the node channel server certificate from the internal CA and start listening.
  8. worker, all: start pg-boss, create the queues, register the schedules.
  9. app, all: the HTTP server starts listening.

On SIGTERM or SIGINT the process stops the HTTP and node channel listeners, ends the nodes' config watch streams and stops pg-boss at the same time: requests in flight get up to 3 more seconds, pg-boss up to 5 seconds to finish running jobs; then the database pool is closed. If all of this takes more than 8 seconds the process exits with 1.

Ports and routes

PortVariablesProtocolConstraint
3000HOST, PORTHTTP; /node-channel is the node channel's WebSocket entryMay sit behind a reverse proxy; list the proxy addresses in EDGEWEIR_TRUSTED_PROXIES
8443NODE_API_HOST (defaults to HOST), NODE_API_PORTHTTPS, TLS 1.2 or later, HTTP/2 and HTTP/1.1Expose directly or pass through at layer 4; a proxy that terminates TLS breaks node mTLS

Reverse proxy and layer-4 passthrough configuration: Ports, reverse proxy, and trusted proxies.

HTTP routes

PathHandlerCredentials
/healthzReturns {"status":"ok","version":…}None
/api/auth/*better-auth, allow-listed endpoints onlySee Authentication and authorization
/rpc/*oRPC, UI onlySession cookie + x-csrf-token
/api/v1/openapi.jsonOpenAPI documentNone
/api/v1/*OpenAPI handler for the same router as /rpcx-api-key
/install.shNode installer with the console address replaced by EDGEWEIR_PUBLIC_URL; cache-control: no-storeNone
/downloads/*Node release mirror (EDGEWEIR_DOWNLOADS_DIR), GET and HEADNone
/assets/*SPA assets, max-age=31536000, immutableNone
Any other pathSPA static files; index.html when no file matchesNone

Unmatched requests under /api, /rpc, and /downloads, and other methods on /install.sh and /healthz, return a 404 JSON body and never fall back to the SPA. Every response carries security headers; the CSP is default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data:; font-src 'self' data:; connect-src 'self'; frame-ancestors 'none'.

UI areas

AreaPathsAccess
Entry/ (redirects to /setup, /overview, or /login by state), /setup, /loginEveryone
ConsoleSites: /overview, /sites (with L4 apps at /l4), /certificates, /purge; access control: /rules, /ip-lists (with bans at /bans), /protection; infrastructure: /clusters (with the regions view ?view=regions), /dns; system: /alerts, /audit, /system (tabs: general, monitoring ?tab=probes, service accounts ?tab=service-accounts); account (user menu): /security, /settings; /regions and /service-accounts redirect to their new placesThe signed-in operator

Authentication and authorization

EntryCredentialsRules
/api/auth/*Email and password, TOTP, backup codes, passkeysOnly the methods and paths in AUTH_HTTP_ROUTES (lib/auth.ts) are served (session, sign-in, sign-out, password change, two-factor, passkeys); everything else returns 404; x-api-key is dropped; public sign-up is disabled, the only account is created by the setup wizard; passwords have at least 12 characters
/rpc/*Session cookie + x-csrf-tokenx-api-key is dropped
/api/v1/*x-api-key (AccessKey or service account key)Cookies are dropped; an AccessKey acts as the account with the same permissions as a session; a read-only AccessKey can call GET procedures and rules.validate only; a service account can call only the procedures listed in serviceAccountProcedures that its scopes allow
:8443Client certificateSee Node channel
/node-channelThe WebSocket handshake is not authenticated; the node channel TLS inside it is the same as on :8443404 by default; 403 with an Origin header; see Node channel

Endpoints, the OpenAPI document, and AccessKey details: API and endpoints. The console has one operator account, with no organizations or roles: every procedure except system.status and system.setup goes through authed in rpc/base.ts (a valid session, an enabled AccessKey or a service account key).

The client IP (audit log, sign-in rate limiting) is the TCP peer; X-Forwarded-For and X-Real-IP are used only when the peer is in EDGEWEIR_TRUSTED_PROXIES (resolveClientIp). Rate-limit counters for the authentication endpoints live in the rate_limit table and are shared by all instances. Sign-ins and account changes completed by better-auth are audited by the hooks in lib/auth-audit.ts.

Account recovery has no HTTP entry and happens on the server only: dist/server/recover.js (services/recovery.ts) reads the console's environment and, in one transaction, resets the password (better-auth's password.hash), turns two-factor authentication off, deletes the account's sessions and pending two-factor sign-ins, and writes the audit entry account.recover (Command line).

Configuration publishing

A change to node configuration runs in one transaction:

  1. Write the application tables (sites, domains, origins, cache rules, rules, IP lists, L4 apps, certificates, ACME HTTP-01 responses, the origin allow list, the full-site purge generation).
  2. publishRevision() takes an advisory lock on the cluster, reads the cluster's enabled sites and L4 apps, global rules, every IP list, the origin allow list, certificate references, and unexpired HTTP-01 responses, and compileNodeConfig() produces the canonical NodeConfig IR.
  3. Compute content_hash: SHA-256 of the binary encoding with revision and content_hash cleared. Identical content produces no new revision.
  4. The new revision number is one more than the larger of the latest stored revision and the highest verified applied revision reported by the cluster's nodes; restoring the database from a backup never moves revisions backwards.
  5. Insert into config_revision, run pg_notify('edgeweir_config', …) in the same transaction, and write the audit entry.
  6. After commit, every app instance receives the notification through LISTEN and pushes it to the WatchConfig streams of the cluster's nodes.
  7. The node calls GetConfig(base_revision=applied revision), receives a diff or a snapshot plus a revision receipt, verifies the hash, stores it as last-known-good, applies it to OpenResty, and reports with ReportStatus.
  8. The console records each node's applied revision and heartbeat in node_config_status; a node with a heartbeat in the last 45 seconds is online.
ConstraintValue
Enabled sites per clusterAt most 512 (MAX_SITES_PER_CLUSTER); more returns CLUSTER_SITE_LIMIT
L4 apps per clusterAt most 256 (MAX_L4_APPS_PER_CLUSTER); more returns L4_APP_LIMIT
New node capabilitiesA change that needs a capability some active node lacks returns NODE_CAPABILITY_REQUIRED when a service account or a background job publishes it; the operator (session or AccessKey) may publish it; GetConfig returns FailedPrecondition to a node missing a required capability
Revision retentionNewest 200 per cluster, pruned hourly
RollbackPublishes the IR of an older revision as a new revision with the current origin allow list; audit action cluster.rollback

Revision reasons are codes (revision_reason_<code>) defined in packages/contract/src/errors.ts. Rule language: Rules.

Node tasks

URL, prefix, host, Cache-Tag, and full-site purges and URL and sitemap prefetches produce no revision; they are delivered as typed tasks:

  1. cacheTasks.create inserts a cache_task and a cache_task_node for every enabled node (disabled nodes are marked skipped), then runs pg_notify('edgeweir_tasks', …).
  2. The WatchConfig stream emits WATCH_EVENT_TASKS.
  3. The node pulls tasks with PullTasks and reports results with ReportTaskResult.
  4. A task without a result 5 minutes after hand-out is handed out again; a task not finished within 7 days fails. When a node reconnects, the console issues a full-site purge for each site whose purges the node missed.

For a site with the PURGE method on, the node has its agent check the key of a PURGE request and hands it to the console with SubmitPurge; the console creates a URL purge task for the cluster as in step 1.

The hosts of URL, prefix, host and prefetch tasks resolve to sites by the nodes' domain precedence (resolveHosts): a purge goes to the site of every cluster that serves the host (purging more is harmless); prefetches and sitemap prefetches make nodes fetch from origins and go to one cluster only, the cluster of the site the same precedence picks over every cluster's sites (disabled ones included), and there to the site its nodes route the host to (SITE_DISABLED if none is enabled); another cluster's broad suffix or pattern never sends its nodes to a different site's origins, not even while that site is disabled. Host and Cache-Tag purges need the node feature purge-tag-v1, mobile and sitemap prefetches prefetch-v2; while an active node of a cluster the task goes to lacks it, the console refuses the task (NODE_CAPABILITY_REQUIRED). Nodes derive cache keys from the purge markers' points in time and an index of the cached objects' Cache-Tag, so purged objects (stale ones included) are never looked up again; nodes fetch sitemaps through their own edge layer. Behavior: Origins and cache.

Node upgrades are delivered through PullTasks as well: an upgrade first runs on one node group and is promoted after the health observation passes; the remaining nodes follow at most a quarter at a time, and each task must finish within 30 minutes after it is sent. A node pulling tasks first checks without a lock whether it has an upgrade task, and takes the cluster's upgrade lock only if it does. Behavior: Node upgrades.

Dynamic bans

IP bans (ip_ban) create no revision and skip the configuration canary; they have their own path over the node channel:

  1. Every write (create, ban again, unban, automatic ban writes and overflow removal) takes nextval('ip_ban_seq') as the row's seq under one transaction-level advisory lock, so commits follow sequence order; the same transaction runs pg_notify('edgeweir_bans', …) with the affected clusters (all of them for platform bans). Manual actions are audited as ban.create, ban.update, ban.delete.
  2. Nodes with bans-v1 receive WATCH_EVENT_BANS (ban_sequence is the sequence's current value) when their WatchConfig stream opens and after every notification.
  3. The node calls GetBans(after_sequence): from 0, or from a sequence above the current value (after a database restore), it returns a snapshot (reset); otherwise the active bans and lifted ids changed afterwards. Expired bans are left out; nodes drop them at expiry. Reads take the same lock in shared mode first, so the current value never passes an uncommitted write. Pages hold 2000 entries by default and at most 5000; sequence is the page's highest sequence, or the current value on the last page.
  4. Nodes upload their own automatic bans with ReportBans (at most 1000 per call), merged per node, site and address, and report the applied sequence, capacity and unapplied bans in ReportStatus.bans, kept in node.ban_status.
  5. Greylist entries are ip_ban rows whose action is challenge or rate_limit; they share the sequence, lock, notifications and pruning, and go only to nodes that send greylist = true in GetBans (greylist-v1). Ban.action and its fields describe the action; nodes never write them to the kernel. A cluster's kernel connection limits (cluster.connection_limits) travel in revisions instead (NodeConfig.connection_limits); nodes report whether they enforce them in BanStatus.connection_limits_active / _error.
LimitValue
Shortest prefixIPv4 /16, IPv6 /48
Lifetime1 minute to 7 days; deleted by maintenance.prune-bans an hour after expiry
CountPlatform limit of manual bans (system settings, 10000 by default); at most 10000 automatic bans per cluster

Behavior: Bans.

Challenges and CC mitigation

Nodes enforce challenges, Under Attack and tiered CC mitigation locally; the console holds the settings, keys and events:

  1. A site's protection (site_protection), global Under Attack (system setting protection_settings) and the CC template (cc_template) are compiled into NodeConfig. Only clusters that use challenges (global Under Attack, a site's Under Attack, an enabled CC policy or a challenge rule) carry challenge_keys, platform_protection and every site's protection, with challenge-v1 in required_features; a site that only records JA4 carries its protection alone. Rules that read tls.ja4 (or rate limit by it) and sites that record JA4 add ja4-v1. Other clusters keep their content hash.
  2. Pass HMAC keys are per cluster, three of them (next, current, previous), created the first time a cluster uses challenges. The IR holds only key ids and roles (sorted by id); nodes fetch the 32-byte secrets with GetChallengeKeys, only those of their own cluster. A secret is generated the first time it is fetched and stored envelope-encrypted (purpose challenge_key.secret, bound to the row id).
  3. maintenance.rotate-challenge-keys checks every hour and rotates keys once the newest one is a day old: previous is deleted, current becomes previous, next becomes current and a new next is created; clusters whose latest revision carries keys get a new revision (reason challenge_keys_rotated), audited as cluster.challenge_keys_rotate.
  4. Nodes report level changes, escalated paths and automatic bans with ReportSecurityEvents (at most 500 per call); the console stores them in security_event, idempotent by (node, event id). A site leaving the normal level raises the cc_mitigation alert, at most once per site in 15 minutes. ReportStatus.security of the heartbeat is kept in node.security_state. maintenance.prune-security-events deletes events after the retention (default 30 days).
Management actionAudit
Site protectionsite.protection_update (publishes the site's cluster)
Global Under Attack, event retentionsystem.protection_update (publishes every cluster when Under Attack changes)
CC templatesystem.cc_template_update (publishes clusters with sites that follow it)

Behavior: Challenges and CC mitigation.

Compression and OWASP CRS

Nodes compress and run CRS with OpenResty built for Edgeweir (edgeweir-openresty, optional module package edgeweir-openresty-modsecurity) and report brotli-v1, zstd-v1 and modsecurity-v1 according to their build. The console holds the settings, the capability gate and the match statistics:

  1. A site's Brotli and Zstandard settings live with Gzip in site.tls_settings and are compiled into TlsOptions; only algorithms that are on carry their level, minimum length and types (types sorted and unique), so the content hash stays the same while they are off. Enabled sites with them on add brotli-v1 / zstd-v1 to required_features.
  2. A site's CRS settings live in site_waf; unless the mode is off they compile into Site.waf (excluded rule ids ascending and unique) and add modsecurity-v1.
  3. As with other capabilities, a service account or background publish that introduces a capability an active node of the cluster lacks gets NODE_CAPABILITY_REQUIRED; the operator may publish it. sites.features tells per site whether each feature can be turned on (reason nodes when not), and the UI disables the switches accordingly. Rollback recomputes the three capabilities from the sites it ships.
  4. waf_rules of ReportStats (rule id → requests) keeps at most 50 rules per node, site and minute (nodes report only the 20 most-matched), rolls up into hours and days with the other per-minute statistics and is copied to ClickHouse minute_stats; waf.topRules sums a range. Access logs keep the matched rule ids (at most 16, ascending) and waf_blocked (PostgreSQL, ClickHouse, CSV). Rules with the log action likewise: MinuteStats.logged_rules (proto v0.18.0, node capability rule-log-v1; rule id → requests, UUIDs only) keeps at most 50 rules per node, site and minute (nodes report 20 as well) as logged_rules, with the same rollups and ClickHouse copy; rules.topLogged sums a range, joins the rules' current names (the site's own rules and global rules) and counts the active nodes of the site's cluster that lack rule-log-v1.
Management actionAudit
A site's HTTPS and compressionsite.https_update (publishes the site's cluster)
A site's CRSsite.waf_update (publishes the site's cluster, reason site_waf_updated)

Behavior: HTTPS and certificates and OWASP CRS managed rules.

Rule engine extensions

The console is the only authority on expression syntax: packages/rule-engine parses conditions and value expressions and packages/config-compiler emits typed IR; nodes validate the IR field by field and run it, and never receive expression text. Functions, value expressions, bulk redirects, origin groups, cache rule conditions and the new rule actions are marked by the node capability rules-v2:

  1. Function calls are encoded as call, field and const nodes of RuleExpression. Value expressions of redirect targets and rewrite paths go into RuleAction.target; set_query is sorted by name and remove_query sorted and unique; preserve_query is written only when it differs from the action's default.
  2. Cache rules are stored as expressions (cache_rule.expression, with the lists they reference in list_ids). Expressions in the builder's shape compile into the former path_prefixes, paths and extensions, so older nodes run them as before and the content hash stays the same; other expressions compile into CacheRuleMatch.condition. browser_ttl_seconds goes into CacheRule.
  3. Bulk redirects compile into Site.bulk_redirects (sorted by source) and origin groups into Origin.group.
  4. A configuration that uses any of these (the compression phase and the new fields of config actions included) adds rules-v2 to required_features; others encode exactly as before. As with other capabilities, a change by a service account or background job that introduces rules-v2 while an active node of the cluster lacks it gets NODE_CAPABILITY_REQUIRED, while the operator may publish it; rulesV2 of sites.features lets the UI lock the controls.

The additions of proto v0.22.0 are marked by the capability rules-v3: cookies and query parameters by name (http.request.cookies.<name>, http.request.uri.args.<name>, the first raw value), new request and connection fields, http.response.cache_status, encoding and digest functions, substring (its integer arguments are const nodes of value_type number), to_string (an argument of any type), and the wildcard and strict_wildcard comparisons; request and response header values reuse RuleAction.target for their value expression, QueryParam.expression computes a query parameter, and RuleAction.append adds a response header line; redirect status 303; {{time}} and {{path}} in error pages. Nodes compute these fields only for sites whose rules read them; a computed header value over 4096 bytes or with a control character skips the action (one NOTICE per rule and node every 60 seconds, its message naming only the site and rule IDs), while a failed query parameter value still fails closed. Configurations that use none of them encode byte for byte as before (cross-language content hash vector content_hash_vector_v0220.json).

Proto v0.23.0 adds three capabilities. edge-ports-v1: a Listener may use a port besides 80 / 443 (the cluster's extra ports), Site.ports lists the listener ports a site is bound to (empty means every listener, the former semantics; a site on 80 / 443 in a cluster without extra ports compiles to empty), and TlsOptions.redirect_status / redirect_port / redirect_excluded_domains are the HTTPS redirect options; nodes render a site's server blocks on its ports only, and the router and the TLS callbacks treat its hosts on other ports as unknown. client-ip-v1: NodeConfig.client_address is the cluster's client address source; in the PROXY protocol mode every Listener.proxy_protocol is set, the trusted header mode reads the header with nginx realip (real_ip_recursive on); X-Forwarded-For towards the origins is the received chain plus the direct peer ($realip_remote_addr), the rule field ip.peer is the direct peer, and trusted CIDRs are never banned and not counted per address by CC. l4-v2: L4App.port_end (a port range, a stream listen range), L4Origin.port 0 for the arriving port, L4App.certificate_id / tls_minimum_version (stream ssl_client_hello_by_lua / ssl_certificate_by_lua check the SNI and terminate TLS; the certificate travels with the layer-4 table). Listener ports and the client address are the cluster's current state: a rollback keeps the current ones, and sites take their current ports and redirect options (refreshDerived(config, edge)). Cross-language content hash vector content_hash_vector_v0230.json.

Management actionAudit
A site's rulessite.rules_update (publishes the site's cluster, reason rules_updated)
Global rulesplatform.rules_update (publishes every cluster)
A site's bulk redirectssite.bulk_redirects_update (publishes the site's cluster, reason rules_updated)

Behavior: Rules, IP lists, and GeoIP and Origins and cache.

Layer-4 forwarding

The nodes' stream subsystem forwards TCP / UDP L4 apps; the console handles ports, configuration, DNS, and statistics:

  1. Port pools (cluster_port_pool) exist in the console only: an L4 app's port must fall inside a pool of its cluster for its protocol (1024–65535, no overlap within a protocol, never a port of the cluster's HTTP / HTTPS listeners). Writes to pools and apps are checked one at a time under an advisory lock of the cluster; changing pools publishes no revision.
  2. L4 apps (l4_app, l4_origin) ship with the cluster's revision: enabled apps compile to NodeConfig.l4_apps (sorted by id, with the ids of the IP lists they reference) and add l4-v1 to required_features; disabled apps are not shipped. Origins follow the same origin address policy as sites.
  3. Nodes render the port, protocol, whether PROXY protocol is accepted, and the version sent as a server in stream {} and reload, old workers serving open TCP connections until they end; origins, passive health check settings, timeouts, lists, and connection limits are hot-updated over the local control socket. Only apps that both accept and send PROXY protocol use a Lua relay; all others (v2 included) use native nginx forwarding.
  4. DNS: compileBindingPlan writes a <app id>.<cluster domain> CNAME for every enabled app (with line aliases also <line>.<app id>.<cluster domain>), sharing the all-lines record, resolution lines, and backup node groups with sites.
  5. Statistics: nodes report per app and minute connections, refused, peak_concurrent, bytes_received, and bytes_sent in ReportStatsV2Request.l4_stats, in the same batch as the sites' minute buckets and deduplicated by the same batch sequence; the console accepts only apps of the node's cluster and writes l4_minute_stats (no rollup, kept 7 days); l4Apps.stats buckets a range by 60, 300, or 3600 seconds.
  6. Rollbacks and the canary's stable revision treat L4 apps by their current state: apps disabled now are not shipped; an app deleted since, whose port is no longer inside a pool, or that references a deleted list fails the operator's rollback (ROLLBACK_RESOURCE_UNAVAILABLE) and is left out of the stable revision.
LimitValue
L4 apps per clusterAt most 256 (MAX_L4_APPS_PER_CLUSTER); more returns L4_APP_LIMIT
Port pools per clusterAt most 64
Origins per app1–32
Management actionAudit
Changing port poolscluster.port_pools_update (publishes no revision)
Creating, changing, deleting an L4 appl4_app.create, l4_app.update, l4_app.delete (publishes the app's cluster, reasons l4_app_created, l4_app_updated, l4_app_deleted)
Enabling, disabling an L4 appl4_app.enable, l4_app.disable (reason l4_app_updated)

Behavior: Layer-4 forwarding.

Domain matching and unknown hosts

Proto v0.25.0 adds two capabilities. domains-v2: Domain.match (SUFFIX subdomains at any depth, REGEX a pattern for the whole host) and Domain.order (the precedence key of patterns: the site's creation time in milliseconds × 16 plus the pattern's index in the site), and OfflineHost.match for disabled sites. unknown-host-v1: NodeConfig.unknown_hosts (the handling of unknown hosts and of node IP access each: the platform's page, 444 or the default site; the default site's certificate for unknown SNI; scan protection's threshold and ban time) and AutoBan.scope (scan protection's platform-wide bans). Exact and *. domains and the default settings stay out of the encoding: configurations that use neither encode as before.

  1. The console converts Unicode host names to Punycode by UTS #46 (tr46, nontransitional processing) when domains are saved; patterns use the rule engine's regular expression subset with lowercase letters and a bounded shape (domainPatternError: at most two repeating quantifiers, a fixed {n} not counted; the alternatives of each group and the optional parts multiply to at most 16; no comma outside {n,m}), which bounds nginx's PCRE matching on nodes, where no limit is set. The console process turns on V8's --enable-experimental-regexp-engine-on-excessive-backtracks in lib/regexp-engine.ts (imported by services/cache-tasks.ts): a match that backtracks too much finishes on the linear engine and never stalls the single console process. A name in one form belongs to one site; forms may overlap, and nodes look up "exact > *. > the longest . suffix > patterns (by order, then site id)"; IP literals and an empty Host match exact names only, and a Host longer than 253 characters tries no pattern. The console finds sites by Host as nodes do (matchHost; inPatternOrder shares the pattern order with the compiler), and node sitemap prefetches use the same order (shared vectors host_match_vectors.json). The UI shows a label in Unicode only when it is in one script.
  2. Node Lua looks up host:, wild: and sfx: keys in the shared dictionary; patterns come with the site table settings and are compiled once per version (ngx.re with jo; lua_regex_cache_max_entries grows with them). Hits through suffixes and patterns go to an LRU of their own and never evict exact names. A host found through a suffix or pattern completes TLS only where the certificate's DNS names cover it, and gets no Force HTTPS redirect where they do not.
  3. With suffix or pattern domains in the configuration (or a default site), nodes render *.x as a one-label regular expression server_name, and give each suffix (longest first) and each pattern (by precedence, case-sensitive, no PCRE limit) a server block of its own after every site's (patterns never match a Host longer than 253 characters); node IP access hosts (_, IPv4, [IPv6]) match exact names only, their regex name comes before any other on the server their handling is served by, so nginx picks the server block of the site Lua routes to; the names of a site not bound to the port go into the default site's block (when unknown hosts go to it and it listens there) or the generic server's, never taking another site's server-level settings. The default site's server block is the default_server while requests are handed to it, a request without a Host goes to the server block named _ "" (the generic server, or one with the default site's settings while node IP access is handed to it) and stays node IP access, and h2c stays on plain listeners. Requests handed to the default site always keep the Host in their cache key; under Force HTTPS a default site without a certificate returns 503, and the redirect happens only with default_certificate on and a certificate that covers the host.
  4. Unknown hosts, node IP access (a Host that is an IP or empty) and sites' unbound ports follow the cluster's setting; domains of disabled sites keep the disabled page. Scan protection counts by ip.src (IPv4 address, IPv6 /64) in edgeweir_cc; over the threshold the node creates a platform-wide automatic ban and reports it through ReportBans (reason unknown_host_scan), which the console stores as an automatic ban with scope = platform and no cluster (one covering another cluster's trusted proxies or node addresses is not shared and stays with the reporting node; one covering a node address of the reporting cluster or an allow list is lifted at once and records that cluster, so only its nodes get the release; lifting an unshared one in the console reaches every node with unknown-host-v1, guarded by the longest scan ban time the node's cluster has had); nodes' kernel bans never drop their cluster's trusted proxies.
  5. CNAME prefixes: new sites and L4 apps get 8 random characters, existing ones keep their UUID. After a change the old prefix is written to cname_retired (not one an Automatic binding never wrote to the provider) and stays in the DNS plan for 24 hours (published at once, reason cname); the per-minute dns.reconcile deletes expired ones cluster by cluster and publishes (reason cname_expired; one failing cluster holds up neither the others nor the reconciliation). An object can take back its own old prefix during the transition, the UUID from before the upgrade included. Prefixes are unique across sites and L4 apps and never all, all-<n> or a binding's all-lines record or line name.
Management actionAudit
Change the unknown host settingscluster.unknown_hosts_update (publishes the cluster, reason unknown_hosts_updated)
Change a site's / L4 app's CNAME prefixsite.cname_update / l4.cname_update (publishes the cluster's DNS, reason cname)

Behavior: domains and unknown hosts.

Node channel

Connect-RPC over HTTPS; the console process terminates TLS itself.

ItemValue
Internal CAECDSA P-256, valid for 10 years, generated on first start; private key envelope-encrypted in pki_authority
Server certificateIssued by the internal CA at every start, valid for 90 days; checked hourly and reissued in-process when less than a third of the lifetime remains, and at once when the node channel URL in system settings changes (every instance hears of it through LISTEN/NOTIFY), so new handshakes get the new certificate and established connections keep theirs; SANs are the host name of EDGEWEIR_NODE_API_URL (the host name of EDGEWEIR_PUBLIC_URL when unset), EDGEWEIR_NODE_API_HOSTNAMES, the hosts of the node channel URL saved in system settings and of the URLs in effect before it (the latest 32), localhost, 127.0.0.1, ::1, and the container host name
Node certificateCN is the node ID, client authentication only, valid for 30 days (server and node certificates are valid from 1 hour before issue, for nodes whose clocks run behind); with less than a third of the lifetime left, ReportStatus asks the node to call RenewCertificate. After a renewal the old certificate (node.previous_cert_serial) stays valid until the node first authenticates with the new one; a node that could not install the new one renews again with the old one. A disabled node may still renew; its other calls are refused
Probe certificateCN is the probe ID, O=Edgeweir Probe (node certificates carry O=Edgeweir Node), client authentication only, valid for 30 days; with less than a third left, GetProbeTargets asks the probe to call RenewProbeCertificate, and the replaced certificate is handled as for nodes. The node channel tells them apart by organization: probe certificates can only call ProbeService, NodeService refuses every certificate that is not a node's, and node certificates call GetProbeTargets and ReportProbeResults only while the node also probes, never enrolling or renewing probes
HeartbeatEvery 15 seconds; WatchConfig sends a keepalive every 15 seconds
WebSocket entryGET /node-channel on the web port (subprotocol edgeweir-node-channel, node-channel/websocket.ts): each WebSocket maps to one loopback TCP connection to this process's node channel port, and the node channel's TLS runs inside the WebSocket with the same checks as on :8443. Open with EDGEWEIR_NODE_API_WEBSOCKET=true, while the node channel URL in effect is a wss:// or ws:// one, or once such a URL was saved in system settings; otherwise 404. Requests with an Origin header get 403, requests without the subprotocol 400. A node's connection source address is the client address of the WebSocket request (resolveClientIp)

Enrollment:

  1. The operator generates an install command: a single-use token (valid for 5 minutes to 7 days, default 60 minutes, stored as SHA-256 only) and the SHA-256 fingerprint of the internal CA (--ca-sha256). The token travels in the EDGEWEIR_TOKEN environment variable.
  2. The node checks the CA fingerprint in the server certificate chain, then sends the token and a locally generated CSR (Enroll).
  3. The console verifies the CSR signature, issues the node certificate, and marks the token used and writes the audit entry in the same transaction.

Install command and install.sh checks: Adding nodes.

The console never stores SSH credentials; nodes join only through the one-time install command generated by the console and enroll themselves.

Every RPC other than Enroll and EnrollProbe requires a client certificate verified by the internal CA whose serial number equals the current serial stored for the node or probe: a rotated certificate stops working at once, and deleting a node or probe writes its serial to node_certificate_revocation. Disabled or deleted nodes are refused on every RPC, and their open WatchConfig streams close; a disabled probe may only renew its certificate.

RPCPurpose
EnrollExchange a single-use token and a CSR for a node certificate
RenewCertificateRotate the node certificate
WatchConfigServer stream: revision notifications, task notifications, ban notifications (bans-v1), keepalives
GetConfigSnapshot, or diff against base_revision, with a revision receipt
ReportStatusHeartbeat, apply receipt, origin health and error codes (passive and active checks reported apart), ban state, host metrics (metrics-v1), cache zone usage (cache-zone-v1, kept in node.cache_usage), the node's clock offset from the console (clock_offset_millis, kept in node.clock_offset_ms); probe in the response tells the node whether it also probes, and console_time is the console's time when it answered: the node reports the difference to the middle of the request's round trip as its next clock offset
CheckChannelNo side effects: returns the node id of the certificate, the current node channel address and the console's time, also for disabled nodes; used before a node switches address, by edgeweir-node set-server to check a new address and by edgeweir-node diagnose to check connectivity and the clock
ReportStats, ReportStatsV2Per-minute pre-aggregated traffic statistics (ReportStatsV2 also carries the L4 apps' minute statistics, l4-v1); deduplicated by batch sequence
ReportLogsSampled access logs; deduplicated by batch sequence
UploadDebugLogsThe node's one answer to a debug log pull (DebugLogsTask, debug-logs-v1): the matching entries of its in-memory buffers, at most 10,000 entries / 4 MiB; the console removes secrets again and stores them in node_debug_log
ReportNodeLogsThe node's own warnings, errors and whitelisted events (agent, supervisor, OpenResty's error log; node-logs-v1); deduplicated by batch sequence and stored in node_log_entry; the console removes secrets again before storing, and the drops the node counts (rate limit, backlog) become one dropped row
GetOriginCredentialsS3 origin keys, PURGE keys (site_secret) and access authentication secrets (site_auth_rule, JSON) referenced by the cluster's sites; the latter two with an empty access_key_id
SubmitPurgeA PURGE request the node hands on (site-content-v1): the console checks that the node's cluster serves the site, that the site has PURGE on and that the URL belongs to it, then creates a URL purge task as the node (source purge_method), at most 120 per site and minute
GetCertificatesCertificate chains and private keys referenced by the cluster's sites (further certificates included)
GetSessionTicketKeysThe cluster's TLS session ticket keys (80 bytes); a node only gets its own cluster's
PullTasks, ReportTaskResultPurge, prefetch, upgrade, and debug log pull tasks
GetBans, ReportBansIncremental ban changes of the node's cluster by sequence; upload of the node's automatic bans
EnrollProbe (ProbeService)Exchange a single-use probe token (ewp_) and a CSR for a probe certificate; the same request size limit as Enroll, and the token is used up only by a successful enrollment
RenewProbeCertificateRotate the probe certificate (nodes use RenewCertificate)
GetProbeTargetsProbe targets (node, address, port, method, PROXY protocol), interval, timeout, and attempts
ReportProbeResultsOne round of probe results, at most 10,000 per call; the clusters concerned are evaluated right after

A revision receipt is sealed with the master key (purpose node.revision_receipt, bound to the node ID) and carries the cluster, the revision, and the content hash. The node stores the receipt locally and returns it in ReportStatus; a report of an applied revision above the console's latest revision without a valid receipt is refused. During a master key rotation, receipts sealed with the old key stay valid.

Certificates and DNS

edgeweir-certd performs ACME issuance, renewal, and revocation and DNS record operations.

  1. The pg-boss queue certificates.sweep selects, every minute, certificates waiting for issuance and certificates past renew_at (new requests and manual renewals first, then by renew_at, three at a time). A failure backs off by the remaining validity (a tenth, 10 minutes to 12 hours; one hour for a first issuance); an HTTP-01 certificate that failed because names did not resolve to the nodes (http01_dns_not_pointing) has its names looked up again every 5 minutes and is retried once they point to the nodes. Issued certificates read their ARI renewal window after the CA's Retry-After (1 to 24 hours, 6 by default) and renew earlier when the window ends before renew_at.
  2. The worker starts EDGEWEIR_CERTD_BIN (/usr/local/bin/edgeweir-certd in the image) with only PATH and EDGEWEIR_DNS_TEST_ENDPOINT in its environment. The directory URL, its CA certificates (rootCa, trusted with the system roots), EAB and key type (ec256 / rsa2048) are request parameters: the built-in CAs' directories (Let's Encrypt, ZeroSSL, Google Trust Services) are in ACME_CA_DIRECTORIES; custom takes the system setting acme_directory (URL, EAB key id, the envelope-encrypted HMAC key with purpose system_setting.acme_directory, CA certificates, and the meta.caaIdentities read from the directory when saved), each field falling back to EDGEWEIR_ACME_DIRECTORY / EDGEWEIR_ACME_CA_FILE when not saved.
  3. It writes one JSON request line to stdin (command and parameters, including the ACME account and DNS credentials). certd writes JSON event lines to stdout (account, http01.present, http01.cleanup, dns01.prepare, dns01.cleanup); the console handles each one and acknowledges it on stdin. The last line is the result.
  4. One http01.present carries all HTTP-01 challenges of an order: they are written to acme_challenge, each cluster involved publishes one revision, and once nodes apply it certd has the CA validate them (four at a time); http01.cleanup only deletes the rows and publishes nothing (nodes and the next revision drop a challenge once it expires or its operation ends). Challenge revisions do not count toward the 200 kept revisions and are deleted after an hour. dns01.prepare records the cleanup obligation in dns_challenge_lease before certd writes the TXT record; after completion, failure, or a restart, only the values written by that operation are removed. The ACME account from an account event is envelope-encrypted into acme_account; certificates with the same directory, EAB key id, and email share one account. Certificates record their account (certificate.acme_account_id), which the account list counts, and an account certificates use cannot be deleted (ACME_ACCOUNT_IN_USE). At worker start maintenance.link-acme-accounts links the certificates issued before, and records those issued in the environment-variable era (whose last directory is not the chosen built-in CA's) as custom.
  5. The result is written back to certificate: chain (certificates only), fingerprint, expiry, next renewal time, and the envelope-encrypted private key (PKCS #8); a request with bindSiteId (one-click HTTPS on a site's HTTPS tab, preceded by https.check, which lists every blocker at once: nodes, DNS, the DNS credential and CAA) is bound to the site in the same transaction (the HTTPS redirect and other settings unchanged); clusters that reference the certificate publish a new revision.

Domains a site's certificate does not cover yet (the certificate is being reissued for them) are published with Domain.tls_pending (proto v0.19.0) when every active node of the cluster has tls-pending-domains-v1, and nodes serve them over HTTP only; otherwise they are left out until the new certificate is issued.

Uploads and issued certificates with EC keys that spell out the curve's parameters are refused: nodes (Go crypto/tls) cannot load them. Uploads stored before are checked by maintenance.check-certificates at worker start, which opens their private keys: those nodes cannot load get status error with last_error certificate_chain_explicit_curve or certificate_key_explicit_curve, audited as certificate.unloadable. Saving a site's HTTPS settings checks the chosen certificate itself and refuses such a certificate with CERTIFICATE_CHAIN_EXPLICIT_CURVE / CERTIFICATE_KEY_EXPLICIT_CURVE; a site bound to one is not changed automatically, and its cluster's nodes apply a new revision once another certificate (or none) is bound.

LimitValue
Duration per call5 minutes for dns.*, 8 minutes otherwise, then SIGKILL
stdout size16 MiB for dns.* commands, 2 MiB otherwise
stderrDiscarded (dependency diagnostics may quote credentials)
Commandsversion, providers, obtain, renew, revoke, renewal-info, dns.list, dns.set, dns.present, dns.cleanup, dns.zones, dns.test
DNS providersThe provider catalog helpers/certd/catalog.json, see Providers and credentials

DNS steering is bound per cluster (dns_binding, mode Not managed, Manual, or Automatic): dns.reconcile computes, every minute, the records of each cluster in Automatic mode from healthy nodes and site domains (one set of address records per cluster, all.<domain> once per resolution line, one CNAME per site; node addresses and backup node groups as in Regional probes and scheduling), creates a dns_revision for that cluster, and writes it to the zone of the binding's provider account (platform_dns_provider); clusters publish and reconcile on their own, so an unavailable provider does not affect other clusters, and one process at a time writes a cluster (dns_lease). Nodes keep their records while they apply a revision published less than 2 minutes ago. Names are recorded in dns_managed_name before external records are written, so partial writes can be repaired; new records are written before the records they replace. Manual mode only produces the records to create and a zone file and writes no DNS. DNS steering provider accounts and DNS-01 credentials use the same provider catalog. A site's domains route as soon as they are saved; a domain belongs to one site. Behavior: HTTPS and certificates, DNS steering and alerts.

Site TLS: several certificates, client certificates, and session resumption

  1. A site's first certificate is site.certificate_id, up to 3 more are in site_certificate (positions 1–3, foreign key restrict); on save every domain of the site must be covered by one of them. The IR carries Site.additional_certificate_ids in the site's order, and a configuration with further certificates requires multi-certificate-v1. Nodes set one certificate per handshake in ssl_client_hello_by_lua from the ClientHello (among the key types the client can use, exact names before wildcards, then ECDSA, then the site's order), and staple the OCSP response of that certificate.
  2. Client certificates live in site.tls_settings (mode, CA PEM, depth, forwarding); the IR has Site.client_certificate and requires client-cert-v1, as do rules reading tls.client.*. Nodes ask for a certificate with ngx.ssl.verify_client without aborting the handshake and decide in the request phase (403 client-cert-required when Required). Visitors' own X-Client-* request headers are removed on every site. Not together with HTTP/3 (CLIENT_CERTIFICATE_HTTP3).
  3. Session resumption: nodes' HTTPS listeners use ssl_session_cache shared:edgeweir_tls:16m and ssl_session_timeout 1h, with ssl_early_data off written out; each site has its own session context (SSL_set_session_id_context), so sessions resume on the same site only. Ticket keys are per cluster (session_ticket_key: next, current, previous), created when a cluster with a site using a certificate publishes; the IR holds ids and roles only (NodeConfig.session_ticket_keys, sorted by id, no capability required, ignored by older nodes), and nodes fetch the 80-byte keys with GetSessionTicketKeys. A key is generated the first time it is fetched and stored envelope-encrypted (purpose session_ticket_key.secret).
  4. maintenance.rotate-session-ticket-keys checks hourly and rotates once the newest key is 12 hours old (the same way as challenge keys); clusters whose latest revision carries ticket keys publish a new revision (reason session_ticket_keys_rotated), audited as cluster.session_ticket_keys_rotate. Nodes write ssl_session_ticket_key in the order current, previous, next; file names follow the keys, so a rotation reloads.

Origin protection: origin client certificates and the Origin CA

  1. Two authorities apart from the node channel's CA, both in pki_authority (origin-client, origin-ca), ECDSA P-256, private keys envelope-encrypted (purpose pki_authority.private_key_envelope, bound to the row id), created by the operator on the certificates page: the origin client CA for 10 years, the Origin CA for 20.
  2. Origin client certificates are issued per cluster (origin_client_certificate: CN the cluster id, O Edgeweir Origin Client, client auth only, 90 days), keys envelope-encrypted (purpose origin_client_certificate.private_key_envelope); one is issued when a site turns on presenting a client certificate, and maintenance.rotate-origin-client-certificates checks hourly, issuing a new one 30 days before expiry and publishing the clusters whose latest revision carries client certificates (reason origin_client_certificate_rotated). Earlier ones stay until they expire and are deleted 7 days later. IR: OriginPool.client_certificate_id and NodeConfig.origin_client_certificates (CertificateRef, sorted by id), requiring origin-mtls-v1; nodes fetch chain and key with GetCertificates (only for clusters whose published revisions reference them).
  3. Nodes write the key to <prefix>/conf/origin-client/<id>-<first 16 of the fingerprint>.key (0600, owned by the nginx worker user) and the chain to the .crt of the same name; the three origin layers (HTTP/1.1, HTTP/2, gRPC) render *_ssl_certificate $edgeweir_origin_cert and *_ssl_certificate_cache, set per chosen origin in balancer_by_lua (empty for S3 and HTTP origins, which present nothing). Keep-alive pools are keyed by SNI, trust and client certificate (edgeweir.origin.pool_key): requests with another certificate or trust never reuse the connection. Active health checks present the same certificate.
  4. Certificates the Origin CA issues for origins are in origin_certificate (host names, key type, source generated / csr, serial, revocation time); keys are never stored (a generated key is returned once), and they cannot be uploaded as certificates for visitors (CERTIFICATE_ORIGIN_CA). A revocation re-signs the CRL with the Origin CA (unexpired revoked certificates only, nextUpdate the CA's expiry), stored in pki_authority.crl_pem, and publishes the clusters that trust the Origin CA (reason origin_certificate_revoked); rollbacks also get the current CRL and client certificate.
  5. Trust: OriginPool.tls_trust (ORIGIN_TLS_TRUST_ORIGIN_CA) needs verification and no S3 origin in the pool, with NodeConfig.origin_ca (certificate and CRL), requiring origin-ca-v1. Nodes render the three origin layers origin-oca[-h2|-grpc].sock only while a site trusts it, with *_ssl_trusted_certificate and *_ssl_crl pointing at <prefix>/conf/origin-ca/<content hash>.pem / .crl (the names follow the content, so a revocation reloads). nginx checks CRLs along the whole chain, which is why the Origin CA is a trust of its own and never combined with the system CAs.
  6. Rotation: every pki_authority row has a kind (node-channel, origin-client, origin-ca), a status (active signs, next is only trusted, previous was replaced but is still trusted) and a generation, with (kind, status) unique; the first generation's id is the kind, later ones are <kind>-g<n> named with G<n> (two authorities trusted at once never share a subject, which is how OpenSSL finds issuers and CRLs). origin_certificate and origin_client_certificate record the issuing authority_id. The Origin CA: rotate (the new CA issues, the old one becomes previous; NodeConfig.origin_ca_previous carries it with its own CRL and requires origin-ca-rotation-v1, refused while active nodes of the clusters lack it), then retire (the old row and its key are deleted, nodes stop trusting it); cancel while the new CA has no valid certificates. A revocation rebuilds the CRL of the CA that issued the certificate; rollbacks and the canary's stable revision use the two current CAs. The origin client CA: rotate (next, only in the trust bundle), then activate (next becomes active and every cluster switches to a certificate of it and publishes; failures are caught up by the hourly replacement, and issuing takes the active row FOR SHARE), then retire (refused while a cluster presents the old CA's certificates); cancel before activate. Every step writes its audit entry in the same transaction (origin_ca.rotation_start|retire|rotation_cancel, origin_client_ca.rotation_start|activate|retire|rotation_cancel).

Access authentication

  1. A site has at most 16 authentication rules (site_auth_rule, ordered by position): kind basic, forward or url_a–url_d, a scope (domains, path prefixes, extensions, excluded path prefixes) and the kind's settings; the secret (Basic users with PBKDF2-HMAC-SHA256 hashes, the primary and backup keys of signed URLs) is one JSON document envelope-encrypted in the same row (purpose site_auth_rule.secret_envelope, bound to the rule ID), and secret_version grows with every change. The IR is Site.auth_rules (the enabled rules in order, scope lists sorted) with references to the secrets only (credential_id, credential_version); it requires access-auth-v1.
  2. Nodes fetch the rules' secrets of their cluster's sites with GetOriginCredentials (the path of S3 and PURGE keys), keep them in credentials.json in the state directory (0600) and attach them, parsed, to the site table in the data plane's shared memory; a rule without its secret stays but has no users or keys and refuses every request in its scope.
  3. In the edge layer's access phase the first enabled rule whose scope the request matches is chosen after the PURGE method, and a signed URL loses its signature at once (A and D their query parameters, B and C two segments of the normalized $uri); the check runs after the platform allow and block lists and before the rule phases (a plain HTTP request the site forces to HTTPS is redirected first). Basic keeps results per worker (successes 60 s, failures 10 s) and limits failures per site and client network (shared dictionary edgeweir_auth). Forward authentication sends an ngx.location.capture subrequest to the internal location /./edgeweir-auth, which goes through the origin layer to the service (origin address policy, TLS verification, the rule's timeout, only the forwarded request headers); 2xx and 401/403 answers may be cached in edgeweir_auth.
  4. Refused requests are counted in MinuteStats.auth_failures (node_minute_stats.auth_failures, the hourly and daily rollups and the ClickHouse mirror) and shown on the site's Attacks tab. The console's "Sign a URL" computes with the primary key on the server and neither stores nor sends the result. See Access control.

Access control

  1. A site's access control lives in site.access_control (jsonb: hotlink protection, user agents, CORS, geo, WebSocket and security headers, each keeping its settings while off) and site.block_list_ids, site.allow_list_ids (referencing ip_list; a list in use cannot be deleted); accessControl.update replaces the parts in the request only and publishes the site's cluster.
  2. The compiler writes only the parts that are on into Site.access_control (proto v0.28.0), capability access-control-v1; geo access also needs geoip-city-v1 / geoip-asn-v1 by its lists (subdivisions: the console checks geoip-subdivision-v1). A site without any setting encodes byte for byte as before. Origins, host forms, Referer parsing, user agent wildcards and every decision have a reference implementation in @edgeweir/rule-engine that shares its test vectors with the node's Lua.
  3. Edge access phase: once the site is known the node works out "site allowed" (ip.src on a site allow list), which skips site bans and CC bans of single clients, site block lists, geo, hotlink, user agents and Under Attack / CC challenges; after the platform allow and block lists come site block lists → geo → CORS preflights answered at the edge (204 / 403, never sent to the origin) → hotlink → user agents → access authentication → rule phases; WebSocket upgrades have their origin checked after the rules. The header filter adds CORS and security headers before the response phase rules run (rules win), cache hits included. The origin layer gives upgraded connections the site's WebSocket idle timeout; the edge layer's local hop to it allows 86400 seconds.
  4. ipCheck.check is read-only: the lists holding the address, the active bans covering it, what each cluster's client address setting makes of it (trusted proxy, node address), and for a chosen site the outcome in the edge's order; no GeoIP. See Access control.

WAF actions, request bodies and verified crawlers

  1. Rule actions stay in edge_rule.action: the custom WAF phase adds Ban, Custom response, Close connection and Skip; the log action has accessLog, rate limits banSeconds, config actions crs. The compiler writes RuleAction fields 34–43 (proto v0.29.0, capability waf-v2) only when used, defaults as zero values (the /32 and /64 ban prefixes as 0, for one). CRS exclusions live in site_waf.exclusions: whole-site entries without targets merge into the former excluded_rule_ids, those with a path or targets go into SiteWaf.exclusions.
  2. Request body fields, form_value and json_value work in the request phases only (capability rules-body-v1); sites whose rules reference them (every site when a global rule does) carry Site.rules_body_limit (site.rules_body_limit). @edgeweir/rule-engine has the reference parsing of forms, multipart and JSON, sharing test vectors with the node's Lua. Nodes read a body only when an expression evaluates such a field, and only requests whose Content-Length is within the limit; ModSecurity in the CRS location then inspects the same body.
  3. The ban action and a rate limit's ban are written by the node through the automatic ban channel and reported with ReportBans (AutoBan.rule_id); the console stores them with source rule (reasons waf_rule, rate_limit, trigger.ruleId), sharing the unique index (now with the source), the sharing setting and the per-cluster cap with automatic bans. When a log rule asks for an access log line, the node writes it whatever the sample rate with AccessLog.rule_ids, stored in access_log.rule_ids.
  4. CRS by path: nodes match exclusions and the config rules' CRS override against the normalized path in the edge layer, hand the matching entries' content tokens to the generated ModSecurity rules (ctl:ruleRemoveById / ctl:ruleRemoveTargetById) in the internal header X-Edgeweir-Waf-Ex, and rewrite the mode in X-Edgeweir-Waf or skip the CRS location for an override; both internal headers are removed before the origin.
  5. SiteProtection fields 8–11 (capability challenge-v2): verified search engine crawlers (reverse and forward DNS through the node's own resolver, cached in a shared dictionary), challenge page text and challenge failure bans (reason challenge_failures), stored in new columns of site_protection. See Rules, OWASP CRS and Challenges.

Access log fields and statistics dimensions

  1. Once the edge layer knows the site, it looks the client up in GeoIP once per request (no call to the agent on a worker cache hit; these lookups time out after 50 ms and, after a failure, the worker skips them for 5 seconds); logs and statistics share the result. The origin layer hands the origin address back in the internal response header X-Edgeweir-Upstream (the edge applies proxy_hide_header; cache hits record no origin).
  2. Nodes record block reasons where they refuse (edgeweir.reasons, the first one of a request wins); requests refused once the site is known are counted and logged. With Site.log_blocked (proto v0.30.0, feature access-logs-v2), requests with a block reason get a line whatever the sample rate, sharing the budget of 100 lines per site and second on a node with log rules; log_query, log_headers and log_peer select the optional fields, which the console keeps only while the site records them.
  3. Statistics dimensions (MinuteStats 14–24, feature stats-dims-v1, statistics only) accumulate in each worker's minute buckets and reach the shared dictionary edgeweir_topstats with the top URLs and IPs once the minute ends; the console adds them key by key (networks and referrers keep the top 50), rolls them up by minute, hour and day, and analytics.dimensions reads them. AS names are kept in asn_name.
  4. Fetches per origin (MinuteStats.origins, feature origin-stats-v1, statistics only): the node counts every attempt in the origin layer's log phase by site and origin id (attempts, no connection, timeouts, TLS failures, invalid answers, 5xx, and the time to the response header of answered attempts as 11 buckets and a sum) in the same minute bucket, at most 64 origins per site and minute. The console keeps UUID origin ids only, stores them as origin_stats (keys <origin id>:<field>), adds them key by key and rolls them up by minute, hour and day; sites.originQuality answers the site's current origins, with percentiles interpolated inside a bucket. See Origins and cache.
  5. Access log retention is the system setting log_retention: PostgreSQL partition maintenance and the earliest time of writes and searches follow it; ClickHouse runs ALTER TABLE access_log MODIFY TTL on save and at the first maintenance after a process starts.
  6. edgeweir-node accesslog reads the shared dictionary edgeweir_tap through the control API GET /v1/logs/tap: only while a viewer's renewed marker exists does the log phase record requests (expiring after 10 seconds, at most 2,000 per node and second), independent of the sample rate and outside the upload queue. Nodes write no local log files. See Access logs and AccessKeys.

Site tags, batch operations and copying settings

  1. Tags live in tag (key: the NFC name in lower case, unique) and site_tag and are used by the console only: they never enter NodeConfig and changing them publishes nothing. Tag writes take the advisory lock edgeweir.tags before the site rows, which they lock FOR KEY SHARE in id order. sites.list filters by tagIds (any or all) and search also matches tag names.
  2. Batch on/off and delete run in one transaction: each site that changes gets the same audit entry as the single action, each cluster is published once (publishRevision, the reason with the number of sites); deletion works as deleteSite, lockStats first and the usage computed. A batch purge is the existing whole-site task for several sites.
  3. Copying settings (services/site-copy.ts) splits a site's settings into 16 parts, each read (defaults filled in, comparable), checked and adjusted against the target, then written, with the same checks as saving each tab (origin groups, domains, certificate and HTTPS ports, IP lists FOR SHARE). The source is read once (access authentication secrets decrypted in memory only); each target is one transaction that writes only the parts that differ, publishes the target's cluster for it and audits site.settings_copied; a failing target rolls back as a whole. A preview runs the same and rolls the transaction back. Access authentication secrets, PURGE keys and S3 secrets are sealed again with the master key for the new rows (envelopes bound to the new record ids). Copies and clones keep no link between source and target: changing the source later does not change them. See Managing many sites.

Image format conversion

  1. Settings live in site.image_convert (jsonb, {} is the defaults, off); only while on are they compiled into Site.image_convert (proto v0.31.0, feature image-convert-v1), so a site with it off compiles byte for byte as before. Changes are hot updates.
  2. After the cache decision, for GET / HEAD requests that are cached, the edge layer picks a class from Accept (avif > webp > original; explicit types only, navigations naming text/html and paths with another extension than the source types' get the original), appends |i=<class> to the cache key (before the purge epoch; the original's key is unchanged), never slices a variant request and sends it to upstream edgeweir_image (the agent's image.sock) with X-Edgeweir-Image naming the class, quality, ranges and the origin layer it would have used. Image responses of eligible requests get Vary: Accept.
  3. The agent's converter passes the request on as it came (method, raw URI, headers, without X-Edgeweir-Image) to that origin layer, which picks the origin and writes X-Accel-Expires as always; a 200 of a chosen source type within the size and pixel range is converted in a child process edgeweir-node imgconv (pure Go: gen2brain/webp and gen2brain/avif built with nodynamic,wasm2go, libwebp 1.6.0 and libavif 1.4.2 / aom 3.14.1 transpiled to Go; the standard library decodes). The child has RLIMIT_DATA of its estimate plus 256 MiB, cannot write files, drops its capabilities, runs with GOMAXPROCS=1 and is killed at the timeout. A converted response gets a new Content-Type, Content-Length and ETag (-webp / -avif appended) and the internal header X-Edgeweir-Image-Saved (hidden from clients by the edge, read on cache hits too); failures, limits and variants that are not smaller answer with the original, and only a missing conversion slot caps X-Accel-Expires at 60 seconds. When the origin layer closes on purpose so that the edge serves its stale copy, the converter closes too.
  4. Concurrency, the memory total and the timeout are node flags (--image-workers, --image-memory-mb, --image-timeout); with --image-workers 0 the agent does not listen on image.sock nor announce image-convert-v1, and configurations that convert are rejected, keeping the last-known-good one.
  5. Saved bytes are added up per minute in the edge layer's log phase (complete 200 GET responses), reported as MinuteStats.image_bytes_saved, and kept in minute, hour and day statistics and the view traffic_hour_stats. See Image format conversion.

Markdown for Agents

  1. Settings live in site.markdown (jsonb, {} is the defaults, off); only while on are they compiled into Site.markdown (include and exclude prefixes, sorted and unique; proto v1.9.0, feature markdown-v1), so a site with it off compiles byte for byte as before. Changes are hot updates.
  2. Before the cache decision, for GET / HEAD requests on an eligible path (no extension or an HTML-like one, prefixes matched), the edge layer adds Vary: Accept to HTML and Markdown responses; when Accept names text/markdown (q > 0) it never slices the request and sends it to upstream edgeweir_markdown (the agent's markdown.sock) with X-Edgeweir-Markdown naming the origin layer it would have used; cached requests append |m=md to the cache key (before the purge epoch; the HTML's key is unchanged), and purge markers, Cache-Tags and the cache generation reach both variants. Vary is added only towards clients; cached objects carry none, so the cache is not split by every client's Accept.
  3. The agent's converter fetches the whole document from that origin layer as a GET (HEAD too: the Markdown's headers depend on the whole document), without conditions or Range, accepting identity or gzip only; a 2xx (not 204, 205, 206) text/html of at most 6 MiB after gzip decoding is converted in a child process edgeweir-node mdconv (JohannesKaufmann/html-to-markdown v2 and golang.org/x/net/html, charsets detected by x/net/html/charset): navigation, page-level headers and footers, sidebars, forms, scripts and hidden elements are dropped, a single visible <main> is converted alone, links become absolute, YAML frontmatter goes first and JSON-LD last. The child has the same limits as image conversion (internal/sandbox). A converted response gets Content-Type: text/markdown; charset=utf-8, X-Markdown-Tokens and the default Content-Signal, loses ETag, Last-Modified and the encoding and range headers, and carries the internal header X-Edgeweir-Markdown-Converted (hidden from clients by the edge, read on cache hits too); failures, limits and empty results pass unchanged, and only a missing conversion slot or a slow origin caps X-Accel-Expires at 60 seconds.
  4. Concurrency, the memory total and the timeout are node flags (--markdown-workers, --markdown-memory-mb, --markdown-timeout); with --markdown-workers 0 the agent does not listen on markdown.sock nor announce markdown-v1, and configurations that convert are rejected, keeping the last-known-good one.
  5. Markdown responses are counted per minute in the edge layer's log phase (complete 200 GET responses), reported as MinuteStats.markdown_responses, and kept in minute, hour and day statistics and the view traffic_hour_stats. See Markdown for Agents.

Tiered Cache

  1. The console-wide setting is system_setting tiered_cache (topology, upper tier port 8444, custom nodes and node groups); a site's is site.tiered_cache (null follows the console-wide one). ADR-0073.
  2. Nodes taking part: active nodes of the cluster with a heartbeat in the last 10 minutes that report tiered-cache-v1; upper tiers also report tier-upper-v1 (the node certificate carries serverAuth and the SAN <node id>; nodes with an older one are asked to renew by the heartbeat's renewCertificate at most once a day) and have a primary scheduling address (IPv4 first).
  3. Selection (chooseTiers in config-compiler/src/tiers.ts, a pure function): Smart, Generic, Regional and custom, see Tiered Cache. Latencies are the TCP round trip times nodes measure every minute to the first primary origin of each site's default origin group (ReportStatusRequest.tier_latencies → tier_latency; only successful measurements of the last 10 minutes count). A chosen upper tier stays while within 120% + 5 ms of the fastest. Choices are kept in tier_selection (one row per site: topology, each node's upper tiers and why, the measured target, when chosen).
  4. Every publishRevision runs syncTierSelections under the publish lock first; loadConfigInput then compiles the choices into NodeConfig.tiered_cache: sites with the same hops share a plan (its id a hash of the hops) that Site.tier_plan_id names; only upper tiers carry an address; the latency targets are the origins of every tiered site (ids a hash of host:port). Without plans and targets the field is left out, so a cluster without tiers compiles byte for byte as before.
  5. The pg-boss queue tiers.select chooses again every minute for clusters with tiered sites and publishes with tier_selection_changed when upper tiers change. Changing the console-wide setting publishes the clusters of the sites that follow it (tiered_cache_updated).
  6. Statistics: nodes report MinuteStats.tier_fetches (lower tiers, by the upper tier's cache status, origin for fallbacks) and tier_served (answers to lower tiers); the console keeps them as tier_stats (f:<status> / v:<status>) of the minute, hour and day statistics and the view traffic_hour_stats. The access log's tier field is <node id> <status> or origin.

Node extensions

Generic, signed Lua extensions of the edge request path (format edgeweir-node-extension-v1, Lua API 1, ADR-0071; contract in Node extensions). The console and the node know no particular extension, check no licenses and contact nobody about them.

  1. Trust: the operator adds publisher keys (Ed25519 public JWKs, extension_key, kid = RFC 7638 thumbprint); there are none by default. Installing (POST /extensions, base64 package + compact JWS) verifies the archive (strict ustar, limits, no links / native code / bytecode), the manifest (strict schema) and the signature against a trusted key whose publisher matches, then stores the version (extension_version, bytes in the database). A new id starts disabled; installing a newer version of an installed id activates it.
  2. Settings: per extension enabled, failure mode and global configuration (extension), per site enabled and site configuration (site_extension), the kill switch (system setting extensions). Configuration is validated against the manifest's JSON Schema subset; x-secret values are masked in answers. Manifest rule fields register ext.<id>.<name> in the rule engine, which rules may use in request phases; removing an extension or version that rules still read is refused.
  3. Compilation (packages/config-compiler): NodeConfig.extensions lists, in install order, the active version of each enabled extension that an enabled site of the cluster turns on (digest, size, signature, signing key, failure mode, global configuration, shared dicts), with the kill switch; each site lists its extensions with their site configuration. Delivered extensions or rules reading ext.* require extensions-v1; enabling is refused while an active node of an affected cluster lacks it.
  4. Node: the agent fetches missing packages by digest (GetExtensionPackage, mTLS), verifies them again (and against --extension-keys when set), unpacks them to <state>/extensions/<sha256>/ and lists the loadable ones in nginx.conf (init parameter extensions, one lua_shared_dict ewx_<hex id>_<name> per declared dict). A change of the loaded set reloads nginx; settings and site lists are hot. --no-extensions turns it off.
  5. Runtime (lua/edgeweir/ext.lua): each worker loads packages into an environment of their own, runs init on first use and calls access (before access control, rules and challenges), access_late (after them, before the CRS, cache and origin), header_filter, body_filter (with HTML injection) and log, and answers /.edgeweir/ext/<id>/… (assets, endpoints). Hooks run under pcall with time budgets; faults trip an extension per worker; failure mode closed answers 503 X-Edgeweir-Error: extension.
  6. Reporting: access logs carry AccessLog.ext (log fields, verdicts) and block reason extension with rule id ext:<id>; minute statistics carry MinuteStats.ext_counters; heartbeats carry ExtensionStatus per extension (state, faults, trips), shown per node in the console.

Regional probes and scheduling

  1. Probers: regional probes (probe; edgeweir-node probe enrolls through EnrollProbe with a one-time probe_token), or nodes with node.probe_enabled whose node group has a region (probe=true in the ReportStatus response).
  2. GetProbeTargets returns every enabled node's scheduling addresses (node_ip: only the configured rows and their levels when there are any, otherwise the public reported addresses) × the listener ports of the cluster's latest revision, with interval, timeout, and attempts; HTTP / HTTPS listeners are probed through the health endpoint when every active node of the cluster has probe-health-v1, otherwise with TCP only. A node that also probes skips itself.
  3. ReportProbeResults accepts current targets only and writes probe_result (one row per prober, node, address, and port, latest value); rows not updated for 1 hour are deleted.
  4. Every 10 seconds (an in-process timer of the worker; a lease lets one process run at a time) and after every probe report (at most every 2 seconds per cluster and process), each cluster is evaluated in a transaction (advisory lock): first node_address_state from the results in the window (3 intervals, at least 15 seconds; a strict majority of probers failing for ipDownSeconds makes an address unreachable, ipUpSeconds without failing makes it reachable), then scheduling_state for every scheduling_rule and node (since when each condition holds, the action started, the conditions cleared).
  5. An address level change publishes the cluster's DNS revision (reason health). Every activation and recovery of a rule publishes one (reason scheduling, reason_params with rule, node, action, and event), is audited with the system identity as scheduling.activate / scheduling.recover, and raises or resolves the platform alert scheduling_action. Clusters with a new revision are written to DNS right away.
  6. compileBindingPlan computes each binding line's addresses from the nodes' effective levels (the lowest reachable level, at least backup 1 under a backup_ip action), rule removals, and the line's backup node groups (fewer healthy addresses than minHealthyIps, or a backup_group action); all.<domain> is written per resolution line. The mass removal protection compares per name, type, and resolution line, and counts backup group switches only when they empty a record set.

Node metrics (ReportStatusRequest.metrics, metrics-v1) are kept in node.metrics, latest value only; scheduling treats metrics older than 60 seconds as missing.

Management actionAudit
Probe tokens, renaming and enabling, deletion (revokes the certificate)probe.token_create, probe.update, probe.delete
Probe enrollment and certificate renewalprobe.enroll, probe.certificate_renew (actor: the probe)
Probe settingssystem.probes_update
Scheduling addresses, probing nodesnode.set_addresses (publishes the cluster's DNS, reason manual), node.set_probe
Scheduling rulesscheduling.rule_create, scheduling.rule_update, scheduling.rule_delete (disabling, deleting, or changing line, conditions, or action first ends the actions in effect)

Behavior: Regional probes and scheduling.

Statistics, logs, and alerts

ModeEDGEWEIR_ANALYTICSAccess logsPer-minute statisticsCharts and alerts
lite (default)litePostgreSQL access_log, one partition per UTC dayPostgreSQLPostgreSQL
ClickHouseclickhouseClickHouse access_logPostgreSQL, with a copy in ClickHouse minute_statsPostgreSQL

Access logs are sampled per site; the sample rate defaults to 0 (off). Per-minute statistics pre-aggregated by nodes go to node_minute_stats; the worker rolls them up into node_hour_stats and node_day_stats, and the view traffic_hour_stats combines rolled-up and pending data. Overview, site statistics, and the platform overview query 1-hour, 6-hour, 24-hour, 7-day, and 30-day ranges in buckets (date_bin); the 7-day and 30-day ranges read hourly data.

DataRetention
Access logsSystem setting log_retention: PostgreSQL 1–30 days, ClickHouse 1–90 days, 7 by default
Node logsSystem setting node_log_retention: 1–30 days (7 by default), at most 1,000–100,000 entries per node (10,000 by default)
Per-minute statistics (PostgreSQL and ClickHouse)7 days
Per-minute statistics of L4 apps7 days
Hourly statistics90 days
Daily statistics365 days

Alerts (alerts.sweep, every minute) detect offline nodes, skewed node clocks (the offset of the last heartbeat at or above the alert policy's seconds; one alert per node, like offline nodes), expiring certificates, unavailable origins, and high 5xx rates (the cc_mitigation alert fires on a node's event and resolves once no node reports the site above normal), create alert_event rows, fan them out to alert_delivery by alert_subscription (one per channel, covering a set of sites in alert_subscription_site or all sites with all_sites), and send them through an alert_channel (webhook, email, DingTalk, WeCom, or Telegram); at delivery the channel must still be enabled and the subscription still valid, and "receive every alert" channels get every alert. Cluster alerts (configuration canary rolled back, DNS mass removal blocked, DNS reconciliation failing dns_reconcile_failed (5 minutes of failures; resolved by a success or once nothing needs writing), a scheduling rule acting on a node scheduling_action, and others) are raised and resolved by their own flows, resolved when the cluster is deleted, and go only to "receive every alert" channels. Access logs and AccessKeys: Access logs and AccessKeys.

Background jobs

QueueScheduleWork
alerts.sweepEvery minuteAlert detection and delivery
mitigation.evaluateEvery minute (one job at start)Evaluates every site's automatic mitigation: turns on the site's Under Attack when a node's CC level reaches the threshold, and turns it off once the level has stayed below it for the configured time; the state and the expiry are in site_auto_mitigation, so a restart or a repeated job only evaluates again
development-mode.expireEvery minute (one job at start)Turns off development modes whose deadline (site.development_mode_until) passed: clears it, publishes and audits as the system; nodes resumed caching at the deadline already, so a restart or a repeated job only checks again
rollouts.evaluateEvery minuteEvaluates running configuration canaries: promote, await promotion, or roll back (canary node heartbeats trigger an evaluation too)
dns.reconcileEvery minuteDeletes expired old CNAME prefixes and publishes the DNS of their clusters; DNS steering publishing and external record maintenance
traffic.rollupEvery minuteTraffic rollup and cleanup (L4 app minute statistics included), usage rollup and retention (then every site's usage protection, with an immediate alert sweep when its alerts change), access log partition maintenance, upgrade expiry; one failing part does not stop the others
certificates.sweepEvery minuteCertificate issuance and renewal
tiers.selectEvery minuteChooses the tiered cache's upper tiers again and publishes when they change
maintenance.recompileAt start; skipped while config_recompiled in system_setting matches the current markerRepublishes every cluster once when an upgrade changes what stored data compiles to
maintenance.check-certificatesAt startChecks uploaded certificates not marked yet and marks those nodes cannot load (EC keys with explicit curve parameters) as failed
maintenance.link-acme-accountsAt startLinks certificates to the ACME account that issued them; records certificates of the environment-variable era as the custom ACME directory
maintenance.prune-revisionsMinute 17 of every hourDeletes revisions and DNS revisions beyond the retention count
maintenance.prune-idempotency-keysMinute 29 of every hourDeletes expired idempotency keys (older than 24 hours)
maintenance.expire-cache-tasksMinute 43 of every hourFails purge and prefetch deliveries past their deadline; deletes tasks older than 90 days (purges a node has yet to make up stay)
maintenance.prune-oauthMinute 47 of every hourDeletes expired MCP access tokens, refresh tokens expired or revoked more than a day ago, and OAuth clients nobody authorized within 30 days
maintenance.expire-enrollment-tokensEvery 30 minutesDeletes enrollment tokens expired or used more than 7 days ago
maintenance.prune-bansEvery 10 minutesDeletes bans that expired more than an hour ago
maintenance.rotate-challenge-keysHourly at minute 11Rotates challenge keys that are a day old
maintenance.rotate-session-ticket-keysHourly at minute 13Rotates TLS session ticket keys that are 12 hours old
maintenance.rotate-origin-client-certificatesHourly at minute 19Issues clusters a new origin client certificate 30 days before expiry, deletes those expired a week ago
maintenance.prune-security-eventsHourly at minute 37Deletes security events past the retention
maintenance.prune-node-logsAt start, then every 10 minutesDeletes node logs past the retention and each node's oldest entries beyond its limit; debug log pulls go after as many days, the last 10 of each node kept
Scheduling evaluation (an in-process timer, not a pg-boss queue)Every 10 seconds; one process at a time (lease), a tick is skipped while the previous run is busyProbe-driven address reachability and scheduling rules, see Regional probes and scheduling

Data model

Tables are defined in packages/db/src/schema; migrations are plain SQL generated by drizzle-kit in packages/db/migrations and run at console startup (see Startup sequence).

Account and identities

TableContents
userThe operator's account, the only one, created by the setup wizard
sessionSign-in sessions
accountSign-in credentials (password hash)
verificationbetter-auth verification records
two_factorTOTP secrets and backup codes
passkeyPasskey public keys
apikeyAccessKeys: hash, permissions, enabled state
oauth_clientOAuth clients of MCP: registered dynamically or resolved from a client metadata document (client_discovery_id), redirect URIs and scopes
oauth_resource, oauth_client_resourceThe OAuth resource (<console URL>/mcp) and client-to-resource bindings (better-auth's schema)
oauth_consentGrants: the scopes the operator approved for a client; last_used_at is the last /mcp request
oauth_access_token, oauth_refresh_tokenOpaque access and refresh tokens, stored as SHA-256 only; bound to the resource, session and refresh token, rotated on refresh
oauth_client_assertionUsed private_key_jwt assertion ids (replay protection)
service_accountService accounts: name, scopes, enabled (cannot sign in)
service_account_keyService account keys: SHA-256, prefix, last use, revocation
idempotency_keyIdempotency keys of /api/v1 writes: caller, method, path, body hash and final response, kept 24 hours
rate_limitRate-limit counters of the authentication endpoints

Infrastructure

TableContents
regionRegion dictionary
clusterClusters: sets of nodes that share one revision stream; extra listener ports, client IP, unknown host settings (unknown_hosts) and the default site (default_site_id, cleared when the site is deleted)
node_groupNode groups, optionally tied to a region
nodeNodes: status, capabilities, certificate serial and fingerprint (after a renewal also the replaced certificate's serial), last heartbeat and its connection's source address, why its certificate was last refused, last reported ban state, CC level per site and host metrics, whether the node also probes, last reported clock offset and when
node_ipNode IP addresses: reported by the node (reported) and scheduling addresses the operator configured (configured, level 0 primary, 1 backup 1, 2 backup 2)
node_address_stateProbe reachability of scheduling addresses: failing since, down flag, answering since
probeRegional probes: name, region, enabled, certificate serial and expiry, last seen, version
probe_tokenSHA-256, prefix, name, region, expiry and usage of probe enrollment tokens
probe_resultLatest result of each prober (probe or node that also probes) per node address and port: sent, lost, latency, error code
enrollment_tokenSHA-256 and usage of enrollment tokens
node_certificate_revocationCertificate serials revoked when a node is deleted
pki_authorityInternal CAs (node channel, origin client, Origin CA), private keys envelope-encrypted; the Origin CA's current CRL
system_settingPlatform key/value settings: setup token, session secret HMAC check value, origin allow list, SMTP, node release source, alert policy, bans, platform protection and the CC template, platform error pages, one-time migration markers
audit_logAudit of management actions

Sites and configuration

TableContents
siteSites: cluster, enabled state, cache key, slicing, Cache-Tag forwarding, WebSocket, certificate, TLS settings, cache generation, log sample rate, whether error pages replace origin errors and when they were saved, when development mode ends
site_domainSite domains: name and form (kind: exact, wildcard, suffix, pattern); a name in one form is unique across the console
site_starPer-user stars
tagSite tags: a name (1–32 characters) and a key (NFC, lower case, unique: names differing only in case are one tag); console only, never sent to nodes
site_tagSites and their tags (at most 10 per site)
origin_poolOrigin pools: timeouts, keepalive, failure thresholds, origin TLS verification, HTTP version towards the origins and gRPC, active health check and session affinity (kept while off)
originOrigins and their origin group (empty for the default group)
origin_credentialS3 origin keys, envelope-encrypted
site_secretOther site secrets (the PURGE method's key), envelope-encrypted, delivered over the node channel only
site_auth_ruleA site's access authentication rules (at most 16, ordered); Basic user hashes and signing keys envelope-encrypted in the same row, delivered over the node channel only
cache_ruleCache rules: condition expression and list references, status and size conditions, action, edge and browser TTLs
edge_ruleSite or global rules: phase, expression, action, list references
edge_rule_versionRule versions: a full snapshot, actor and source (UI, API, restore, settings copy, initial) each time a save creates, changes or deletes a rule; the last 50 per rule and the 100 most recently deleted rules per site and for the platform are kept
bulk_redirectA site's bulk redirects: source (path or domain plus path, unique per site), target, status code, whether the query string is kept, order
cluster_port_poolA cluster's layer-4 port pools: protocol (TCP, UDP, both) and port range (1024-65535, no overlap per protocol)
l4_appLayer-4 applications: cluster, name, protocol, port (unique per cluster, protocol and port), enabled, PROXY protocol (accepted, version sent to origins), passive health check, connect and idle timeouts, allow and block list references, concurrency and new-connection limits
l4_originOrigins of a layer-4 application: address, port, weight, backup, order
ip_listIP lists (normalized CIDRs, unique names); allow / block lists apply to every site
ip_banDynamic bans: scope (platform / site), normalized CIDR, reason code, source (manual / auto; auto bans keep the node and trigger), expiry and removal time, seq (sequence ip_ban_seq), whether it is delivered
site_protectionSite protection: Under Attack and its challenge type, pass lifetime, proof-of-work difficulty, CC policy (template or custom), JA4 logging; no row means the defaults
site_wafA site's OWASP CRS: mode (off, detect, block), paranoia level, anomaly threshold, excluded rule ids, request body limit; no row means off
site_error_pageA site's error pages: one template per status (403, 429, 502, 503, 504)
challenge_keyChallenge keys of a cluster (next, current, previous), secrets envelope-encrypted
site_certificateA site's further certificates (positions 1–3; the first is site.certificate_id); a referenced certificate cannot be deleted
session_ticket_keyTLS session ticket keys of a cluster (next, current, previous), secrets envelope-encrypted and generated when first fetched
config_revisionRevisions per cluster: number, content hash, binary IR, reason code
node_config_statusNode apply receipts and heartbeats, with the receipt verification flag
cluster_rolloutConfiguration canary of a cluster: policy (switch, observation window, auto promotion, 5xx thresholds) and the current rollout (stable and candidate revisions, window, outcome)
extension_keyTrusted publisher keys of node extensions: kid (RFC 7638 thumbprint), publisher, public key x, label
extensionInstalled node extensions: active version, enabled, failure mode, global configuration
extension_versionUploaded versions of an extension: package bytes, SHA-256 (unique), size, signature, signing kid, manifest
site_extensionA site's extensions: enabled and site configuration

Certificates, DNS, and domains

TableContents
certificateChain, fingerprint, expiry, renewal state, and the ACME account that issued it; private key and the request's EAB key envelope-encrypted
acme_accountACME accounts (shared per directory, EAB key id, and email), account key envelope-encrypted
acme_challengeShort-lived public HTTP-01 responses
dns_credentialDNS provider credentials and zone for ACME DNS-01, envelope-encrypted
dns_challenge_leaseCleanup obligations of DNS-01 TXT records
platform_dns_providerDNS steering provider accounts and their zones, credentials envelope-encrypted
dns_bindingA cluster's DNS binding: mode, provider account, cluster domain, TTL, lines (node group, resolution line, ordered backup node groups, minimum healthy IPs), desired / applied DNS revision, since when reconciliation has kept failing
dns_revisionA cluster's DNS revisions: binding settings, record set (with resolution lines), managed names, status, reason code and parameters
scheduling_ruleA cluster's scheduling rules: optional line, conditions (metric, aggregate, comparator, threshold, duration, region), and / or, action, hold and recovery times
scheduling_stateEach rule's state per node: since when each condition holds, when the action started, since when it is clear
dns_managed_nameRegistered managed DNS names and the cluster they belong to
dns_leaseLeases for DNS work (cluster bindings, DNS-01 credentials): one process at a time handles a binding or credential
cname_retiredOld CNAME prefixes of sites and L4 apps kept for 24 hours after a change: cluster, site or app, prefix (unique), expiry
origin_client_certificateA cluster's origin client certificates: chain, fingerprint, serial, validity, private key envelope-encrypted
origin_certificateCertificates the Origin CA issued for origins: host names, key type, source, serial, validity, revocation time (no private key)

Statistics, logs, tasks, and alerts

TableContents
node_minute_statsTraffic per node, site, and minute, with top URLs, top IPs, matched CRS rules and statistics dimensions (country, network, referrer, client, protocol, block reason, challenges)
asn_nameAS numbers and names nodes report (network names of the statistics dimensions)
node_hour_statsHourly rollups
node_day_statsDaily rollups
stats_rollup_dirtyTime buckets waiting for a rollup (hours, days, usage windows)
node_stats_cursorPer-node high-water mark of statistics batch sequences and the statistics watermark (complete_until)
l4_minute_statsPer node, layer-4 application and minute: new and refused connections, peak concurrency, bytes in / out, kept 7 days
site_usageRecomputable usage per site and UTC 5-minute window (requests, bytes out and in, exact decimals), revision and global seq (sequence site_usage_seq)
site_usage_guardA site's usage protection: period (calendar day / month) and time zone, limits on bytes sent / requests / bandwidth, warning threshold, action and recovery, and the current period's state the worker keeps (metrics at the warning threshold / limit, bandwidth peak, the action it applied, how long a manual restore pauses it, the error code of an action that could not be published)
site_auto_mitigationA site's automatic mitigation: switch, trigger level, hold in minutes, and the state the worker keeps (since when, until when, trigger level, the pause after the operator took over, error code of the last change that failed); no row means off
access_logSampled and forced access logs (request id, User-Agent, Referer, protocol, region, origin, block reason and rule; JA4, the query string, chosen request headers and the peer address while the site records them; matched CRS rules and whether CRS blocked the request), one partition per UTC day, kept as the retention setting says
security_eventCC mitigation events reported by nodes: level changes, escalated paths, automatic bans, with the top addresses and paths of the moment
node_log_cursorPer-node high-water mark of access log batches
node_log_entryNodes' warnings, errors and whitelisted events (time, level, source, component, message, structured fields, folded count, truncation, event); rows with kind = dropped record how many entries the node dropped; deduplicated by (node, batch, index)
node_log_entry_cursorPer-node high-water mark of ReportNodeLogs batches
node_debug_logPulls of a node's debug logs: filters, state (pending, handed out, succeeded, failed), deadline and lease, the uploaded entries (jsonb); at most one unfinished per node, the last 10 kept
origin_healthOrigin health and error codes reported by nodes, one row each for the passive and the active check
cache_taskPurge and prefetch tasks
cache_task_nodeDelivery and result of a task on each node
node_upgradeNode upgrade jobs
node_upgrade_deliveryPhase, state, deadline, and health observation of an upgrade on each node
alert_channelAlert channels, configuration envelope-encrypted
alert_subscriptionOne subscription per channel: alert kinds, all sites or a set of sites
alert_subscription_siteThe sites a subscription covers (removed with the site)
alert_stateCurrent alert state (site and platform alerts)
alert_eventAlert events with an ordinal
alert_deliveryDelivery and retries of an event on a channel

The view traffic_hour_stats combines hourly rollups with minute data not rolled up yet, without double counting.

Migrations

MigrationChange
0000_initInitial schema: better-auth tables, clusters, node groups, nodes, enrollment tokens, sites, domains, origin pools, origins, cache rules, revisions, node status, per-minute statistics, internal CA, audit log
0001_m1region, organization_settings, system_setting, node_certificate_revocation; revision reason codes; actor and target names in the audit log; node group region
0002_site_starsite_star
0003_m2origin_credential, origin_health, cache_task, cache_task_node; origin pool timeouts, keepalive, and TLS verification; cache rule extensions; site cache key, slicing, and WebSocket
0004_wrapup_authrate_limit
0005_wrapup_consoleCache rule cache_authorized; task source; error codes of tasks and origin health
0006_m3_certificatescertificate, dns_credential, acme_challenge; node capabilities; site certificate and TLS settings
0007_m3_challenge_attemptsacme_challenge.operation_started_at
0008_m3_dns_cleanupdns_challenge_lease
0009_m4_rulesedge_rule, ip_list
0010_m5_statsnode_stats_cursor, node_hour_stats, node_day_stats, stats_rollup_dirty, view traffic_hour_stats; top URLs and top IPs in per-minute statistics
0011_m5_domain_ownershipdomain_ownership; site_domain.verified
0012_m5_dnsplatform_dns_provider, dns_state, dns_revision, dns_managed_name
0013_m5_dns_managed_namesdns_revision.managed_names
0014_m5_alertsalert_channel, alert_subscription, alert_state, alert_event, alert_delivery
0015_m5_alert_orderalert_event.ordinal
0016_m5_alert_privacy_defaultalert_channel.platform defaults to false (platform-wide notifications off by default)
0017_m6_logsaccess_log, node_log_cursor; site.log_sample_rate
0018_retain_node_trafficTraffic statistics tables drop their foreign key to node; deleting a node keeps site statistics
0019_m6_upgradesnode_upgrade, node_upgrade_delivery
0020_m6_upgrade_healthnode_upgrade_delivery.healthy_since
0021_authenticated_revision_floornode_config_status.revision_receipt_verified
0022_bound_traffic_countersExisting traffic counters clamped to 0 through 2^53−1
0023_p0_site_stateFour site state columns (dropped by 0034)
0024_p0_organization_limitsorganization_limit
0025_p0_service_accountsservice_account, service_account_key, idempotency_key; invitation.inviter_id nullable, new inviter_service_account_id
0026_p0_usagesite_usage, sequence site_usage_seq, node_stats_cursor.complete_until; marks usage windows for existing minute statistics
0027_p0_config_canarycluster_rollout; alert_event.site_id and alert_state.site_id nullable (platform alerts)
0028_g1_dynamic_bansip_ban, sequence ip_ban_seq; node.ban_status; organization_limit.max_bans
0029_g2_challengessite_protection, challenge_key, security_event; node.security_state; access_log.ja4
0030_g3_wafsite_waf; waf_rules in minute, hour and day statistics and the view traffic_hour_stats; access_log.waf_rule_ids, waf_blocked
0031_g4_cache_origins_error_pagessite_error_page; origin_pool.active_health_check, session_affinity; site.keep_cache_tag, intercept_origin_errors, error_pages_updated_at; origin_health.source (joins the primary key, existing rows are passive); access_log.request_id
0032_g5_rulesbulk_redirect; origin.group_name; cache_rule.browser_ttl_seconds, list_ids; the structured conditions of existing cache rules are rewritten as equivalent expressions and the structured columns cleared
0033_domains_without_ownershipDrops domain_ownership and site_domain.verified; of duplicate pending domains one row stays; site_domain (name, wildcard) is unique
0034_sites_without_suspensionDrops the 0023 site state columns; sites they took offline become disabled; service accounts lose the matching scope
0035_without_organization_limitsDrops organization_limit; service accounts lose limits:read, limits:write
0036_single_operatorKeeps only the earliest platform administrator who is not disabled (the other accounts' alert subscriptions move to it); IP list names become unique (organization lists with a taken name get a suffix and their rules follow), former organization lists become collections; drops organization, member, invitation, organization_settings, every organization_id, session.active_organization_id and alert_channel.available_to_tenants; service accounts lose the organization scopes
0037_dns_cluster_bindingsdns_binding, dns_lease; dns_revision.cluster_id, dns_managed_name.cluster_id; the DNS steering policy becomes one binding per cluster; drops dns_state
0038_certificate_chainsPEM blocks other than certificates (such as a private key) are removed from stored chains
0039_certificate_accountsacme_account; certificate.renewal_info_at
0040_node_lifecyclenode.previous_cert_serial; node_upgrade_delivery.deadline_at (deliveries already released keep the deadline of 30 minutes after creation)
0041_g6_probes_schedulingprobe, probe_token, probe_result, node_address_state, scheduling_rule, scheduling_state; node.metrics, node.probe_enabled; node_ip.source and level (unique by node, source, address); dns_revision.reason_params
0042_g7_layer4cluster_port_pool, l4_app, l4_origin, l4_minute_stats
0043_stats_marker_generationstats_rollup_dirty.generation (rollups clear only the marker generation they read)
0044_node_offline_per_nodeDrops the per-site node offline alert states (one per node now)
0045_rollout_policy_updated_atcluster_rollout.policy_updated_at (the canary policy's own version; existing rows take updated_at)
0046_dns_error_paramsdns_revision.last_error_params (the failure code's parameters, such as the conflicting DNS name)
0047_alert_subscription_sitesalert_subscription_site, alert_subscription.all_sites; drops alert_subscription.site_id, the unique key becomes account and channel; a channel's subscriptions merge into one (the sites and alert kinds of the enabled ones when any is enabled, otherwise of all)
0048_rule_log_statslogged_rules (matches of Log rules) in the minute, hour and day statistics and the traffic_hour_stats view
0049_dns_lease_attemptsdns_challenge_lease.attempts (failed cleanups of a TXT record, for the retry backoff)
0050_node_remote_addressnode.remote_address (source address of the node's enrollment and latest heartbeat connection)
0051_node_last_auth_errornode.last_auth_error, last_auth_error_at (why the node channel last refused the node's own certificate, e.g. CERT_HAS_EXPIRED)
0052_retention_indexesIndexes: alert_event (occurred_at, ordinal); security_event (received_at), site level events above normal only; cache_task_node (node_id), failed and skipped deliveries not made up only
0053_origin_protocolorigin_pool.protocol (HTTP version towards the origins, http1 or http2), origin_pool.grpc (gRPC proxied over HTTP/2 end to end)
0054_edge_portscluster.extra_http_ports, cluster.extra_https_ports (listener ports besides 80 / 443), cluster.client_ip (the client address source, jsonb, null for direct); site.http_ports, site.https_ports (the ports a site is bound to, default 80 / 443); l4_app.port_end (port ranges), l4_app.origin_port_mode (fixed / same), l4_app.certificate_id, l4_app.tls_minimum_version (TLS termination)
0055_site_contentsite_secret; cluster.cache_max_size_gb, cluster.cache_inactive_days (cache zone); node.cache_max_size_gb (node size override), node.cache_usage (reported usage); site.hide_x_cache, site.purge_method, site.maintenance, site.maintenance_updated_at, site.charset, site.request_body_limit; origin_pool.tries, origin_pool.status_retry; cache_rule.cache_set_cookie; site_error_page.redirect_url, site_error_page.response_status
0056_domain_forms_cname_prefixsite_domain.kind replaces wildcard, unique by (name, kind); site.cname_prefix, l4_app.cname_prefix (their id for existing rows: CNAMEs do not change); cname_retired; cluster.unknown_hosts, cluster.default_site_id
0057_g11_certificates_sessionssite_certificate, session_ticket_key; certificate.acme_account_id
0058_g12_access_authsite_auth_rule; site.auth_updated_at; auth_failures in node_minute_stats, node_hour_stats, node_day_stats (the traffic_hour_stats view rebuilt)
0059_g13_access_controlsite.access_control, site.block_list_ids, site.allow_list_ids, site.access_control_updated_at
0060_g14_waf_actionssite.rules_body_limit; site_waf.exclusions (replacing excluded_rule_ids; the site-wide exclusions migrate to one exclusion without a path); allow_verified_bots, challenge_text, failure_ban_enabled, failure_threshold, failure_ban_seconds of site_protection; access_log.rule_ids; ip_ban_auto_uq unique per (node, site, CIDR, source), including source rule
0061_g16_access_logs_statsasn_name; statistics dimensions in minute, hour and day statistics and the view traffic_hour_stats (country_requests, country_bytes, asns, referers, browsers, oses, devices, http_versions, tls_versions, block_reasons, challenges_issued, challenges_passed); site.log_blocked, log_query, log_headers, log_peer; access_log columns for User-Agent, Referer, protocol, region, origin, block reason and the optional fields
0062_g17_site_tagstag, site_tag
0063_g18_image_convertsite.image_convert; image_bytes_saved in minute, hour and day statistics and the view traffic_hour_stats
0064_hidden_cardshidden_cards
0065_cache_rule_respect_defaultrespect as the default of cache_rule.origin_cache_control
0066_auth_identity_headerssite.auth_identity_headers (filled from the stored access authentication rules, disabled ones included)
0067_node_certificate_failuresnode_config_status.certificate_failures (certificates a node reports it cannot load)
0068_node_channel_statusnode.channel, probe.channel (the node channel address a node or probe uses, its fallbacks, why a switch failed, and the TLS server name and WebSocket entry the console sees)
0069_site_usage_guardsite_usage_guard; an index of site_usage by site and window
0070_node_logsnode_log_entry, node_log_entry_cursor
0071_origin_protectionorigin_client_certificate, origin_certificate; origin_pool.tls_trust, origin_pool.client_certificate, pki_authority.crl_pem
0072_site_auto_mitigationsite_auto_mitigation
0073_origin_statsorigin_stats (fetches per origin) in minute, hour and day statistics and the view traffic_hour_stats
0074_node_clock_dns_failuresnode.clock_offset_ms, node.clock_measured_at (node clock offset); dns_binding.failing_since (since when DNS reconciliation has kept failing)
0075_alert_channel_send_timesalert_channel.send_times (per-channel send limits)
0076_rule_versionsedge_rule_version (rule version history), with an initial version for each existing rule
0077_node_debug_lognode_debug_log (pulls of a node's debug logs)
0078_greylist_connection_limitsip_ban.action, challenge, rate_limit_requests, rate_limit_window_seconds (greylist entries; unique indexes split between bans and greylist entries); cluster.connection_limits (kernel connection limits)
0079_origin_proxy_protocolorigin.proxy_protocol_version (PROXY protocol to the origin: 0 off, 1, 2)
0080_origin_ca_rotationpki_authority.kind, status, generation (CA rotation; (kind, status) unique, existing rows take their id as kind); origin_certificate.authority_id, origin_client_certificate.authority_id (the issuing CA)
0081_node_locationnode.location (where the node's public address is, from its own GeoIP data: country, subdivision, City MMDB coordinates)
0082_node_key_decommissionnode.key_sha256 (SHA-256 of the certificate key's SPKI, unique; the same key enrolling again gets the same node), machine_id (digest of the host's machine-id, a hint only), decommission_requested_at, decommission_task_id, decommission_error (decommission without SSH, ADR-0067)
0083_site_development_modesite.development_mode_until (when development mode ends; null while off)
0084_external_probe_sourcesexternal_probe_source, external_probe_mapping, external_probe_observation (external probe sources, monitors mapped to nodes, each location's latest result, ADR-0069); cluster.probe_mode (a cluster's own decision mode, null follows the global one)
0085_markdown_agentssite.markdown (Markdown for Agents); markdown_responses in minute, hour and day statistics and the view traffic_hour_stats
0086_challenges_v3challenge_provider (the global and sites' third-party CAPTCHA providers, secrets envelope-encrypted); site_protection.interactive_provider; challenge_outcomes in minute, hour and day statistics and the view traffic_hour_stats
0087_ai_crawl_controlsite_ai_crawl (a site's AI crawler actions, managed robots.txt, pay per crawl, ADR-0070); access_log.crawler, crawler_verification, crawler_charged_micros; crawler_stats, crawler_paths in minute, hour and day statistics and the view traffic_hour_stats
0088_tiered_cachesite.tiered_cache; tier_latency, tier_selection; access_log.tier; tier_stats in minute, hour and day statistics and the view traffic_hour_stats
0089_node_extensionsextension_key, extension, extension_version, site_extension (node extensions); node.extension_status (per extension state reported by the node)
0090_extension_secrets_dataextension.secret_envelope, extension.secret_version (console-generated extension secrets); site_extension_data (per-site data items of extensions)
0091_oauth_mcpThe OAuth authorization server of MCP: oauth_client, oauth_resource, oauth_client_resource, oauth_consent, oauth_access_token, oauth_refresh_token, oauth_client_assertion

Build output

StepOutput
vite buildapps/console/dist/web (SPA)
node scripts/build-server.mjs (esbuild)apps/console/dist/server/main.js: the server and all dependencies in one ESM file; dist/server/recover.js: the account recovery command, also with all dependencies, without a source map; install/ copied to dist/server/install, migrations to dist/migrations
Dockerfile stage certdgolang:1.27.2-alpine cross-compiles edgeweir-certd on the build machine's platform ($BUILDPLATFORM, no QEMU)
Dockerfile stage buildnode:24.22.1-alpine with pnpm 12.6.0 builds the console once on the build machine's platform; the output (JavaScript and static assets) serves every architecture
Dockerfile stage runtimenode:24.22.1-alpine + tini; no node_modules; runs as user node; EXPOSE 3000 8443; health check edgeweir-healthcheck

Base images are pinned by tag and multi-arch index digest. The image version is <YYYYMMDD>-<commit> (scripts/image-version.sh), written to EDGEWEIR_VERSION and the image label org.opencontainers.image.version; the full commit ID goes to org.opencontainers.image.revision. Development commands and tests: CONTRIBUTING.en.md.

Observability

ItemBehavior
LogsOne JSON line per event; warn and error to stderr, the rest to stdout; level set by LOG_LEVEL
/healthzReturns status and version
Container health checkROLE=worker checks only that the process is alive; other roles request http://127.0.0.1:${PORT}/healthz
Node stateOnline state, applied revision, data plane health, and origin health come from node_config_status and origin_health
Edit on GitHub

On this page