Files
2026-04-24 14:14:33 +00:00

138 lines
8.2 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>v0.2.11 | EchoHub Documentation </title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="title" content="v0.2.11 | EchoHub Documentation ">
<link rel="icon" href="../images/hue_icon.svg">
<link rel="stylesheet" href="../public/docfx.min.css">
<link rel="stylesheet" href="../public/main.css">
<meta name="docfx:navrel" content="../toc.html">
<meta name="docfx:tocrel" content="toc.html">
<meta name="docfx:rel" content="../">
<meta name="docfx:docurl" content="https://github.com/HueByte/EchoHub/blob/master/docs/#L1">
<meta name="loc:inThisArticle" content="In this article">
<meta name="loc:searchResultsCount" content="{count} results for &quot;{query}&quot;">
<meta name="loc:searchNoResults" content="No results for &quot;{query}&quot;">
<meta name="loc:tocFilter" content="Filter by title">
<meta name="loc:nextArticle" content="Next">
<meta name="loc:prevArticle" content="Previous">
<meta name="loc:themeLight" content="Light">
<meta name="loc:themeDark" content="Dark">
<meta name="loc:themeAuto" content="Auto">
<meta name="loc:changeTheme" content="Change theme">
<meta name="loc:copy" content="Copy">
<meta name="loc:downloadPdf" content="Download PDF">
<script type="module" src="./../public/docfx.min.js"></script>
<script>
const theme = localStorage.getItem('theme') || 'auto'
document.documentElement.setAttribute('data-bs-theme', theme === 'auto' ? (window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light') : theme)
</script>
</head>
<body class="tex2jax_ignore" data-layout="" data-yaml-mime="">
<header class="bg-body border-bottom">
<nav id="autocollapse" class="navbar navbar-expand-md" role="navigation">
<div class="container-xxl flex-nowrap">
<a class="navbar-brand" href="../index.html">
<img id="logo" class="svg" src="../images/hue_icon.svg" alt="EchoHub">
EchoHub
</a>
<button class="btn btn-lg d-md-none border-0" type="button" data-bs-toggle="collapse" data-bs-target="#navpanel" aria-controls="navpanel" aria-expanded="false" aria-label="Toggle navigation">
<i class="bi bi-three-dots"></i>
</button>
<div class="collapse navbar-collapse" id="navpanel">
<div id="navbar">
<form class="search" role="search" id="search">
<i class="bi bi-search"></i>
<input class="form-control" id="search-query" type="search" disabled placeholder="Search" autocomplete="off" aria-label="Search">
</form>
</div>
</div>
</div>
</nav>
</header>
<main class="container-xxl">
<div class="toc-offcanvas">
<div class="offcanvas-md offcanvas-start" tabindex="-1" id="tocOffcanvas" aria-labelledby="tocOffcanvasLabel">
<div class="offcanvas-header">
<h5 class="offcanvas-title" id="tocOffcanvasLabel">Table of Contents</h5>
<button type="button" class="btn-close" data-bs-dismiss="offcanvas" data-bs-target="#tocOffcanvas" aria-label="Close"></button>
</div>
<div class="offcanvas-body">
<nav class="toc" id="toc"></nav>
</div>
</div>
</div>
<div class="content">
<div class="actionbar">
<button class="btn btn-lg border-0 d-md-none" type="button" data-bs-toggle="offcanvas" data-bs-target="#tocOffcanvas" aria-controls="tocOffcanvas" aria-expanded="false" aria-label="Show table of contents">
<i class="bi bi-list"></i>
</button>
<nav id="breadcrumb"></nav>
</div>
<article data-uid="">
<h1 id="v0211">v0.2.11</h1>
<p>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.</p>
<h2 id="new-features">New Features</h2>
<ul>
<li>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 <code>DELETE /api/servers/{id}</code> on the directory to recover</li>
<li>Server tags — public servers can advertise topic tags via the new <code>Server:Tags</code> config array, surfacing as filter facets in the EchoHubSpace browser</li>
<li>Multi-host advertisement — a single server can register multiple hostnames (e.g. apex domain, IPv6, alias domains) by listing them in <code>Server:PublicHosts</code>. All hosts route to the same directory row</li>
<li>Server version sent to directory — the EchoHubSpace browser shows what version each public server is running, pulled from the server's assembly informational version</li>
<li>Operator-facing <code>GET /api/server/directory</code> endpoint (Admin role required) — returns <code>ServerId</code>, <code>IsRegistered</code>, <code>LastRegisteredAt</code>, <code>LastError</code>, and any <code>ConflictingHosts</code> for support tickets. Never exposes the claim token itself, only a <code>HasClaimToken</code> boolean</li>
</ul>
<h2 id="refactoring">Refactoring</h2>
<ul>
<li>Replace 30s polling with event-driven directory updates — <code>PresenceTracker</code> now raises <code>UserCountChanged</code> only when the distinct user count actually changes (multi-tab/multi-connection users no longer trigger). <code>ServerDirectoryService</code> consumes via a single-slot <code>Channel&lt;int&gt;</code> (latest-wins coalesces bursts) with a 1-second min-interval throttle. Directory reflects user-count changes within ~1s instead of up to 30s stale</li>
<li>Wrap directory hub responses in a <code>Response&lt;T&gt;</code> envelope with <code>IsSuccess</code>/<code>Data</code>/<code>Errors</code>/<code>Version</code> shape — protocol version is pinned client-side (currently <code>1.0</code>); mismatches trigger a permanent-failure stop with operator-facing log</li>
<li>Stop attempting re-registration after permanent failures (<code>HostAlreadyClaimed</code>, <code>InvalidToken</code>, <code>HostConflict</code>, <code>InvalidInput</code>) — the directory no longer terminates the connection on these errors, so the client suppresses re-register on <code>Reconnected</code> to avoid tight retry loops. Operator must restart the server after fixing config</li>
</ul>
<h2 id="configuration">Configuration</h2>
<ul>
<li><strong>Breaking</strong>: <code>Server:PublicHost</code> (string) renamed to <code>Server:PublicHosts</code> (string array). Public servers must update <code>appsettings.json</code> — single-host deployments use a one-element array</li>
<li>New <code>Server:Tags</code> (string array) — defaults to empty</li>
<li>New optional <code>Server:DirectoryClaimPath</code> — overrides the path of the persisted claim file. Defaults to a <code>directory-claim.json</code> next to the SQLite database. Treat the file as a secret; back it up alongside the database</li>
</ul>
</article>
<div class="contribution d-print-none">
<a href="https://github.com/HueByte/EchoHub/blob/master/docs/#L1" class="edit-link">Edit this page</a>
</div>
<div class="next-article d-print-none border-top" id="nextArticle"></div>
</div>
<div class="affix">
<nav id="affix"></nav>
</div>
</main>
<div class="container-xxl search-results" id="search-results"></div>
<footer class="border-top text-secondary">
<div class="container-xxl">
<div class="flex-fill">
<div class='footer-custom'><div class='footer-inner'><span class='footer-brand'>EchoHub</span><span class='footer-sep'>&middot;</span><a href='https://github.com/HueByte/EchoHub'>GitHub</a><span class='footer-sep'>&middot;</span><a href='https://echohub.voidcube.cloud'>Website</a></div></div>
</div>
</div>
</footer>
</body>
</html>