mirror of
https://github.com/Corfirean/coa-server-manager.git
synced 2026-11-11 03:51:01 +00:00
crates/coa-registry-proto (protocol 1: types, limits, signed-request canonicalisation, test vectors), services/coa-registry (axum + PostgreSQL, migrations, rate limits, Dockerfile, deploy files), services/coa-registry-e2e (Host lifecycle against the real service, live VPS gate), coa-core realm_registry (identity keys, client, publishing loop on its own thread), Settings -> Public listing card, docs REGISTRY_PROTOCOL.md and REGISTRY_DEPLOYMENT.md. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
24 lines
1.6 KiB
SQL
24 lines
1.6 KiB
SQL
-- Registry schema, migration 1. Forward-only: a released migration is never edited.
|
|
-- Discovery and presence data only. There is deliberately no table for players, characters, accounts, sessions or credentials.
|
|
CREATE TABLE realms (
|
|
realm_id uuid PRIMARY KEY,
|
|
public_key bytea NOT NULL CHECK (octet_length(public_key) = 32),
|
|
created_at timestamptz NOT NULL,
|
|
updated_at timestamptz NOT NULL,
|
|
last_seen_at timestamptz NOT NULL,
|
|
published boolean NOT NULL,
|
|
display_name text NOT NULL CHECK (char_length(display_name) BETWEEN 1 AND 80),
|
|
description text NOT NULL CHECK (octet_length(description) <= 1024),
|
|
language text NOT NULL CHECK (char_length(language) BETWEEN 2 AND 16),
|
|
ruleset text NOT NULL CHECK (ruleset IN ('coa', 'wildcard')),
|
|
manager_version text NOT NULL CHECK (char_length(manager_version) BETWEEN 1 AND 32),
|
|
capabilities jsonb NOT NULL CHECK (octet_length(capabilities::text) <= 65536),
|
|
capabilities_hash text NOT NULL CHECK (capabilities_hash ~ '^[0-9a-f]{64}$'),
|
|
metadata_revision bigint NOT NULL CHECK (metadata_revision >= 1),
|
|
-- the timestamp of the last signed request that was applied; the next one must be strictly later (replay protection)
|
|
last_request_ts bigint NOT NULL,
|
|
player_count integer CHECK (player_count BETWEEN 0 AND 100000),
|
|
player_capacity integer CHECK (player_capacity BETWEEN 0 AND 100000)
|
|
);
|
|
CREATE INDEX realms_published_seen ON realms (published, last_seen_at);
|