Access, Audit and Configuration
Authorization grants, the audit ledger, instance-wide settings and the global lease table the schedulers coordinate through.
Tables in this group: audit, certificate, ingress, lease, origin, permission, setting.
audit
Append-only trail of security-relevant operator actions (rows never updated or deleted, no updated_at), written by recordAudit after the action succeeded.
| Column | Type | Required | Description |
|---|---|---|---|
id | uuid | yes | Primary key (uuidv7(), time-ordered). |
created_at | timestamp(3) with time zone | yes | Row creation time. |
organization_id | uuid | no | Organization the action belongs to, which the org-scoped read filters on; null for an instance-wide action such as a superadmin editing an org-less forge. |
actor_user_id | uuid | no | User who acted, a plain id with no FK so it survives the account's deletion; null only for an action the platform took on nobody's behalf. |
actor_email | text | no | Actor's email denormalised at write time so the trail still names who acted after the account is deleted. |
action | text | yes | Dot-joined subject and verb from AUDIT_ACTIONS (such as server.delete, grant.create, organization.acme.set); a label only, not CHECKed so it can grow. |
target_type | text | yes | What the action was done to: organization, server, forge, or the entity_type of the grant being created or deleted. |
target_id | uuid | no | Id of the target row when there is one (server, forge, organization or grant entity); nullable and without an FK so the trail outlives the target. |
context | jsonb | no | Small non-secret JSON facts kept beside the action, such as purged, acmeEnabled, deployHooksEnabled or the grant details; never a credential. |
certificate
Uploaded control-plane certificate pair; several origin rows may reference one pair when its names cover them.
| Column | Type | Required | Description |
|---|---|---|---|
id | uuid | yes | Primary key (uuidv7(), time-ordered). |
created_at | timestamp(3) with time zone | yes | Row creation time. |
kind | text | yes | uploaded for an operator upload, acme-dns-01 for a pair the control plane issued itself over DNS-01; issued pairs are never listed as uploads. |
label | text | yes | Operator-chosen name for the uploaded pair, shown in the admin certificate list. |
cert_pem | text | yes | Public certificate PEM, chain allowed; the leaf is parsed for names and expiry when the pair is stored. |
key_pem | text | yes | Private key PEM sealed as a tpsecret envelope; the admin API never returns it. |
dns_names | jsonb | yes | JSON array of DNS names and IP addresses parsed from the leaf, used to test which hostnames the pair covers. |
not_after | timestamp(3) with time zone | yes | Leaf expiry copied from the parsed certificate when the pair is stored. |
ingress
One install-level provider account for the control plane's own names, used by edge modes for tunnels, DNS and certificates.
| Column | Type | Required | Description |
|---|---|---|---|
id | uuid | yes | Primary key (uuidv7(), time-ordered). |
created_at | timestamp(3) with time zone | yes | Row creation time. |
updated_at | timestamp(3) with time zone | yes | Last write time; the ORM sets it to now() on every update. |
created_by_user_id | uuid | no | Superadmin who added this account; NULL after that user is deleted. |
provider | text | yes | Provider of this account: cloudflare or bunny. |
label | text | yes | Operator-chosen name shown in the admin screens. |
account_id | text | no | Provider account id (for example the Cloudflare account); NULL when the provider has none. |
zone_ids | jsonb | yes | JSON array of provider zone ids this account may change, written by the superadmin who adds it. |
token_envelope | text | yes | Provider API token sealed as a tpsecret envelope; held inline because secret requires an organization, and never returned by the admin API. |
scopes | jsonb | no | Last preflight result written by the panel: whether the token can manage tunnels and DNS, and when it was checked. |
last_verified_at | timestamp(3) with time zone | no | When the panel last confirmed the token works; NULL until a check runs. |
last_error | text | no | Last provider error for this account; NULL when the last check succeeded. |
lease
Cross-isolate compare-and-swap lease: one row per name (plus organization for the billing lock) with an owner token and expires_at; four callers share it.
| Column | Type | Required | Description |
|---|---|---|---|
id | uuid | yes | Primary key (uuidv7(), time-ordered). |
created_at | timestamp(3) with time zone | yes | Row creation time. |
updated_at | timestamp(3) with time zone | yes | Last write time; the ORM sets it to now() on every update. |
organization_id | uuid | no | Null for the three global leases, set for the per-organization BILLING_QUANTITY_LOCK; unique with name under NULLS NOT DISTINCT so one global row per name. |
name | text | yes | Lease name: OFFLINE_SWEEP_LOCK, LEAF_RENEWAL_SWEEP_LOCK and REENCRYPT_SWEEP_LOCK are global, BILLING_QUANTITY_LOCK is per organization. |
owner | text | yes | Random UUID minted by the holder and checked on every steal or release; empty string plus expired expires_at is a release tombstone (offline, leaf). |
expires_at | timestamp(3) with time zone | yes | Moment the hold lapses and the row becomes stealable (TTL 60 s billing, 90 s offline sweep, 120 s leaf renewal and reencrypt); extended or reset by the holder. |
cursor | jsonb | no | Keyset resume point (notAfter, id) written only by the leaf-renewal sweep and compared on every steal with owner and expires_at; null elsewhere. |
origin
One control-plane public name operators publish, with its certificate source and any Let's Encrypt attempt state.
| Column | Type | Required | Description |
|---|---|---|---|
id | uuid | yes | Primary key (uuidv7(), time-ordered). |
created_at | timestamp(3) with time zone | yes | Row creation time. |
updated_at | timestamp(3) with time zone | yes | Last write time; the ORM sets it to now() on every update. |
uploaded_cert_id | uuid | no | Pair (certificate.id) this name serves: the upload when source is uploaded (required), or the issued pair when source is acme-dns-01; otherwise NULL. |
ingress_id | uuid | no | Parent ingress row (on delete set null). |
host | text | yes | Normalized public URL entry (origin, host, or host:port) in the form public URL parsing already stores. |
source | text | yes | Certificate source for this name: platform-ca, uploaded, acme-http-01 (Let's Encrypt over HTTP-01) or acme-dns-01 (Let's Encrypt over DNS-01). |
acme_last_attempt_at | timestamp(3) with time zone | no | When this instance last tried Let's Encrypt for this name; NULL until an attempt runs. |
acme_last_error | text | no | Last Let's Encrypt error for this name; NULL when the last attempt succeeded or none has run. |
not_after | timestamp(3) with time zone | no | Leaf expiry for this name when known; NULL for platform-ca and for Let's Encrypt before a leaf exists. |
mode | text | yes | How visitors reach this name: direct, lan-only, cloudflare-tunnel, cloudflare-proxy, bunny-proxy, private-overlay or passthrough. |
public_port | integer | yes | Port visitors use for this name (1 to 65535); the control plane itself always listens on 8443. |
ingress_state | jsonb | no | Provider state for this name, such as tunnel id, DNS record id and last status; the shape depends on mode and the provider writes it. |
acme_state | jsonb | no | DNS-01 order and renewal progress for an acme-dns-01 name (stage, attempts, retry and renewal times, alerts sent); holds no key or token, NULL otherwise. |
is_primary | boolean | yes | True for the one name used for links, sign-in callbacks and the default install URL; a partial unique index allows at most one row. |
is_daemon_dial | boolean | yes | Whether install commands and the daemon URL list may name this hostname; false keeps it for people only. |
permission
Allow-only ACL row: one positive grant of permission from a subject (actor_type, actor_id) on an entity; written by access routes, invitations, install.
| Column | Type | Required | Description |
|---|---|---|---|
id | uuid | yes | Primary key (uuidv7(), time-ordered). |
created_at | timestamp(3) with time zone | yes | Row creation time. |
actor_type | text | yes | Subject kind holding the grant: user, team or organization (SUBJECT_TYPES in src/client/authz/catalog.ts). |
actor_id | uuid | yes | Id of the subject row named by actor_type (a user, team or organization id); no FK because the referenced table varies. |
entity_type | text | yes | Kind of the entity granted on: a resource-tree kind or team (GRANT_ENTITY_TYPES); principal and repository are deliberately excluded. |
entity_id | uuid | yes | Id of the entity row named by entity_type; no FK because the referenced table varies, and ancestry is resolved from the domain tables at evaluation time. |
permission | text | yes | Grantable permission key: organization:own, organization:manage, team:own, team:manage, system:read or system:operate; never system:manage. |
setting
Instance-wide key/value store: one row per upper-case key with a JSON value, written by the settings resolvers, install state and the billing side-ledgers.
| Column | Type | Required | Description |
|---|---|---|---|
id | uuid | yes | Primary key (uuidv7(), time-ordered). |
created_at | timestamp(3) with time zone | yes | Row creation time. |
updated_at | timestamp(3) with time zone | yes | Last write time; the ORM sets it to now() on every update. |
key | text | yes | Unique upper-case key such as SYSTEM_EMAIL, SYSTEM_AUTH_PROVIDERS, IS_SIGNUP_ENABLED, or BILLING_PENDING_CHANGES: followed by an organization id. |
value | jsonb | yes | JSON value for the key (scalar, array or object); any secret inside it is stored only as a sealed tpsecret envelope, never in plaintext. |
Last updated on