chore(server): checkpoint deployed services and unfinished forums
User requested a checkpoint and stopped all agents. Deployed artifacts remain the last verified releases; unfinished settings/categories/forums are preserved as WIP. See TODO/roadmap for verification and remaining release/updater work.
This commit is contained in:
parent
d6d406bbf5
commit
c18ccadf99
96 changed files with 8665 additions and 276 deletions
|
|
@ -3,10 +3,18 @@
|
|||
This file describes what the repository actually does today.
|
||||
Protocol and security docs may describe future phases. When in doubt, trust this file.
|
||||
|
||||
Last updated: 2026-10-24.
|
||||
Last updated: 2026-10-25.
|
||||
|
||||
---
|
||||
|
||||
## Update 2026-10-25 (Hub profile API)
|
||||
|
||||
- `PUT /v1/account/profile`: authenticated, CSRF-protected handle selection and display-name editing. Handles are case-insensitive, unique and permanent once selected.
|
||||
- `user.profile_complete` is returned in session and login responses. Existing generated handles remain incomplete until explicitly selected by their owners.
|
||||
- Migration `0006_account_profile.sql` preserves account IDs, provider bindings, sessions and avatars. It adds a case-insensitive unique handle index; conflicting manually inserted legacy handles cause migration failure rather than reassignment.
|
||||
- This is server API support. Browser onboarding, desktop authorization/device enrollment, avatar synchronization to community members and mandatory Hub identity at gateways remain unfinished.
|
||||
- Code availability does not imply production deployment. See [Hub API contract](../hub/AUTH.md).
|
||||
|
||||
## Update 2026-10 (LNEx v3, TLS 1.3)
|
||||
|
||||
- TCP control plane is TLS 1.3 only (rustls); the custom X25519/HKDF/ChaCha20 TCP layer was removed (**breaking**, protocol `v3`). See [02-protocol/tls.md](02-protocol/tls.md).
|
||||
|
|
@ -15,11 +23,11 @@ Last updated: 2026-10-24.
|
|||
|
||||
## Update 2026-10 (protocol v2)
|
||||
|
||||
- Signed v2 handshake and protobuf payloads between client and gateway (verified by `VNOX-Client/tests/gateway_interop.rs`).
|
||||
- Protobuf payloads between client and gateway (the historical v2 handshake has since been replaced by v3) (verified by `VNOX-Client/tests/gateway_interop.rs`).
|
||||
- Authenticated, encrypted UDP voice relay in voice-node.
|
||||
- Voice access is revoked when a channel is deleted, a member is kicked or permissions change.
|
||||
- Senders get acknowledgements for their own chat messages.
|
||||
- Hub email sign-in by one-time code (HMAC-protected, rate-limited; enabled only when SMTP is configured; code-ready, not yet enabled in production). Handle selection after first sign-in is not implemented.
|
||||
- Hub email sign-in by one-time code (HMAC-protected, rate-limited; enabled only when SMTP is configured; code-ready, not yet enabled in production). Handle selection is now available through the profile API; onboarding UI is not implemented.
|
||||
- Hub own avatar (web): upload, remove and public serving of a re-encoded 256x256 PNG; code-ready, not deployed. Backup rotation to 30 days for deleted data is decided but not implemented.
|
||||
- Channel webhooks, GitHub sign-in, hub service, screen sharing and media broadcast.
|
||||
- `cargo audit`: no known vulnerabilities in both workspaces (2026-10-24).
|
||||
|
|
@ -30,7 +38,7 @@ Last updated: 2026-10-24.
|
|||
|
||||
- **Gateway (TCP):** Ed25519 client auth, sessions, channel join/leave, text chat, SQLite history, guilds, roles, permissions, invites, audit log, rate limiting.
|
||||
- **Gateway (HTTP admin):** `GET /health`, `GET /version`, `GET /metrics` (Prometheus exposition). Default bind 0.0.0.0:7601.
|
||||
- **Voice node (UDP):** relay between clients in the same channel; members expire after 30 s idle; jitter buffer wired into relay path.
|
||||
- **Voice node (UDP):** relay between clients in the same channel; members expire after 30 s idle (clients maintain registration with encrypted keepalives); jitter buffer wired into relay path.
|
||||
- **Client:** connect UI, channel list, text chat, net layer, voice capture/playback wired to UI, friends/DM panel, guild bar with create + invite-accept popups, right-side member list panel, message context menu (react/edit/delete/reply/copy), custom status + activity status, block list, channel create UI, encrypted identity vault.
|
||||
- **Server identity:** gateway generates or loads `server_identity.json` in the configured data directory.
|
||||
- **UI refactoring:** modular structure (`app/`, `chat/`, `connect/`, `sidebar/`, `members/`, `state/`, `settings/`).
|
||||
|
|
@ -71,24 +79,24 @@ Last updated: 2026-10-24.
|
|||
| Federation crate | Stub only (`// TODO`). |
|
||||
| RNNoise | Feature-gated, no-op stub by default. Enable with `--features rnnoise`. |
|
||||
| Slint migration | Done. The client UI is Slint (RU/EN localization, themes, settings). |
|
||||
| Server-side channel creation | Client-side channels work locally; gateway still needs `ChannelCreate` packet + storage (Phase 2). |
|
||||
| Server-side channel management | Gateway create/edit/delete handlers exist, with guild authorization and storage. See `gateway/src/handler/channel/`. |
|
||||
| Identity export/import UI | Vault API is ready (`identity::save(identity, Some(passphrase))`), but no UI modal yet. |
|
||||
|
||||
---
|
||||
|
||||
## Specified in docs, not implemented yet
|
||||
## Implementation status of planned features
|
||||
|
||||
| Feature | Target phase |
|
||||
|---------|--------------|
|
||||
| Seed phrase / encrypted keyfile export UI | Phase 2 |
|
||||
| Gateway to voice-node membership signaling | Phase 2 |
|
||||
| Protobuf payloads (replacing JSON) | Phase 2 |
|
||||
| Gateway to voice-node membership signaling | In-process bridge implemented in `serverd`; separate-process signaling remains unfinished. Standalone voice-node is fail-closed. |
|
||||
| Protobuf payloads (replacing JSON) | Implemented; LNEx v3 uses protobuf over TLS 1.3. |
|
||||
| `/health` HTTP endpoint on gateway | ✅ DONE |
|
||||
| Rate limiting | ✅ DONE |
|
||||
| Prometheus metrics | ✅ DONE |
|
||||
| Identity keypair encryption at rest (Argon2id passphrase) | ✅ DONE |
|
||||
| Published Docker images (`ghcr.io/vnox/...`) | Not published yet |
|
||||
| Server-side channel create/edit/delete | Phase 2 |
|
||||
| Server-side channel create/edit/delete | Implemented; further permission changes need regression tests. |
|
||||
| Federation protocol spec | Phase 3 |
|
||||
|
||||
---
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ encryption, routing, identity, and federation.
|
|||
|
||||
## Version
|
||||
|
||||
Current version: `LNEx v3` (TCP runs inside TLS 1.3, see [tls.md](tls.md)). There is no negotiation with older versions.
|
||||
Current version: `LNEx v4` (TCP runs inside TLS 1.3 and requires a Central account proof; see [tls.md](tls.md) and [central-account.md](central-account.md)). There is no negotiation with older versions.
|
||||
|
||||
Version is negotiated during handshake. Clients and servers advertise
|
||||
their supported versions. If no common version exists, the connection
|
||||
|
|
@ -83,4 +83,4 @@ Full state machine: see individual spec files.
|
|||
- [federation/README.md](federation/README.md) — node discovery, cross-node routing
|
||||
- [identity.md](identity.md) — keypair model, auth flow, permissions
|
||||
- [security.md](security.md) — encryption, threat model
|
||||
- [tls.md](tls.md) — TLS 1.3 control plane, trust model, LNEx v3 handshake
|
||||
- [tls.md](tls.md) — TLS 1.3 control plane, trust model, LNEx v4 handshake
|
||||
|
|
|
|||
54
docs/02-protocol/account-presence.md
Normal file
54
docs/02-protocol/account-presence.md
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
# Account presence and profiles
|
||||
|
||||
LNEx v4 additive metadata: MemberInfo fields 4 account_id and 5 avatar_url; UserJoin fields 4 account_id and 5 avatar_url. user_id remains the authenticated Ed25519 device key, never an account UUID. Channel memberships and UDP routes retain their session IDs. Snapshots include each device once; repeated sessions on the same device emit UserLeave only after the last subscription leaves. Presence OFFLINE is emitted only after the last session of that device closes. Clients group member rows by nonempty account_id while retaining all device IDs for voice attribution, and remove only the leaving device.
|
||||
|
||||
Central v1 signed proof claims optionally include display_name and avatar_url. Names are bounded to 64 characters; avatar URLs are relative /v1/avatars/ paths, resolved only against https://central.loki-code.dev. Gateway ignores unsigned client nickname when a signed profile exists. Missing optional fields retain compatibility with existing proofs. Avatar HTTP requests have no auth/cookies, reject redirects, bound response and dimensions, and execute outside the UI thread. Default avatar paths use the authenticated account UUID. No database migration, ownership reassignment or protocol version change is required.
|
||||
|
||||
## Desktop avatar mutation and live summary refresh
|
||||
|
||||
`POST /v1/auth/desktop/avatar` uploads a cropped raw PNG (image/png, at most 2 MiB); `DELETE` on the same path uses an empty body. Both use Authorization: Bearer <desktop refresh secret>, X-Vnox-Public-Key (lowercase Ed25519 hex), X-Vnox-Timestamp (Unix seconds), and X-Vnox-Signature (hex Ed25519). Signature bytes cover `VNOX-CENTRAL-PROFILE-v1\0` followed by method ASCII, NUL, request path ASCII, NUL, decimal timestamp ASCII, NUL, then SHA-256(raw body). Timestamp skew is bounded to 60 seconds. Hub verifies the active unexpired enrollment matches the supplied key and account; cookies are never used. Replays within that window repeat the identical idempotent image/delete mutation. Existing avatar normalization, per-account/per-source budgets, bounded decoding and immutable content IDs apply. Success returns `{user: AccountSummary}` with effective same-origin avatar path. No schema migration is required.
|
||||
|
||||
Desktop refresh responses already return `user`; clients now validate subject consistency, atomically persist it only if the same enrollment remains active, and publish a non-secret profile update to UI. Admission, startup, periodic refresh and opening profile settings obtain current Central data. Mutation results use the same update path. Late network results cannot restore credentials or avatars after sign-out. Public PNG requests remain separate and never carry enrollment headers.
|
||||
|
||||
`POST /v1/auth/desktop/profile` uses the same enrollment headers and signature (including its distinct path) with JSON `{display_name: string}` limited to 1024 bytes. The trimmed name must contain 1–64 characters and no control/bidi override characters. Only existing accounts.display_name changes; handle, account UUID, device ID, roles and profile_complete remain unchanged. Account/source profile rate limits apply. Success returns `{user: AccountSummary}` and clients persist/publish it exactly like avatar changes. Signed proofs carry the new display name on admission and through the additive live update described below. No protocol version change is introduced.
|
||||
|
||||
## Live signed profile updates
|
||||
|
||||
LNEx v4 additive packets: `0x0042 ProfileUpdate { bytes account_proof = 1; }` (client to gateway), `0x0043 ProfileUpdated { string user_id = 1; string account_id = 2; string nickname = 3; string avatar_url = 4; int64 issued_at = 5; }` (gateway to client). Gateway verifies the Central issuer signature, lifetime, audience and device binding exactly as admission, and requires the subject to equal the current session account. Display name and avatar must be valid signed profile claims. No client-supplied unsigned nickname/avatar is accepted. Existing Ed25519 device keys, channel/session membership, ownership, permissions and UDP credentials stay unchanged.
|
||||
|
||||
The newest accepted issued_at among active sessions of an account prevents older proofs downgrading metadata. Equal-second proofs are accepted (Central proof timestamp resolution is one second); same-second cosmetic ordering is last-arrival. This is transient display metadata, not authorization. Gateway updates profile fields on account sessions and emits each affected device's ProfileUpdated only to its own sessions or peers currently sharing its text/voice channel. Delivery rechecks that visibility; no node-wide profile broadcast or join/leave event is generated.
|
||||
|
||||
Desktop forwards the proof obtained by its existing Central refresh; profile-only mutation notifications trigger one coalesced background refresh, not a refresh loop. Before chat/image send or channel/voice join, a proof older than five seconds causes those actions to wait for one bounded refresh; audio/UDP, incoming packets and keepalives continue. ProfileUpdate is written before the actions on the same TCP stream. A failed Central refresh leaves the gateway/voice session active, reports failure, and sends the action with its last verified profile. Opening settings and periodic refresh also propagate signed updates live. No reconnect is required.
|
||||
|
||||
## Registration display names and web onboarding
|
||||
|
||||
New accounts receive one locally generated friendly Russian word plus `_` and four
|
||||
cryptographically random decimal digits. Neither email local parts nor GitHub names
|
||||
become public defaults. Existing account names and immutable handle selection are
|
||||
unchanged. Word data and its license ship with Hub; no network lookup occurs during
|
||||
registration.
|
||||
|
||||
Migration 0009 adds an independent account_onboarding table. Only newly created
|
||||
accounts receive pending rows; existing accounts do not acquire a prompt. Session
|
||||
responses add optional top-level onboarding_pending. POST /v1/account/onboarding
|
||||
accepts {decision:"rename"|"later"}, records an explicit choice once, and never
|
||||
changes handle/name. POST /v1/account/display-name accepts {display_name:string},
|
||||
updates only the existing display_name column, resolves a pending prompt as an
|
||||
explicit rename, and returns {display_name,onboarding_pending:false}. Both routes
|
||||
require the same own-origin cookie session and CSRF protection as avatar changes,
|
||||
small JSON bodies, and per-account/source profile budgets. They do not depend on
|
||||
pending migration 0006 or require LNEx changes.
|
||||
|
||||
## Explicit node administrator capability
|
||||
|
||||
Node operators may set `[gateway] admin_account_ids = ["<Central account UUID>"]`. The default empty list grants nobody node administration. Startup rejects invalid/nil UUIDs, duplicates and more than 256 entries. Only the verified Central subject on the authenticated Session is compared with this list; nickname and device public key never confer this role. This is a static operator setting, applied on daemon restart/admission, not first-visitor ownership.
|
||||
|
||||
Session gains additive `bool node_admin = 4`, advertising global channel management capability to clients. A listed account may create, rename and delete global (guild_id absent) channels; its other admitted devices receive the same capability. `general` and `voice` remain undeletable bootstrap IDs. Guild ownership/membership/role checks remain unchanged: node administrator status cannot create/edit/delete another guild's channels or bypass voice access. Server checks actual stored channel scope for edit/delete, never a client claim. Clients expose global management controls only for advertised capability and still handle gateway denial.
|
||||
|
||||
Global channel metadata changes are visible to all authenticated node sessions; guild metadata remains restricted to persisted guild members. Created/renamed channels are persisted through the existing storage bootstrap path. No database/protocol version migration is required.
|
||||
|
||||
Deferred activity is scoped to one TCP session, limited to 32 actions and 4 MiB total contents. Duplicate joins coalesce. Explicit leave cancels matching deferred activity; disconnect/server switch clears it, and session scope drop aborts the HTTP refresh task. Nothing is replayed into another node or session.
|
||||
|
||||
### Gateway capability negotiation
|
||||
|
||||
Session field 5 `bool live_profiles` is true on gateways supporting packets 0x0042/0x0043. Absent/false on older LNEx v4 gateways: desktop must not send ProfileUpdate, start activity-triggered profile HTTP refresh, or defer chat/image/join for it. Normal existing activity packets continue directly. The local Central profile UI can still refresh independently. This explicit opt-in preserves additive compatibility with older v4 gateways that reject unknown packet IDs.
|
||||
48
docs/02-protocol/central-account.md
Normal file
48
docs/02-protocol/central-account.md
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
# LNEx v4: mandatory Central account admission
|
||||
|
||||
LNEx v4 requires a Central account proof in AUTH (field 6, `bytes account_proof`).
|
||||
There is no anonymous or private-mode exemption. v3 clients and gateways must be
|
||||
upgraded together. TLS 1.3 and existing channel-bound Ed25519 signatures remain;
|
||||
v4 changes their domain separator from `VNOX-LNEx-v3-` to `VNOX-LNEx-v4-`.
|
||||
|
||||
The proof is UTF-8 JSON `{ "claims": "<hex>", "signature": "<hex>" }`.
|
||||
Claims are the exact UTF-8 JSON bytes (hex encoded), containing `version` (1),
|
||||
`issuer` (Hub issuer UUID), `subject` (Central account UUID), `public_key` (lowercase
|
||||
hex desktop Ed25519 key), `issued_at` and `expires_at` (Unix seconds), and
|
||||
`audience` (`vnox-gateway`). The Hub Ed25519 signature covers the bytes
|
||||
`VNOX-CENTRAL-ACCOUNT-v1\0` followed by the decoded claims. Gateways use explicitly
|
||||
configured trusted issuer UUID/public key, never keys supplied by clients or
|
||||
fetched from arbitrary URLs. They reject missing, malformed, expired, future,
|
||||
overlong-lived (>600 seconds), wrong-audience, unknown-issuer and incorrectly
|
||||
signed proofs, and require the subject key to equal AUTH's client public key.
|
||||
AUTH's channel-bound signature includes the proof. Gateways verify before storage
|
||||
or session creation. Proofs authorize new admission for ten minutes; revoking a
|
||||
device stops refresh immediately, while already issued proofs expire naturally.
|
||||
Existing gateway session timeout remains independent of the admission proof.
|
||||
|
||||
## Browser device authorization
|
||||
|
||||
Desktop POSTs `/v1/auth/desktop/start` with only its public key. The Hub returns a
|
||||
256-bit device secret, separate random user code, expiry (600 seconds), and a
|
||||
same-origin browser URL `/desktop?code=...`. Only the user code enters the browser;
|
||||
no private identity key, device secret or account proof appears in URLs. The
|
||||
browser uses the existing real email/GitHub Central login. It displays the key
|
||||
fingerprint and requires explicit approval with the normal session cookie,
|
||||
exact-Origin and session-CSRF checks. An authenticated user's approval binds the
|
||||
request to that account; approval never creates a synthetic account. Desktop
|
||||
polls `/v1/auth/desktop/poll` with its device secret; pending is HTTP 202, expired
|
||||
or canceled requests fail closed. Approval yields the signed proof and a long
|
||||
random refresh secret. Secrets are stored only as SHA-256 hashes on Hub. Polling
|
||||
completion is single-use, so a captured browser code cannot retrieve credentials.
|
||||
Desktop cancellation deletes the pending request. Device enrollment expires after
|
||||
30 days; refresh checks that enrollment is still live and issues a new short proof.
|
||||
Desktop logout disables local admission immediately by atomically moving credentials
|
||||
to a private revocation tombstone; online revocation removes it. Network failures
|
||||
retain the admission-disabled tombstone, retried on later sign-in/admission. HTTPS is required
|
||||
for all desktop Central calls; redirects are disabled and request timeouts bounded.
|
||||
Desktop local credential storage uses a private directory and 0600 file, bound to
|
||||
the local identity public key. The local Ed25519 private key never leaves desktop.
|
||||
|
||||
Rate limits and bounded request bodies apply. Expiry is checked on every operation;
|
||||
cleanup does not replace authorization checks. HTTP responses use no-store. All
|
||||
browser approval actions are explicit POSTs; GET requests never approve devices.
|
||||
9
docs/02-protocol/chat-attachments.md
Normal file
9
docs/02-protocol/chat-attachments.md
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
# Channel image attachments (additive LNEx v4 extension)
|
||||
|
||||
Written before implementation. Existing packets and protobuf field numbers remain unchanged; no protocol version bump is needed. Unknown packet IDs remain ignorable. Voice messages and DM attachments are outside this extension.
|
||||
|
||||
Authenticated TLS sessions may send AttachmentUpload (0x0220): request_id=1 string, channel_id=2 string, data=3 bytes. The gateway validates PNG/JPEG/GIF content (maximum 3 MiB encoded; dimensions <=4096 each; <=4 million pixels and <=120 frames and <=8,388,608 aggregate frame pixels (32 MiB RGBA)), enforces upload rate and durable per-sender 64 MiB / global 512 MiB quotas (also 10,000 attachments per sender and 100,000 overall to bound row metadata), and requires the session to be currently joined to the channel. Success durably stores bytes in the existing authenticated database and posts an ordinary chat message `vnox-attachment:<server UUID>`. Such a marker identifies an attachment only within its message channel, never a filesystem path or public URL.
|
||||
|
||||
AttachmentFetch (0x0221): request_id=1, channel_id=2, attachment_id=3 strings. The current session must be joined to that exact channel; lookup is scoped by channel and ID. AttachmentResult (0x0222): request_id=1, channel_id=2, attachment_id=3, mime=4 strings, data=5 bytes, error=6 string. Upload responses omit bytes; fetch responses carry validated bytes. Errors carry a bounded human-readable error and no bytes. All traffic uses the existing TLS frame transport; 3 MiB binary protobuf remains below its 4 MiB frame limit. No HTTP listener, bearer URL, cookies, or externally accessible storage is introduced.
|
||||
|
||||
Images are validated off the async runtime with at most two concurrent validations per gateway process. Quota check, byte insertion, chat history and outgoing webhook events commit in one database transaction, serialized using the existing SQLite write lock / PostgreSQL advisory transaction lock across gateway processes. Current channel existence, text kind and guild membership are revalidated under the access lock; uploads additionally require MESSAGE_SEND (owner/administrator override). Uploads use the existing chat-send rate limiter. Fetches have a separate per-session budget (50 initial requests, refilling at four per second), stored in the same session entry and removed on disconnect, so opening history cannot consume chat-send tokens. Existing channel history preserves the marker and stored bytes survive restarts. Attachments currently have no automatic eviction; quota exhaustion returns an error. Deleting a message does not free its attachment immediately. Clients must bound decoding/cache and explicitly confirm clipboard previews before uploading. Direct HTTPS image URLs are a separate client capability and must not bypass private-network or redirect protections.
|
||||
31
docs/02-protocol/node-features.md
Normal file
31
docs/02-protocol/node-features.md
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
# Node settings, structured channels and forums (LNEx v4 additive)
|
||||
|
||||
## Plan and compatibility
|
||||
|
||||
Implement persisted public node name/description, one-level channel categories and actual forum topics/replies. Authorization uses the verified Central account/session and existing guild permissions. Existing channels/messages/ownership/voice keys remain intact. Storage extends gateway SQLite/PostgreSQL idempotently, independently of Hub migrations.
|
||||
|
||||
Session advertises `node_settings` (6), `channel_structure` (7), `forums` (8). A capable desktop sends `0x0232 ClientFeatures {node_settings=1,channel_structure=2,forums=3}` after Session, before channel listing/actions, only when the corresponding server flag is true. No AUTH fields are added: older v4 signature verification re-encodes AUTH and would drop unknown fields. Older clients never report features: new category/forum kinds are hidden from their channel lists and metadata delivery; existing text/voice remain usable. New clients talking to old gateways disable unsupported controls/packets.
|
||||
|
||||
## Settings
|
||||
|
||||
`0x0230 NodeSettingsRequest {request_id=1,update=2,display_name=3,description=4}`. `0x0231 NodeSettingsResult {request_id=1,display_name=2,description=3,error_code=4,error=5}`. Reads return public data to authenticated clients; updates require the exact session's configured node-admin Central UUID. Name is trimmed, 1–100 characters, no control/bidi override characters. Description is trimmed, at most 2000 characters, permits newline/tab but no other controls/bidi overrides. Success persists before ACK and updates HELLO's node name; future restarts use the stored name/description, config name is only an initial fallback. Changes broadcast Result with empty request_id to feature-capable authenticated clients. Errors are correlated Results, never unrelated join errors.
|
||||
|
||||
## Categories and layout
|
||||
|
||||
Channel kinds are `text`, `voice`, `category`, `forum`. Add parent_id/position to ChannelCreate (5/6), ChannelState (7/8), ChannelListItem (5/6); ChannelEdit optionally changes parent_id (3) and position (4), absent means unchanged, present empty parent means detach to root. Position is 0–1000000, stable ties use channel ID. Categories always live at root; a child's parent must be an existing category in the exact same global/guild scope. No nested categories, cycles, cross-guild parents or implicit channel replacement.
|
||||
|
||||
Node administrators manage global structure; guild management still requires the existing owner/MANAGE_CHANNELS policy. Category JoinChannel is rejected before changing current text/voice subscriptions. Forum JoinChannel is view-only (no generic chat history, audio or UDP credentials). Deleting a category atomically reparents children to root and deletes only the grouping metadata. Bootstrap general/voice IDs remain undeletable. A forum containing any topic cannot be deleted; guild deletion containing forum topics is also refused, preserving discoverability and all replies.
|
||||
|
||||
## Forums
|
||||
|
||||
`0x0240 ForumRequest`: request_id (1), ForumOperation operation (2), channel_id (3), topic_id (4), title (5), content (6), offset (7), limit (8), message_id (9). Enum UNSPECIFIED=0, LIST=1, CREATE=2, OPEN=3, REPLY=4.
|
||||
|
||||
`0x0241 ForumResult`: request_id (1), operation (2), channel_id (3), topic_id (4), topics (5), posts (6), has_more (7), error_code (8), error (9). Every response/error is correlated. `0x0242 ForumChanged`: channel_id (1), topic (2), post (3), broadcast only to current authorized forum subscribers and rechecked at delivery.
|
||||
|
||||
ForumTopic: topic_id (1), channel_id (2), title (3), MemberInfo author (4), created_at (5), updated_at (6), reply_count (7). ForumPost: ChatMessage message (1), MemberInfo author (2), topic_id (3), uint64 ordinal (4). Author IDs/account/name/avatar originate solely from the authenticated verified session. Snapshot names/avatar allow offline authors; clients retain newer live profile cache entries when displaying snapshots.
|
||||
|
||||
LIST defaults to 20, maximum 50 topics; OPEN defaults to 50, maximum 100 posts; offsets at most 100000. Handler fetches limit+1 to determine has_more. Titles are trimmed, 1–160 characters, without control/bidi overrides. Bodies are trimmed, 1–16000 characters and at most 64 KiB, newline/tab permitted. CREATE requires stable client UUID topic_id and message_id; REPLY requires stable message_id. Retries reuse IDs and must match channel/topic/author device+account/title/body to be idempotent; conflicts fail without linking unrelated/private messages. Topic and first message commit atomically. Per-topic ordinal guarantees deterministic reply order even within one millisecond.
|
||||
|
||||
Posts reuse existing messages under the forum channel ID plus an explicit topic mapping. Reads always constrain both channel and topic. Generic chat sends/history, message edits/deletes/reactions and attachment uploads do not mutate forum posts; dedicated ForumRequest is the only posting API in this scope. No topic/post deletion is exposed. Forum access requires node-global visibility or guild membership; guild posting additionally requires owner/MESSAGE_SEND, node administration does not bypass guild policy. Rate limits and shared-access guards protect posting versus concurrent channel/access changes. CREATE/REPLY clients refresh signed profile through the existing bounded activity queue, without interrupting voice.
|
||||
|
||||
All deferred administrative or forum actions are fenced to the authenticated client session so queued operations cannot execute on a different node after switching.
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
# Security
|
||||
|
||||
> **LNEx v3 status.** TCP traffic runs over TLS 1.3.
|
||||
> **LNEx v4 status.** TCP traffic runs over TLS 1.3.
|
||||
> UDP voice path is still plaintext (Phase 2). See
|
||||
> [features/encryption.md](../05-features/encryption.md) for details.
|
||||
|
||||
|
|
@ -31,7 +31,7 @@ The threat model covers:
|
|||
|
||||
## Encryption
|
||||
|
||||
TCP control traffic is protected by **TLS 1.3** (rustls, ALPN `vnox-lnex/3`). The earlier
|
||||
TCP control traffic is protected by **TLS 1.3** (rustls, ALPN `vnox-lnex/4`). The earlier
|
||||
LNEx v2 per-frame ChaCha20-Poly1305 layer is removed. Trust model, certificate handling,
|
||||
channel binding and version bump: see [tls.md](tls.md).
|
||||
|
||||
|
|
@ -116,3 +116,7 @@ temporary ban depending on node configuration.
|
|||
- rotate node keypair on suspected compromise
|
||||
|
||||
See `03-server/operations.md` for hardening checklist.
|
||||
|
||||
LNEx v4 additionally requires a short-lived, issuer-signed Central account proof
|
||||
bound to the client Ed25519 key, before any session or user write. Private mode
|
||||
has the same requirement. See [Central account admission](central-account.md).
|
||||
|
|
|
|||
|
|
@ -1,8 +1,10 @@
|
|||
# TLS 1.3 for the TCP control plane (LNEx v3)
|
||||
# TLS 1.3 for the TCP control plane (LNEx v4)
|
||||
|
||||
> Status: design accepted and implemented together with this document.
|
||||
> Current version: LNEx v4. TLS was introduced in v3; v4 adds mandatory
|
||||
> [Central account admission](central-account.md), preserving the TLS security model.
|
||||
> This document describes the current v4 transport parameters.
|
||||
> This is a **breaking change**: LNEx v2 (custom X25519 + HKDF + ChaCha20-Poly1305
|
||||
> layer on TCP) is removed. The protocol version is bumped to `v3`.
|
||||
> layer on TCP) is removed. The protocol version is bumped to `v4`.
|
||||
> UDP voice is **not** affected (see [Voice](#voice-udp-is-unchanged)).
|
||||
|
||||
## Goals
|
||||
|
|
@ -27,7 +29,7 @@
|
|||
|
||||
| # | Decision |
|
||||
|---|----------|
|
||||
| D1 | `rustls` 0.23 with the `aws_lc_rs` provider, **TLS 1.3 only** on both sides. ALPN `vnox-lnex/3` is required. |
|
||||
| D1 | `rustls` 0.23 with the `aws_lc_rs` provider, **TLS 1.3 only** on both sides. ALPN `vnox-lnex/4` is required. |
|
||||
| D2 | The server certificate is either user supplied (`tls_cert_path` / `tls_key_path`, for example Let's Encrypt) or **auto generated** on first start and stored in `data_dir/tls/self-signed.pem`. |
|
||||
| D3 | The auto generated certificate uses the **server identity Ed25519 key as its TLS key**. Therefore the certificate fingerprint is a pure function of the identity key, survives certificate regeneration, and no second private key is stored. |
|
||||
| D4 | The **pin** is `SHA-256(SubjectPublicKeyInfo DER)` of the leaf certificate (the "SPKI fingerprint"). It is the trust anchor for self-signed servers. |
|
||||
|
|
@ -35,7 +37,7 @@
|
|||
| D6 | A changed fingerprint is a **hard block** with a warning. There is no "connect anyway". The only way forward is an explicit "forget this server" followed by a new trust decision. |
|
||||
| D7 | The Ed25519 client authentication stays, but its signature covers a **TLS exporter value (channel binding)**, so it cannot be relayed over another TLS connection. The server HELLO is signed with its identity key over the same binding. |
|
||||
| D8 | The X25519 + HKDF + ChaCha20-Poly1305 layer on TCP, the `ENCRYPTED` packet flag on TCP and the ephemeral key fields in `Hello` and `Auth` are removed. |
|
||||
| D9 | LNEx version is bumped from `v2` to `v3`. Old clients and old servers fail with an explicit error. Downgrade is impossible by construction. |
|
||||
| D9 | LNEx version is bumped from `v2` to `v4`. Old clients and old servers fail with an explicit error. Downgrade is impossible by construction. |
|
||||
|
||||
## Threat model
|
||||
|
||||
|
|
@ -45,7 +47,7 @@
|
|||
| Active MITM terminating TLS with its own certificate | Pin mismatch (known server) or TOFU prompt showing a different fingerprint (new server). Even if the user accepted a wrong fingerprint, the MITM cannot produce the server's Ed25519 signature over this connection's exporter, and the client rejects a server identity that differs from the stored one. |
|
||||
| MITM relaying the server's HELLO to the client | HELLO signature covers the exporter of the TLS session between the client and the relay, which differs from the relay to server session. Verification fails. |
|
||||
| Malicious server relaying a client's AUTH to another server | AUTH signature covers the exporter of the connection to the malicious server. Another server computes a different value and rejects it. |
|
||||
| Downgrade to plaintext, TLS 1.2 or LNEx v2 | The client never opens a plaintext socket, the rustls configs list only TLS 1.3, the server requires ALPN `vnox-lnex/3`, and the version string `v3` is inside the signed transcripts. |
|
||||
| Downgrade to plaintext, TLS 1.2 or LNEx v2 | The client never opens a plaintext socket, the rustls configs list only TLS 1.3, the server requires ALPN `vnox-lnex/4`, and the version string `v4` is inside the signed transcripts. |
|
||||
| First connection MITM (TOFU weakness) | Unavoidable without a CA or out of band data. Mitigation: the server prints its fingerprint at startup and writes it to `data_dir/tls/fingerprint.txt`; owners should publish it with the invitation, users compare before confirming. Public CA certificates skip TOFU. |
|
||||
| Compromised or replaced server key | Fingerprint changes, clients block (D6). |
|
||||
|
||||
|
|
@ -82,7 +84,7 @@ At startup the gateway logs `TLS SPKI SHA-256 fingerprint: <hex>` and writes it
|
|||
|
||||
- Protocol versions: TLS 1.3 only (`rustls::version::TLS13`).
|
||||
- Cipher suites: the rustls defaults for TLS 1.3 (AES-GCM, ChaCha20-Poly1305).
|
||||
- ALPN: `vnox-lnex/3`. A connection without the negotiated ALPN is dropped before any
|
||||
- ALPN: `vnox-lnex/4`. A connection without the negotiated ALPN is dropped before any
|
||||
LNEx byte is read.
|
||||
- No client certificates.
|
||||
- Handshake timeouts: 15 seconds for the TLS handshake and 15 seconds for the LNEx HELLO/AUTH/SESSION exchange.
|
||||
|
|
@ -99,7 +101,7 @@ The server peeks at the first byte of a new connection (up to 2 seconds).
|
|||
A TLS client sends a handshake record (`0x16`) immediately. Anything else (a v2 client
|
||||
waits for the server HELLO and sends nothing, a plaintext client sends LNEx bytes)
|
||||
receives one plaintext LNEx `Error` frame, `ErrorCode::VersionMismatch`, with the message
|
||||
`TLS 1.3 required (LNEx v3): update your client`, and the connection is closed. This
|
||||
`TLS 1.3 required (LNEx v4): update your client`, and the connection is closed. This
|
||||
frame is the only plaintext the gateway ever writes and it contains no secrets.
|
||||
|
||||
## Client
|
||||
|
|
@ -150,7 +152,7 @@ TLS 1.3 handshake with a custom ServerCertVerifier:
|
|||
UI on UntrustedServer: show host, fingerprint (grouped hex), "Trust" / "Cancel".
|
||||
Trust -> trust_store[host:port] = { pin, fingerprint }, reconnect.
|
||||
|
||||
LNEx v3 handshake inside the tunnel (see below)
|
||||
LNEx v4 handshake inside the tunnel (see below)
|
||||
after a valid server HELLO:
|
||||
rec.identity set and != server_pubkey -> ERROR IdentityChanged (hard block)
|
||||
otherwise store identity (TOFU of the identity inside an already trusted channel)
|
||||
|
|
@ -175,7 +177,7 @@ When a pinned server presents another SPKI the client:
|
|||
server migration (for example moving from a self-signed certificate to Let's Encrypt
|
||||
or restoring a server without its `server_identity.json`).
|
||||
|
||||
## LNEx v3 handshake inside TLS
|
||||
## LNEx v4 handshake inside TLS
|
||||
|
||||
The 12 byte packet header and protobuf payloads are unchanged. Frames are written
|
||||
directly into the TLS stream. The `flags` field must be `0` on the TCP control plane
|
||||
|
|
@ -184,10 +186,10 @@ directly into the TLS stream. The `flags` field must be `0` on the TCP control p
|
|||
```
|
||||
Client Gateway
|
||||
| -- TCP + TLS 1.3 handshake (ALPN) ---> |
|
||||
| both sides: binding = Export("EXPORTER-VNOX-LNEx-v3-channel-binding", no context, 32)
|
||||
| <------ HELLO (seq 0) ---------------- | lnex_version="v3", server_pubkey, challenge_nonce,
|
||||
| both sides: binding = Export("EXPORTER-VNOX-LNEx-v4-channel-binding", no context, 32)
|
||||
| <------ HELLO (seq 0) ---------------- | lnex_version="v4", server_pubkey, challenge_nonce,
|
||||
| | node_name, private_mode, server_signature
|
||||
| ------- AUTH (seq 0) ----------------> | client_pubkey, nickname, lnex_version="v3", signature
|
||||
| ------- AUTH (seq 0) ----------------> | client_pubkey, nickname, lnex_version="v4", signature, account_proof
|
||||
| <------ SESSION (seq 1) -------------- | session_id, token, expires_at
|
||||
```
|
||||
|
||||
|
|
@ -195,10 +197,10 @@ Signatures (Ed25519, strict verification):
|
|||
|
||||
```
|
||||
server_signature = Sign(server_key,
|
||||
"VNOX-LNEx-v3-server-hello\0" || binding || protobuf(Hello with server_signature empty))
|
||||
"VNOX-LNEx-v4-server-hello\0" || binding || protobuf(Hello with server_signature empty))
|
||||
|
||||
client signature = Sign(client_key,
|
||||
"VNOX-LNEx-v3-client-auth\0" || binding
|
||||
"VNOX-LNEx-v4-client-auth\0" || binding
|
||||
|| u32be(len(signed_hello)) || signed_hello
|
||||
|| protobuf(Auth with signature empty))
|
||||
```
|
||||
|
|
@ -238,18 +240,18 @@ needs the client to trust the gateway certificate (`--trust-first-use` or `--fin
|
|||
|
||||
| Client | Server | Result |
|
||||
|--------|--------|--------|
|
||||
| v3 | v3 | works |
|
||||
| v2 (old) | v3 | server sends a plaintext `Error(VersionMismatch)` "TLS 1.3 required (LNEx v3): update your client"; an old client shows a handshake error or times out. Nothing is negotiated. |
|
||||
| v3 | v2 (old) | the server answers the TLS ClientHello with LNEx bytes. The client maps the rustls decode failure to "The server does not speak TLS 1.3 (LNEx v3). It is probably an outdated server, ask the owner to update." No retry in plaintext. |
|
||||
| v3, TLS 1.2 only peer | v3 | handshake failure, protocol version alert, same explicit message. |
|
||||
| v3 | v3 with `lnex_version` other than `v3` in HELLO/AUTH | `VersionMismatch`, connection closed. |
|
||||
| v4 | v4 | works |
|
||||
| v2 (old) | v4 | server sends a plaintext `Error(VersionMismatch)` "TLS 1.3 required (LNEx v4): update your client"; an old client shows a handshake error or times out. Nothing is negotiated. |
|
||||
| v4 | v2 (old) | the server answers the TLS ClientHello with LNEx bytes. The client maps the rustls decode failure to "The server does not speak TLS 1.3 (LNEx v4). It is probably an outdated server, ask the owner to update." No retry in plaintext. |
|
||||
| v4, TLS 1.2 only peer | v4 | handshake failure, protocol version alert, same explicit message. |
|
||||
| v4 | v4 with `lnex_version` other than `v4` in HELLO/AUTH | `VersionMismatch`, connection closed. |
|
||||
|
||||
There is no version negotiation and no compatibility window: the old handshake is not
|
||||
implemented in the new binaries.
|
||||
|
||||
## Operations: enabling it on a server
|
||||
|
||||
1. Update the gateway (and `serverd`) to the LNEx v3 build. Remove `tls_enabled = false`
|
||||
1. Update the gateway (and `serverd`) to the LNEx v4 build. Remove `tls_enabled = false`
|
||||
if present.
|
||||
2. Self-signed: nothing to configure. Start the gateway, read the fingerprint from the
|
||||
log or `data_dir/tls/fingerprint.txt`, publish it to your users.
|
||||
|
|
|
|||
|
|
@ -1,14 +1,20 @@
|
|||
# Server / Gateway
|
||||
|
||||
A VNOX node consists of two processes:
|
||||
A VNOX node contains two components:
|
||||
|
||||
```
|
||||
gateway — TCP, handles auth / chat / channels / permissions
|
||||
voice-node — UDP, handles voice relay
|
||||
```
|
||||
|
||||
Both are written in Rust. They can run on the same machine or separately.
|
||||
For most self-hosted setups, running both on one machine is fine.
|
||||
Both are written in Rust. Run `vnox-serverd` for working voice: it connects the
|
||||
gateway to voice-node through an in-process authenticated credential bridge.
|
||||
Standalone gateway and voice-node binaries exist, but separate-process signaling
|
||||
is not implemented; standalone voice-node fails closed without credentials.
|
||||
|
||||
The optional central account service is `vnox-hub`. It provides browser sign-in,
|
||||
profile/handle selection and own-avatar APIs; it does not relay community messages
|
||||
or voice. See [Hub setup](../../hub/README.md) and [account API](../../hub/AUTH.md).
|
||||
|
||||
---
|
||||
|
||||
|
|
|
|||
|
|
@ -219,3 +219,22 @@ vnox-gateway --config /etc/vnox/config.toml --check
|
|||
```
|
||||
|
||||
Exits 0 if config is valid, prints errors otherwise.
|
||||
|
||||
## Mandatory Central account admission (LNEx v4)
|
||||
|
||||
Every gateway connection needs a short-lived Central account proof, signed by the
|
||||
explicitly configured issuer and bound to the client Ed25519 identity. Private mode
|
||||
uses the same requirement. There is no anonymous admission switch. Configure the
|
||||
public issuer identity obtained through your trusted Central operator:
|
||||
|
||||
```toml
|
||||
[gateway.central_account]
|
||||
issuer = "<Central issuer UUID>"
|
||||
public_key = "<64-character Ed25519 public key hex>"
|
||||
```
|
||||
|
||||
Missing or invalid trust rejects all account admissions. The gateway never accepts
|
||||
a trust key from a client and never automatically discovers issuer keys over HTTP.
|
||||
Central device logout/revocation prevents further proof refresh; previously issued
|
||||
proofs remain valid for at most ten minutes. Active session lifetime follows the
|
||||
existing gateway session policy. See [proof format](../02-protocol/central-account.md).
|
||||
|
|
|
|||
25
docs/05-features/hub-server-directory.md
Normal file
25
docs/05-features/hub-server-directory.md
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
# Hub community server directory HTTP contract
|
||||
|
||||
Listings are unverified user submissions, not endorsements or evidence of server ownership,
|
||||
reachability, protocol compatibility or safety. Hub performs no DNS resolution or network probes.
|
||||
This is a Hub HTTP API and does not change LNEx.
|
||||
|
||||
- `GET /v1/servers` is public and returns `{ "servers": [...] }`, at most 100
|
||||
rows ordered by ID ascending. `?after=<UUID>` continues after the final ID.
|
||||
- `POST /v1/servers` requires the existing session cookie, exact Origin and CSRF token.
|
||||
JSON fields are `name` (1–80 characters), `address` (public DNS/IP and explicit nonzero
|
||||
port), and `description` (0–500 characters). Strings are trimmed; controls and bidi
|
||||
formatting are rejected. DNS names become lowercase; IPs and ports are canonicalized.
|
||||
Success is 201 `{ "server": {...} }`; duplicate normalized addresses return 409
|
||||
`address_taken`. A user can hold at most 10 listings (409 `listing_limit`).
|
||||
- `DELETE /v1/servers/{id}` requires the same session, Origin and CSRF protections.
|
||||
Owners receive 204; missing and other users' listings receive 404 `server_not_found`.
|
||||
|
||||
Each record has `id`, `name`, `address`, `description`, `owner_id`, `created_at`
|
||||
(Unix seconds). Addresses are globally unique; account deletion cascades to listings.
|
||||
Mutation bodies are capped at 4096 bytes; JSON errors return 400 `invalid_request`
|
||||
(or 413 when oversized), invalid field values return 422 `invalid_server`.
|
||||
Mutation attempts share an independent per-account 10/hour and source 30/hour budget;
|
||||
public reads use an independent 20/source and 300/global minute budget. Exhaustion returns 429
|
||||
`try_later`. Storage errors return 503 `try_later`. The proxy must overwrite
|
||||
X-Forwarded-For as required by the existing Hub authentication contract.
|
||||
|
|
@ -1,5 +1,91 @@
|
|||
# Roadmap
|
||||
|
||||
## Active request 2026-11-01: account presence and profiles
|
||||
|
||||
- [ ] Correct multi-session account presence: one visible member per account,
|
||||
preserve membership/presence until its last relevant session leaves, and test
|
||||
two sessions closing in either order.
|
||||
- [ ] Define profile/avatar propagation to desktop before protocol additions;
|
||||
browser login must not leave the desktop showing a disconnected local profile.
|
||||
- [ ] Client remembers successful server selection and reconnects after account
|
||||
restoration; visual QA must run only on an isolated virtual display/profile.
|
||||
|
||||
## Active request 2026-11-01: image/GIF attachments
|
||||
|
||||
- [ ] Specify durable image/GIF upload, download, ownership, access checks,
|
||||
storage quotas and bounded decoding before implementation/protocol changes.
|
||||
- [ ] Implement authenticated attachment persistence and client clipboard image
|
||||
uploads with preview/cancel; receivers must actually obtain the uploaded media.
|
||||
- [ ] Add bounded direct-HTTPS image/GIF display in chat, with animation and
|
||||
failures handled without blocking the UI.
|
||||
- [ ] Deferred: voice messages, explicitly excluded from the current request.
|
||||
|
||||
## Active request 2026-11-01: desktop account enforcement
|
||||
|
||||
- [ ] Specify desktop authorization/device enrollment, proof binding to the
|
||||
client's Ed25519 identity, gateway issuer trust, expiry/revocation and outage
|
||||
behavior before implementation.
|
||||
- [ ] Require an authenticated Central account in both the desktop connection
|
||||
flow and gateway admission; a client-only gate is insufficient.
|
||||
- [ ] Bump LNEx version for breaking admission/handshake changes and update tests.
|
||||
- [ ] Preserve browser sessions and show own/generated VNOX avatars in the site
|
||||
header; uploads remain bounded, re-encoded and served from Hub storage.
|
||||
- [ ] Validate deployment and new desktop installation before declaring complete.
|
||||
|
||||
Updated: 2026-10-25. Historical phase checklists below are not release acceptance
|
||||
criteria. For actual behavior and limitations, see [current status](00-status.md).
|
||||
|
||||
## Audit 2026-11-01: ownership and client administration
|
||||
|
||||
See [ownership/admin audit](design/ownership-and-admin-audit.md) for verified code
|
||||
paths and missing flows. Guild creators already become owners; a VPS operator
|
||||
does not automatically receive account-level node administration. Ownership
|
||||
transfer is not implemented. The Slint management UI is incomplete despite the
|
||||
historical feature checklists below.
|
||||
|
||||
- [ ] Specify node-admin enrollment and ownership transfer before LNEx changes.
|
||||
- [ ] Replace the misleading full-permission `@everyone` owner role with a safe,
|
||||
explicitly migrated default-role model; do not auto-assign the existing role.
|
||||
- [ ] Preserve `owner_id` and server-confirmed role/member data in the client and
|
||||
implement guild, invite, channel and role management screens.
|
||||
- [ ] Correct `/version` reporting `lnex_version: "1"` for the LNEx v3 gateway.
|
||||
|
||||
## Delivered 2026-11-01: public community directory
|
||||
|
||||
- [x] Public website `/servers` with RU/EN browsing, search of loaded entries,
|
||||
address copying and pagination.
|
||||
- [x] Durable Hub HTTP directory with authenticated submissions and owner-only
|
||||
removal, bounded fields, unique normalized addresses and independent rate limits.
|
||||
- [x] Published and checked at `https://central.loki-code.dev/servers`.
|
||||
|
||||
Listings are unverified announcements. This does not implement cryptographic
|
||||
node registration, mandatory Hub login at gateways, ownership transfer or
|
||||
federation. See [HTTP contract](05-features/hub-server-directory.md).
|
||||
|
||||
## Next server milestones
|
||||
|
||||
1. Hub account/profile foundation: email and GitHub browser sign-in, own avatar API,
|
||||
and unique handle selection API are implemented. Add browser onboarding and a
|
||||
separately specified desktop authorization/device-enrollment flow next.
|
||||
2. Define how community gateways verify Hub account/device proofs, including
|
||||
revocation, migration from local identities and Hub outages. Mandatory Hub login
|
||||
is not enforced today. Document the LNEx contract before implementation.
|
||||
3. Define profile/avatar distribution to other clients, cache invalidation and
|
||||
visibility policy. Current Hub own-avatar API does not synchronize desktop avatars.
|
||||
4. Implement authenticated separate-process gateway/voice-node signaling. The
|
||||
combined `serverd` already has an in-process credential bridge.
|
||||
5. Implement and verify off-host paired issuer/database backups and 30-day rotation
|
||||
for deleted account/avatar data. Current deployment notes describe a foundation
|
||||
snapshot, not ongoing backup assurance.
|
||||
|
||||
### Completed in this server batch
|
||||
|
||||
- [x] Authenticated `PUT /v1/account/profile` with Origin/CSRF checks and bounded body.
|
||||
- [x] Case-insensitive unique permanent handle selection and editable display name.
|
||||
- [x] Registration-completion flag in session/login responses and migration for existing accounts.
|
||||
- [x] Validation, rate limits and tests for concurrent claims and stale sessions.
|
||||
|
||||
|
||||
---
|
||||
|
||||
## Phase 1 — MVP
|
||||
|
|
@ -9,7 +95,7 @@ Goal: a working voice + chat system you can actually use.
|
|||
### Server
|
||||
- [x] LNEx v1 protocol spec
|
||||
- [x] Gateway: auth, sessions, channels, text chat
|
||||
- [x] Voice node: UDP relay (jitter buffer code exists, not wired into relay yet)
|
||||
- [x] Voice node: authenticated encrypted UDP relay with per-sender jitter buffers
|
||||
- [x] SQLite storage: message history, user records
|
||||
- [x] Docker + systemd deployment ([Dockerfile](../Dockerfile), [docker-compose.yml](../docker-compose.yml))
|
||||
- [x] config.toml reference ([configuration.md](../03-server/configuration.md), [dev/README.md](../../dev/README.md))
|
||||
|
|
@ -157,11 +243,11 @@ Goal: scalability, federation preparation, advanced security.
|
|||
- [ ] Rate limiting refinement
|
||||
- [ ] PostgreSQL backend (sqlx support ready, config not exposed yet)
|
||||
- [ ] Prometheus metrics on gateway and voice-node
|
||||
- [ ] Gateway admin API (HTTP endpoint)
|
||||
- [ ] Identity keypair encryption at rest (Argon2id passphrase)
|
||||
- [x] Gateway HTTP health/version/metrics foundation (full management API remains separate work)
|
||||
- [x] Identity keypair encryption at rest (Argon2id passphrase)
|
||||
|
||||
### Protocol
|
||||
- [ ] Protobuf schemas (replacing JSON)
|
||||
- [x] Protobuf schemas (replacing JSON)
|
||||
- [ ] E2EE for direct messages (optional)
|
||||
- [ ] E2EE for private channels (opt-in)
|
||||
- [ ] Voice regions: Warsaw, Frankfurt, Amsterdam, London, New York, Singapore
|
||||
|
|
@ -212,3 +298,58 @@ Goal: federation ecosystem and mobile clients.
|
|||
|
||||
Spatial audio for games, adaptive bitrate relay, distributed mesh,
|
||||
VNOX SDK (Rust → TypeScript → Python), offline message queue.
|
||||
|
||||
## Account presence and Central member profiles (2026-11-01)
|
||||
|
||||
- [ ] Keep authenticated Central account IDs separate from Ed25519 device IDs. Channel subscriptions and voice routes remain session/device scoped; account member rows aggregate devices. Closing either of two sessions must retain the other session, member and online presence.
|
||||
- [ ] Distribute Central-signed display names and same-origin avatar paths in additive member metadata; fetch bounded PNGs without forwarding credentials, cache successful results, and retain initials on errors. Preserve guild ownership and historical device IDs.
|
||||
- [ ] Verify two-device and repeated-device lifecycle, profile propagation and rejected avatar origins with regression tests.
|
||||
|
||||
## Desktop Central avatar correction (2026-11-01)
|
||||
|
||||
- [x] Refresh and persist the Central summary at admission and bounded background/profile-view refresh; deliver updates to UI without reading credentials every tick. Drop late results after logout or enrollment replacement.
|
||||
- [x] Restore desktop photo choose/crop/upload/delete against Central enrollment-authenticated endpoints. Reuse normalized PNG storage/default avatar and account/IP budgets; no browser cookie or profile migration 6.
|
||||
- [x] Verify website-avatar refresh, authenticated PNG upload/delete, device binding, expired/revoked secrets, invalid image limits, and summary/UI propagation.
|
||||
|
||||
- [x] Add desktop editable Central display_name with signed enrollment-authorized profile mutation, existing 64-character/control validation, persisted summary/watch update and name-adjacent Save/status controls. Unique handle and ownership IDs remain unchanged.
|
||||
|
||||
Desktop name/photo mutations update the own account UI and persisted enrollment immediately. Live signed profile propagation below supersedes the original admission-only peer refresh limitation; no forced reconnect is used.
|
||||
|
||||
## Live signed Central profile propagation (2026-11-01)
|
||||
|
||||
- [x] Implement additive ProfileUpdate/ProfileUpdated after the documented contract: verify issuer/device/account/lifetime, guard monotonic issued_at, update only profile metadata and target currently authorized shared-channel peers.
|
||||
- [x] Verify chat/voice refresh with two clients and no disconnect or membership changes; preserve ownership, device IDs, roles and UDP routes.
|
||||
|
||||
## Explicit node administrator capability (2026-11-01)
|
||||
|
||||
- [x] Validate gateway.admin_account_ids UUID allowlist at startup; Session.node_admin advertises only global channel CRUD. Match verified account_id, preserve guild permissions and bootstrap channel IDs.
|
||||
- [x] Regression checks authorized account/second device, nonadmin and cross-guild denial; metadata fanout and persistent global channel reload.
|
||||
|
||||
- [x] Negotiate Session.live_profiles (field 5): legacy v4 gateways receive no ProfileUpdate packets and no profile-based activity delay; capable gateways retain proof-before-action ordering.
|
||||
|
||||
## Node settings, categories and real forums (2026-11-01)
|
||||
|
||||
- [ ] Follow [node feature contract](02-protocol/node-features.md) before implementation: negotiated capabilities/client feature report, persisted name/description and same-scope one-level layout.
|
||||
- [ ] Add category grouping and real topics/replies with correlated errors, idempotent stable mutation IDs, bounded reads and preserved guild permissions.
|
||||
- [ ] Reject category joins/unsupported forum chat mutations; dissolve category grouping and refuse destructive nonempty forum/guild deletion.
|
||||
- [ ] Verify authenticated admin controls, persistence/restart, cross-scope denial, legacy visibility, no voice capture, topic/post isolation and concurrent/idempotent requests.
|
||||
|
||||
## Контрольная точка: остановлено по просьбе пользователя — 2026-11-01
|
||||
|
||||
Все три агента остановлены. Работающие версии оставлены установленными:
|
||||
- Client: `20261101-f16a49f9c678` (218 тестов, 2 ignored, Clippy проходил).
|
||||
- Gateway VPS: `20261101-live-capability-219376accf98`.
|
||||
- Central: `20261101-live-admin-91595d45652a`; Web: `20261101-names-monsters-ff473f423565`.
|
||||
- Аккаунт `loki` имеет права управления глобальными каналами узла.
|
||||
|
||||
В коммитах сохранён НЕЗАВЕРШЁННЫЙ следующий этап, не опубликованный в production:
|
||||
- меню заголовка/ПКМ, настройки имени/описания узла, категории и форумы;
|
||||
- серверное хранилище уже имеет 6 проходивших focused-регрессий, но общий
|
||||
финальный client/server build и интеграционная проверка ещё не завершены.
|
||||
- версии/автообновление/релиз Linux+Windows пока только запланированы.
|
||||
|
||||
Продолжение: сначала завершить сборку и общие тесты текущего черновика, затем
|
||||
проверить voice relay/чат/форумы в изолированной среде, собрать и развернуть;
|
||||
после этого реализовать updater с подписанным manifest и выпустить бинарники
|
||||
в https://git.wihuk.pro/boba/VNOX-Client.git. Cargo.repository уже исправлен.
|
||||
Не запускать тестовые приложения на рабочем столе пользователя.
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# Vnox: регистрация, устройства и аватары
|
||||
|
||||
Статус: продуктовая и техническая спецификация. Регистрация Hub пока не реализована. Клиентский редактор аватара реализуется отдельно; до появления API сохраняет реальное изображение локально.
|
||||
Статус на 2026-10-25: сервер Hub поддерживает браузерный вход через GitHub и почтовый код, API выбора уникального handle и отображаемого имени, а также собственные аватары. Контракт: `hub/AUTH.md`. Экран завершения регистрации, авторизация desktop, привязка устройств и проверка аккаунта на gateway ещё не реализованы. Редактор аватара desktop сохраняет изображение локально; синхронизации с Hub и другими участниками пока нет. Последующие разделы описывают целевую модель и не означают готовность всех функций.
|
||||
|
||||
## Вход и создание аккаунта
|
||||
|
||||
|
|
|
|||
74
docs/design/ownership-and-admin-audit.md
Normal file
74
docs/design/ownership-and-admin-audit.md
Normal file
|
|
@ -0,0 +1,74 @@
|
|||
# Владение узлом и сообществом: состояние реализации
|
||||
|
||||
Обновлено 2026-11-01 после проверки и установки LNEx v4. Администраторы узла
|
||||
задаются оператором в `[gateway] admin_account_ids = ["Central-account-UUID"]`.
|
||||
Проверяется аккаунт конкретной аутентифицированной сессии; имя и ключ другого
|
||||
устройства сами по себе прав не дают. Администратор управляет глобальными
|
||||
текстовыми/голосовыми каналами; права внутри сообществ остаются отдельными.
|
||||
Клиент получает capability `Session.node_admin` и показывает создание,
|
||||
переименование и подтверждение удаления каналов. Решение всегда принимает сервер.
|
||||
|
||||
Это аудит поведения и список следующих шагов, а не замена документации протокола.
|
||||
|
||||
## Что уже есть
|
||||
|
||||
- При `GuildCreate` gateway берёт владельца из аутентифицированной сессии,
|
||||
а не из пользовательского запроса. Создатель записывается в `guilds.owner_id`
|
||||
и становится участником своего сообщества.
|
||||
- Владелец проходит проверки прав своего сообщества независимо от ролей.
|
||||
Удаление сообщества разрешено только владельцу; владельца нельзя исключить.
|
||||
- Роли содержат битовую маску, включая `MANAGE_ROLES`, `MANAGE_CHANNELS`,
|
||||
`KICK_MEMBERS` и `ADMINISTRATOR`. Назначение роли проверяет принадлежность
|
||||
роли и участника тому же сообществу. Ограниченный управляющий ролями не может
|
||||
выдать права, которых у него нет.
|
||||
- Это права сообщества. Для глобальных каналов действует отдельный список
|
||||
`gateway.admin_account_ids`. Базовые `general` и `voice` нельзя удалить.
|
||||
Адрес `gateway.admin_bind` предоставляет health/version/metrics и не выдаёт админку.
|
||||
|
||||
Источники: `gateway/src/handler/guild/`,
|
||||
`gateway/src/domain/storage/guilds/`, [правила авторизации](channel-authorization.md).
|
||||
|
||||
## Чего нет и что требует исправления
|
||||
|
||||
1. Установка сервера на VPS не привязывает автоматически аккаунт оператора.
|
||||
Настройка `admin_account_ids` уже реализована; root/оператор явно указывает
|
||||
Central UUID. Одноразовый claim/bootstrap через клиент пока не реализован.
|
||||
Нельзя выдавать админку первому подключившемуся.
|
||||
2. Передача `owner_id` другому участнику не реализована. В спецификации
|
||||
[Community Model](../07-community-model.md) поле пока обозначено immutable.
|
||||
Нужны сначала контракт и политика восстановления, затем атомарная операция
|
||||
с проверкой текущего владельца, целевого участника, подтверждением и аудитом.
|
||||
3. Создаваемая роль `@everyone` содержит `u64::MAX` и назначается только
|
||||
создателю. Новые участники не получают её автоматически. Поэтому сейчас это
|
||||
фактически административная роль с неверным названием, а не базовые права
|
||||
всех участников. Нельзя начать автоматически назначать её всем: это выдаст
|
||||
административные права. Нужны безопасные базовые права и явная миграция.
|
||||
4. В текущем Slint-клиенте есть сетевые команды создания сообщества, ролей,
|
||||
приглашений и назначения ролей, но нет законченного интерфейса управления.
|
||||
`GuildState` теряет `owner_id` при обработке списка и создания сообщества;
|
||||
результаты создания ролей и приглашений пока не используются интерфейсом.
|
||||
5. LNEx v4 связывает Central-аккаунт с ключом устройства подписанным proof.
|
||||
Владение существующим сообществом по-прежнему определяется device identity;
|
||||
простой вход в Central не переносит это владение. Важно сохранять её ключ.
|
||||
|
||||
## Следующие шаги клиента
|
||||
|
||||
1. Сохранить `owner_id`, участников, роли и подтверждённые сервером права
|
||||
в состоянии клиента; показывать владельца и доступные действия.
|
||||
2. Доделать создание сообщества, приглашения, управление каналами, ролями,
|
||||
назначениями и исключением участников. Обрабатывать отказ сервера и
|
||||
обновление прав во время открытого окна управления.
|
||||
3. Добавить получение админки узла и передачу владения только после согласования
|
||||
соответствующих серверных контрактов; интерфейс не может сам выдать права.
|
||||
4. Добавить каталог серверов/переход с сайта отдельно от получения прав.
|
||||
Автор объявления в каталоге не считается владельцем VPS или сообщества.
|
||||
|
||||
## Проверка существующего хостинга
|
||||
|
||||
На 2026-11-01 узел `185.176.94.38:7600` работает через `vnox-server.service`
|
||||
(`vnox-serverd`, автозапуск включён), голосовой UDP-порт `7700` используется
|
||||
без изменения протокола. Health отвечает `ok`, gateway сообщает LNEx v4.
|
||||
Оператором настроены права управления глобальными каналами аккаунта `loki`.
|
||||
Проверены подпись аккаунта, второе устройство, отказ другому аккаунту с тем же
|
||||
ключом, отсутствие обхода guild-прав и сохранение каналов после загрузки БД.
|
||||
Это не подтверждает слышимость реального микрофона и воспроизведения.
|
||||
Loading…
Add table
Add a link
Reference in a new issue