TurboPanel Docs
Database

Networking

Datacenters as logical routing domains, the org network registry, managed addresses, and the TurboFabric mesh (fabric, relays, subnets).

Tables on this page: datacenter · fabric · ip · network · relay · subnet. Generated from migration 0004_schema_comments; see How to read this.

datacenter

Logical routing domain (not a building) of mutually routable private subnets, operator-created per org; a server may belong to zero or many via ip pins.

ColumnTypeNullDefaultDescription
id (PK)uuidnouuidv7()Primary key (uuidv7(), time-ordered).
created_attimestamp(3) with time zonenonow()Row creation time.
updated_attimestamp(3) with time zonenonow()Last write time; the ORM sets it to now() on every update.
metadatajsonbyesFree-form jsonb returned by the datacenter API; no control-plane code path writes or interprets any key on it today.
optionsjsonbyesOperator policy jsonb: priority (0..1000, lower wins, default 100), trusted (default true), addressPreference, sshPort, ntp, timezone defaults.
organization_iduuidnoFK → organization.id (on delete cascade).
nametextyesOperator-chosen display name; also seeded onto the site network row created together with the datacenter.
descriptiontextyesOptional operator free-text note about the datacenter.

Constraints and indexes

  • Index idx_datacenter_organization_id: (organization_id)

fabric

Org TurboFabric WireGuard mesh (host interface tp0), at most one row per organization; absence means TurboFabric is off and private keys are never stored.

ColumnTypeNullDefaultDescription
id (PK)uuidnouuidv7()Primary key (uuidv7(), time-ordered).
created_attimestamp(3) with time zonenonow()Row creation time.
updated_attimestamp(3) with time zonenonow()Last write time; the ORM sets it to now() on every update.
metadatajsonbyesFree-form jsonb; no control-plane code path writes or reads it today.
optionsjsonbyesMesh policy jsonb: containerPool (relay prefix pool, default 10.192.0.0/12), listenPort (default 51821), mtu (1280..9000, default 1420), allowRelay.
organization_iduuidnoFK → organization.id (on delete cascade).
cidrcidrnoHost tp0 address range that relay address values are carved from, auto-picked at enable to avoid every occupied org range (default 10.250.0.0/16).
nametextyesOptional display name (1..255 chars of letters, digits, space, dot, underscore, dash); no control-plane code path writes it today.

Constraints and indexes

  • Unique index uniq_fabric_organization_id: (organization_id)
  • Index idx_fabric_organization_id: (organization_id)
  • Check fabric_name_format_check: (name IS NULL) OR (((char_length((name)::text) >= 1) AND (char_length((name)::text) <= 255)) AND ((name)::text ~ '^[A-Za-z0-9 ._-]+$'::text))

ip

Single registry of every managed address per org, one row per address: public VPS addresses, datacenter free-pool rows and per-server membership pins.

ColumnTypeNullDefaultDescription
id (PK)uuidnouuidv7()Primary key (uuidv7(), time-ordered).
created_attimestamp(3) with time zonenonow()Row creation time.
updated_attimestamp(3) with time zonenonow()Last write time; the ORM sets it to now() on every update.
metadatajsonbyesPin markers written by the automatic repin pass: repin (at, from = previous address) and stale (since, reason) when no clear replacement exists.
optionsjsonbyesFree-form jsonb accepted on address create and echoed by the API; no control-plane code path interprets any key on it.
organization_iduuidnoFK → organization.id (on delete cascade).
datacenter_iduuidyesFK → datacenter.id (on delete cascade). Datacenter this address belongs to; required when scope = 'datacenter', null on public addresses; rows cascade away when the datacenter is deleted.
network_iduuidyesFK → network.id (on delete set null). Site subnet the address sits in; required on a membership pin (scope = 'datacenter' plus server_id), null on public and free-pool rows, set null on delete.
server_iduuidyesFK → server.id (on delete restrict). Server holding this address; null marks a datacenter free-pool row, non-null together with datacenter_id makes a membership pin; server delete is restricted.
addressinetnoIPv4 or IPv6 address (inet, unique per organization); the family is derived from it, not stored; immutable after create except via the automatic repin pass.
allocationtextnoOperator-chosen consumer model, dedicated (one consumer) or shared; immutable after create, and pins made by the datacenter routes are always dedicated.
scopetextnoReachability class, public (world-reachable) or datacenter (inside one of the org's site subnets, datacenter_id required); immutable after create.
descriptiontextyesOptional operator note and the only editable field on an address; addresses are identified by address, never named.
repin_pending_fanout_attimestamp(3) with time zoneyesSet by the automatic repin apply pass when a pin moved address, cleared by the maintenance sweep once the routing fan-out was enqueued; null = nothing pending.

Constraints and indexes

  • Index idx_ip_organization_id: (organization_id)
  • Index idx_ip_datacenter_id: (datacenter_id)
  • Index idx_ip_network_id: (network_id)
  • Index idx_ip_server_id: (server_id)
  • Index idx_ip_scope_server_datacenter: (scope, server_id, datacenter_id)
  • Index idx_ip_repin_pending_fanout_at: (repin_pending_fanout_at) where "ip"."repin_pending_fanout_at" IS NOT NULL
  • Unique index uniq_ip_org_address: (organization_id, address)
  • Check ip_allocation_check: allocation IN ('dedicated', 'shared')
  • Check ip_scope_check: scope IN ('public', 'datacenter')
  • Check ip_datacenter_scope_check: ("ip"."scope" <> 'datacenter') OR ("ip"."datacenter_id" IS NOT NULL)
  • Check ip_datacenter_anchor_check: ( "ip"."datacenter_id" IS NULL OR ("ip"."server_id" IS NULL AND "ip"."network_id" IS NULL) OR "ip"."server_id" IS NOT NULL )
  • Check ip_datacenter_member_network_check: ( "ip"."scope" <> 'datacenter' OR "ip"."server_id" IS NULL OR "ip"."network_id" IS NOT NULL )

network

Org-owned network registry row of kind datacenter, docker, compose, managed or reserved; which scope FKs and cidr may be set is fixed per kind by a CHECK.

ColumnTypeNullDefaultDescription
id (PK)uuidnouuidv7()Primary key (uuidv7(), time-ordered).
created_attimestamp(3) with time zonenonow()Row creation time.
updated_attimestamp(3) with time zonenonow()Last write time; the ORM sets it to now() on every update.
metadatajsonbyesFree-form jsonb; the only reader is a legacy fallback that accepts metadata.dockerNetworkName when options lacks it, and nothing writes it today.
optionsjsonbyesKind-specific jsonb: dockerNetworkName plus optional subnet, ipRange, gateway, mtu on docker rows; dockerNetworkName (row UUID) on compose/managed.
organization_iduuidnoFK → organization.id (on delete cascade).
datacenter_iduuidyesFK → datacenter.id (on delete restrict). Owning datacenter, required and only allowed on kind = 'datacenter' site CIDR rows (a datacenter may own several); datacenter delete is restricted meanwhile.
server_iduuidyesFK → server.id (on delete restrict). Optional host pin allowed only on kind = 'docker' external Docker registrations (null = org-wide); every other kind must leave it null.
environment_iduuidyesFK → environment.id (on delete set null). Optional environment pin for kind = 'compose' spanning networks (null = org-shared); set null when the environment is deleted so the row survives.
kindtextnoRow kind: datacenter (site CIDR), docker (external Docker network), compose (TurboFabric spanning network), managed (one per org) or reserved.
cidrcidryesRegistered range: required on datacenter and reserved rows, mirrored from options.subnet on docker rows, null on managed; checked for collisions.
namevarchar(255)yesDisplay name; operator-set on docker and reserved rows, seeded from the datacenter name on site rows, and the Compose network key on compose rows.
compose_keytextyesCompose network key from the environment's document on kind = 'compose' rows (unique per environment), written by ensureComposeNetworkRow; null otherwise.

Constraints and indexes

  • Index idx_network_server_id: (server_id)
  • Index idx_network_organization_id: (organization_id)
  • Index idx_network_datacenter_id: (datacenter_id)
  • Index idx_network_environment_id: (environment_id)
  • Unique index uniq_network_datacenter_cidr: (datacenter_id, cidr) where "network"."kind" = 'datacenter'
  • Unique index uniq_network_organization_managed: (organization_id) where "network"."kind" = 'managed'
  • Unique index uniq_network_environment_compose_key: (environment_id, compose_key) where "network"."kind" = 'compose'
  • Check network_kind_check: kind IN ('datacenter', 'docker', 'compose', 'managed', 'reserved')
  • Check network_single_scope_check: ( ("network"."kind" = 'datacenter' AND "network"."datacenter_id" IS NOT NULL AND "network"."server_id" IS NULL AND "network"."environment_id" IS NULL AND "network"."cidr" IS NOT NULL) OR ("network"."kind" = 'docker' AND "network"."datacenter_id" IS NULL AND "network"."environment_id" IS NULL) OR ("network"."kind" = 'compose' AND "network"."datacenter_id" IS NULL AND "network"."server_id" IS NULL) OR ("network"."kind" = 'managed' AND "network"."datacenter_id" IS NULL AND "network"."server_id" IS NULL AND "network"."environment_id" IS NULL AND "network"."cidr" IS NULL) OR ("network"."kind" = 'reserved' AND "network"."datacenter_id" IS NULL AND "network"."server_id" IS NULL AND "network"."environment_id" IS NULL AND "network"."cidr" IS NOT NULL) )
  • Check network_name_format_check: (name IS NULL) OR (((char_length((name)::text) >= 1) AND (char_length((name)::text) <= 255)) AND ((name)::text ~ '^[A-Za-z0-9 ._-]+$'::text))

relay

One server's membership in an org TurboFabric mesh (one row per fabric and server), allocated by ensureFabricRelays; holds its tp0 address and peer config.

ColumnTypeNullDefaultDescription
id (PK)uuidnouuidv7()Primary key (uuidv7(), time-ordered).
created_attimestamp(3) with time zonenonow()Row creation time.
updated_attimestamp(3) with time zonenonow()Last write time; the ORM sets it to now() on every update.
metadatajsonbyesControl-plane reconcile stamps: appliedPayloadHash, appliedAt, observed (peers the daemon saw) and diagnostics-only paths (selected path per peer).
optionsjsonbyesRelay policy jsonb merged by PATCH: allowRelay (true or false, null inherits the org and may only tighten) and preferredGatewayIds (ordered, deduped).
fabric_iduuidnoFK → fabric.id (on delete cascade).
server_iduuidnoFK → server.id (on delete restrict). Member server, unique per fabric; delete is restricted, so deleteServerFabricMembership must remove the relay and its subnets first.
addressinetnoAllocated tp0 host address (inet) carved from fabric.cidr, unique per fabric and rendered as a /32 host route in peer AllowedIPs.
roletextno'member'Mesh role, gateway (advertises advertised_cidrs to remote peers, must belong to a datacenter with a subnet) or member (host route only, the default).
keepaliveintegeryesOperator WireGuard PersistentKeepalive in seconds (1..65535); null means auto, which is 25 s on direct_nat paths and none otherwise.
endpoint_addressinetyesOperator endpoint override (inet, no port); null means the path planner derives the endpoint from datacenter, public and daemon-reported addresses.
public_keytextyesServer's WireGuard public key, stamped by the control plane from the first successful server.fabric.reconcile result; null until then, unique per fabric.
prefixcidrnoContainer aggregate CIDR (a /16 from fabric.options.containerPool) allocated to this server and forwarded over tp0; per-network subnets are carved from it.
advertised_cidrscidr[]no'{}'::cidr[]Operator-configured LAN CIDRs a gateway relay advertises to remote peers (native cidr[], host bits cleared); must be empty when role = 'member'.
preshared_keytextyesSealed tpsecret envelope of the operator-set WireGuard preshared key; write-only, never returned by the API, resealed for the daemon at reconcile.

Constraints and indexes

  • Unique relay_fabric_server_unique: (fabric_id, server_id)
  • Unique uniq_relay_fabric_address: (fabric_id, address)
  • Unique uniq_relay_fabric_public_key: (fabric_id, public_key)
  • Index idx_relay_fabric_id: (fabric_id)
  • Index idx_relay_server_id: (server_id)
  • Check relay_role_check: role IN ('gateway', 'member')
  • Check relay_keepalive_check: "relay"."keepalive" IS NULL OR ("relay"."keepalive" BETWEEN 1 AND 65535)
  • Check relay_member_advertised_cidrs_empty_check: "relay"."role" <> 'member' OR cardinality("relay"."advertised_cidrs") = 0

subnet

Per-server realization of a kind = 'compose' spanning network, one row per network and server, written by ensureNetworkSubnet when spanning networks build.

ColumnTypeNullDefaultDescription
id (PK)uuidnouuidv7()Primary key (uuidv7(), time-ordered).
created_attimestamp(3) with time zonenonow()Row creation time.
updated_attimestamp(3) with time zonenonow()Last write time; the ORM sets it to now() on every update.
metadatajsonbyesFree-form jsonb; no control-plane code path writes or reads it today.
optionsjsonbyesOptional segment extras read by parseSegmentNetworkExtras when rendering the Docker bridge: mtu (1280..9000) and an IPv4 gateway; no writer found today.
network_iduuidnoFK → network.id (on delete cascade). Spanning network (kind = 'compose' row) this per-server subnet realizes, unique together with server_id; rows cascade away with the network.
server_iduuidnoFK → server.id (on delete restrict). Server hosting this segment; delete is restricted, so deleteServerFabricMembership removes the subnets first.
cidrcidrnoServer-local Docker bridge subnet for the network, the lowest free /24 carved from the server's relay.prefix around org exclusions by requireSubnetCidr.

Constraints and indexes

  • Unique subnet_network_server_unique: (network_id, server_id)
  • Index idx_subnet_network_id: (network_id)
  • Index idx_subnet_server_id: (server_id)
Edit on GitHub

Last updated on

On this page