From a85d16fff8bfee1a7ed51cb8566ba1c3ac8c5b02 Mon Sep 17 00:00:00 2001 From: HueByte Date: Wed, 22 Apr 2026 15:29:58 +0200 Subject: [PATCH] feat: update installation script and documentation for version 0.2.11 release --- docs/articles/getting-started.md | 2 +- docs/changelog/index.md | 1 + docs/changelog/toc.yml | 2 ++ docs/changelog/v0.2.11.md | 23 +++++++++++++++++++ scripts/install.sh | 2 +- src/Directory.Build.props | 2 +- .../Services/ServerDirectoryService.cs | 2 +- 7 files changed, 30 insertions(+), 4 deletions(-) create mode 100644 docs/changelog/v0.2.11.md diff --git a/docs/articles/getting-started.md b/docs/articles/getting-started.md index 805823b..feee4ee 100644 --- a/docs/articles/getting-started.md +++ b/docs/articles/getting-started.md @@ -17,7 +17,7 @@ curl -sSfL https://raw.githubusercontent.com/HueByte/EchoHub/master/scripts/inst To install a specific version or to a custom directory: ```bash -curl -sSfL .../install.sh | sh -s -- --version 0.2.10 +curl -sSfL .../install.sh | sh -s -- --version 0.2.11 curl -sSfL .../install.sh | sh -s -- --install-dir /opt/echohub ``` diff --git a/docs/changelog/index.md b/docs/changelog/index.md index d29fb82..11a614c 100644 --- a/docs/changelog/index.md +++ b/docs/changelog/index.md @@ -4,6 +4,7 @@ Release history for EchoHub. ## Releases +- [v0.2.11](v0.2.11.md) - EchoHubSpace Auth, Live Directory Updates & Server Browser Metadata - [v0.2.10](v0.2.10.md) - Command Palette, Infinite History Scroll & Auto-Updater Fixes - [v0.2.9](v0.2.9.md) - Install Script & Chocolatey Fixes - [v0.2.8](v0.2.8.md) - Docker Support, IRC Account Creation & BOM Fix diff --git a/docs/changelog/toc.yml b/docs/changelog/toc.yml index b9b6073..85d2776 100644 --- a/docs/changelog/toc.yml +++ b/docs/changelog/toc.yml @@ -1,5 +1,7 @@ - name: Overview href: index.md +- name: v0.2.11 + href: v0.2.11.md - name: v0.2.10 href: v0.2.10.md - name: v0.2.9 diff --git a/docs/changelog/v0.2.11.md b/docs/changelog/v0.2.11.md new file mode 100644 index 0000000..80f23d4 --- /dev/null +++ b/docs/changelog/v0.2.11.md @@ -0,0 +1,23 @@ +# v0.2.11 + +EchoHubSpace directory protocol overhaul: authenticated server registration with persistent claim tokens, near-real-time user-count updates, and richer server metadata (tags, multi-host, version). Coordinated cutover with the EchoHubSpace directory deploy. + +## New Features + +- EchoHubSpace claim-token authentication — the directory issues a per-server claim token on first registration, persisted atomically alongside the SQLite database (chmod 0600 on Unix). Subsequent reconnects authenticate with the token instead of relying on raw hostname-squatting protection. Token survives both client and directory restarts; lost tokens require an admin-side `DELETE /api/servers/{id}` on the directory to recover +- Server tags — public servers can advertise topic tags via the new `Server:Tags` config array, surfacing as filter facets in the EchoHubSpace browser +- Multi-host advertisement — a single server can register multiple hostnames (e.g. apex domain, IPv6, alias domains) by listing them in `Server:PublicHosts`. All hosts route to the same directory row +- Server version sent to directory — the EchoHubSpace browser shows what version each public server is running, pulled from the server's assembly informational version +- Operator-facing `GET /api/server/directory` endpoint (Admin role required) — returns `ServerId`, `IsRegistered`, `LastRegisteredAt`, `LastError`, and any `ConflictingHosts` for support tickets. Never exposes the claim token itself, only a `HasClaimToken` boolean + +## Refactoring + +- Replace 30s polling with event-driven directory updates — `PresenceTracker` now raises `UserCountChanged` only when the distinct user count actually changes (multi-tab/multi-connection users no longer trigger). `ServerDirectoryService` consumes via a single-slot `Channel` (latest-wins coalesces bursts) with a 1-second min-interval throttle. Directory reflects user-count changes within ~1s instead of up to 30s stale +- Wrap directory hub responses in a `Response` envelope with `IsSuccess`/`Data`/`Errors`/`Version` shape — protocol version is pinned client-side (currently `1.0`); mismatches trigger a permanent-failure stop with operator-facing log +- Stop attempting re-registration after permanent failures (`HostAlreadyClaimed`, `InvalidToken`, `HostConflict`, `InvalidInput`) — the directory no longer terminates the connection on these errors, so the client suppresses re-register on `Reconnected` to avoid tight retry loops. Operator must restart the server after fixing config + +## Configuration + +- **Breaking**: `Server:PublicHost` (string) renamed to `Server:PublicHosts` (string array). Public servers must update `appsettings.json` — single-host deployments use a one-element array +- New `Server:Tags` (string array) — defaults to empty +- New optional `Server:DirectoryClaimPath` — overrides the path of the persisted claim file. Defaults to a `directory-claim.json` next to the SQLite database. Treat the file as a secret; back it up alongside the database diff --git a/scripts/install.sh b/scripts/install.sh index 7a56afd..3692fa1 100644 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -30,7 +30,7 @@ while [ $# -gt 0 ]; do sed -n '2,8p' "$0" 2>/dev/null || true echo "" echo " curl -sSfL https://raw.githubusercontent.com/$REPO/master/scripts/install.sh | sh" - echo " curl ... | sh -s -- --version 0.2.10" + echo " curl ... | sh -s -- --version 0.2.11" echo " curl ... | sh -s -- --install-dir /opt/echohub" exit 0 ;; diff --git a/src/Directory.Build.props b/src/Directory.Build.props index e74631e..0b9a26a 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -1,6 +1,6 @@ - 0.2.10 + 0.2.11 true $(NoWarn);CS1591 diff --git a/src/EchoHub.Server/Services/ServerDirectoryService.cs b/src/EchoHub.Server/Services/ServerDirectoryService.cs index 72087eb..d5a30da 100644 --- a/src/EchoHub.Server/Services/ServerDirectoryService.cs +++ b/src/EchoHub.Server/Services/ServerDirectoryService.cs @@ -7,7 +7,7 @@ namespace EchoHub.Server.Services; public sealed class ServerDirectoryService : BackgroundService { - private const string DirectoryHubUrl = "https://echohub.voidcube.cloud/hubs/servers"; + private const string DirectoryHubUrl = "https://localhost:5001/hubs/servers"; private static readonly TimeSpan ReconnectBaseDelay = TimeSpan.FromSeconds(2); private static readonly TimeSpan ReconnectMaxDelay = TimeSpan.FromSeconds(30); private static readonly TimeSpan UserCountMinInterval = TimeSpan.FromSeconds(1);