chore: rename project quicnprotochat -> quicproquo (binaries: qpq)
Rename the entire workspace:
- Crate packages: quicnprotochat-{core,proto,server,client,gui,p2p,mobile} -> quicproquo-*
- Binary names: quicnprotochat -> qpq, quicnprotochat-server -> qpq-server,
quicnprotochat-gui -> qpq-gui
- Default files: *-state.bin -> qpq-state.bin, *-server.toml -> qpq-server.toml,
*.db -> qpq.db
- Environment variable prefix: QUICNPROTOCHAT_* -> QPQ_*
- App identifier: chat.quicnproto.gui -> chat.quicproquo.gui
- Proto package: quicnprotochat.bench -> quicproquo.bench
- All documentation, Docker, CI, and script references updated
HKDF domain-separation strings and P2P ALPN remain unchanged for
backward compatibility with existing encrypted state and wire protocol.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
47
crates/quicproquo-server/migrations/001_initial.sql
Normal file
47
crates/quicproquo-server/migrations/001_initial.sql
Normal file
@@ -0,0 +1,47 @@
|
||||
CREATE TABLE IF NOT EXISTS key_packages (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
identity_key BLOB NOT NULL,
|
||||
package_data BLOB NOT NULL,
|
||||
created_at INTEGER DEFAULT (strftime('%s','now'))
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS deliveries (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
recipient_key BLOB NOT NULL,
|
||||
channel_id BLOB NOT NULL DEFAULT X'',
|
||||
payload BLOB NOT NULL,
|
||||
created_at INTEGER DEFAULT (strftime('%s','now'))
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS hybrid_keys (
|
||||
identity_key BLOB PRIMARY KEY,
|
||||
hybrid_public_key BLOB NOT NULL
|
||||
);
|
||||
|
||||
CREATE INDEX IF NOT EXISTS idx_kp_identity
|
||||
ON key_packages(identity_key);
|
||||
|
||||
CREATE INDEX IF NOT EXISTS idx_del_recipient_channel
|
||||
ON deliveries(recipient_key, channel_id);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS server_setup (
|
||||
id INTEGER PRIMARY KEY CHECK (id = 1),
|
||||
setup_data BLOB NOT NULL
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS users (
|
||||
username TEXT PRIMARY KEY,
|
||||
opaque_record BLOB NOT NULL,
|
||||
created_at INTEGER DEFAULT (strftime('%s','now'))
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS user_identity_keys (
|
||||
username TEXT PRIMARY KEY,
|
||||
identity_key BLOB NOT NULL
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS endpoints (
|
||||
identity_key BLOB PRIMARY KEY,
|
||||
node_addr BLOB NOT NULL,
|
||||
updated_at INTEGER DEFAULT (strftime('%s','now'))
|
||||
);
|
||||
21
crates/quicproquo-server/migrations/002_add_seq.sql
Normal file
21
crates/quicproquo-server/migrations/002_add_seq.sql
Normal file
@@ -0,0 +1,21 @@
|
||||
-- Migration 002: add per-inbox delivery sequence numbers.
|
||||
--
|
||||
-- Adds a `seq` column to the deliveries table and a separate counter table
|
||||
-- that tracks the next sequence number per (recipient_key, channel_id) inbox.
|
||||
-- The counter is atomically incremented on each enqueue via an UPSERT so
|
||||
-- sequence numbers are gapless even under concurrent inserts.
|
||||
--
|
||||
-- Requires SQLite >= 3.35 (RETURNING clause support; available on Ubuntu 22.04+).
|
||||
|
||||
ALTER TABLE deliveries ADD COLUMN seq INTEGER NOT NULL DEFAULT 0;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS delivery_seq_counters (
|
||||
recipient_key BLOB NOT NULL,
|
||||
channel_id BLOB NOT NULL,
|
||||
next_seq INTEGER NOT NULL DEFAULT 0,
|
||||
PRIMARY KEY (recipient_key, channel_id)
|
||||
);
|
||||
|
||||
-- Index lets ORDER BY seq queries use an index scan instead of a sort.
|
||||
CREATE INDEX IF NOT EXISTS idx_del_seq
|
||||
ON deliveries (recipient_key, channel_id, seq);
|
||||
13
crates/quicproquo-server/migrations/003_channels.sql
Normal file
13
crates/quicproquo-server/migrations/003_channels.sql
Normal file
@@ -0,0 +1,13 @@
|
||||
-- Migration 003: 1:1 DM channels.
|
||||
-- channel_id is 16 bytes (UUID); member_a and member_b are identity keys in sorted order.
|
||||
-- Unique on (member_a, member_b) prevents duplicate channels between the same pair.
|
||||
|
||||
CREATE TABLE IF NOT EXISTS channels (
|
||||
channel_id BLOB PRIMARY KEY,
|
||||
member_a BLOB NOT NULL,
|
||||
member_b BLOB NOT NULL,
|
||||
UNIQUE(member_a, member_b)
|
||||
);
|
||||
|
||||
CREATE INDEX IF NOT EXISTS idx_channels_members
|
||||
ON channels(member_a, member_b);
|
||||
16
crates/quicproquo-server/migrations/004_federation.sql
Normal file
16
crates/quicproquo-server/migrations/004_federation.sql
Normal file
@@ -0,0 +1,16 @@
|
||||
-- 004_federation.sql: Federation support tables.
|
||||
|
||||
-- Map identity keys to their home server domain.
|
||||
-- Used for routing: if a recipient's home_server != local domain, relay via federation.
|
||||
CREATE TABLE IF NOT EXISTS identity_home_servers (
|
||||
identity_key BLOB PRIMARY KEY,
|
||||
home_server TEXT NOT NULL,
|
||||
updated_at INTEGER NOT NULL
|
||||
);
|
||||
|
||||
-- Known federation peers (other quicnprotochat servers).
|
||||
CREATE TABLE IF NOT EXISTS federation_peers (
|
||||
domain TEXT PRIMARY KEY,
|
||||
last_seen INTEGER NOT NULL,
|
||||
is_active INTEGER NOT NULL DEFAULT 1
|
||||
);
|
||||
Reference in New Issue
Block a user