aboutsummaryrefslogtreecommitdiff
path: root/crates/chat-server/web
diff options
context:
space:
mode:
Diffstat (limited to 'crates/chat-server/web')
-rw-r--r--crates/chat-server/web/app.js140
-rw-r--r--crates/chat-server/web/index.html68
-rw-r--r--crates/chat-server/web/javascript.html6
-rw-r--r--crates/chat-server/web/style.css130
4 files changed, 246 insertions, 98 deletions
diff --git a/crates/chat-server/web/app.js b/crates/chat-server/web/app.js
index c06116b..3c97f66 100644
--- a/crates/chat-server/web/app.js
+++ b/crates/chat-server/web/app.js
@@ -86,12 +86,15 @@ function clearState() {
pendingSend = undefined;
setupToken = undefined;
before = 0;
+ element('history-count').max = '0';
+ element('history-range').textContent = 'Latest messages (0-0)';
for (const input of document.querySelectorAll('input,textarea')) {
if (input.id === 'history-count') input.value = '0'; else input.value = '';
}
for (const id of ['messages', 'conversations', 'who', 'fingerprint', 'counts', 'thread-name', 'conversation-fingerprint']) element(id).replaceChildren();
- for (const id of ['create', 'unlock', 'chat', 'thread', 'inbox', 'older', 'retry']) show(id, false);
+ for (const id of ['create', 'unlock', 'chat', 'thread', 'inbox', 'older', 'retry', 'owner-access']) show(id, false);
show('entry', Boolean(config?.owner));
+ show('owner-entry');
status('Locked. Select your file and enter its password to return.');
}
@@ -127,7 +130,7 @@ function download(file) {
async function createIdentity() {
const password = element('new-password').value;
if (password !== element('confirm-password').value) throw new Error('Passwords do not match');
- if (!config.owner && location.hash !== '#setup') throw new Error('Owner setup is required first');
+ if (!config.owner && element('setup-label').hidden) throw new Error('Owner setup is required first');
setupToken = !config.owner ? element('setup-token').value : undefined;
status('Generating your purpose-specific identity and protecting its file...');
const result = await cryptoOperation({ op: 'create', origin: location.origin, name: element('name').value, password, owner: config.owner || '' });
@@ -160,6 +163,8 @@ async function unlockIdentity() {
setupToken = undefined;
config = await api({ op: 'config' });
show('entry', false);
+ show('owner-entry', false);
+ show('owner-access', false);
show('unlock', false);
show('chat');
element('who').textContent = `${identity.name} [${session.owner === true ? 'OWNER' : 'VISITOR'}]`;
@@ -176,7 +181,7 @@ async function unlockIdentity() {
element('conversation-fingerprint').textContent = `Conversation: ${session.id}`;
show('thread');
element('thread-name').textContent = 'You <-> Doan';
- await history(0);
+ await loadHistory(0);
}
status('Unlocked in memory only. No history loaded automatically. Lock or leave to forget this session.');
}
@@ -217,7 +222,7 @@ async function inbox() {
name = profile.name;
}
element('thread-name').textContent = `Doan <-> ${name}`;
- await history(0);
+ await loadHistory(0);
status('Conversation opened. Choose how many messages to load.');
} catch (error) { status(error.message); }
finally { if (generation === current) busy = false; }
@@ -227,42 +232,74 @@ async function inbox() {
}
function counters(conversation) {
+ if (!Number.isSafeInteger(conversation.total) || conversation.total < 0 || conversation.total > 10000) throw new Error('Invalid conversation count');
+ element('history-count').max = String(conversation.total);
+ element('history-range').textContent = `Latest messages (0-${conversation.total})`;
const sent = session.owner ? conversation.owner_sent : conversation.visitor_sent;
const received = session.owner ? conversation.visitor_sent : conversation.owner_sent;
element('counts').textContent = `Total: ${conversation.total} | Sent: ${sent} | Received: ${received}`;
}
-async function history(count, cursor = 0) {
+async function renderHistoryBatch(messages) {
+ const requests = messages.map(message => ({ sender: message.sender === selected.id ? selected.public : config.owner, ciphertext: message.ciphertext }));
+ const decrypted = await cryptoOperation(protectRequest('decrypt_batch', { messages: requests }));
+ for (let index = 0; index < messages.length; index += 1) {
+ const message = messages[index];
+ const item = document.createElement('li');
+ const label = document.createElement('small');
+ label.textContent = `#${message.seq} / ${message.sender === session.id ? 'YOU' : 'THEM'}`;
+ const text = document.createElement('p');
+ try {
+ const entry = decrypted.messages[index];
+ if (entry.signer !== message.sender) throw new Error('Sender fingerprint mismatch');
+ if (entry.error) throw new Error('Invalid ciphertext or signature');
+ const payload = checkedPayload(entry.payload, 'message', selected.id, message.sender);
+ if (payload.id !== message.id || typeof payload.text !== 'string' || new TextEncoder().encode(payload.text).length > 8192) throw new Error('Message binding mismatch');
+ text.textContent = payload.text;
+ } catch { text.textContent = '[Message rejected: invalid ciphertext, signature, or conversation binding.]'; }
+ item.append(label, text);
+ element('messages').prepend(item);
+ }
+}
+
+async function refreshCounts() {
+ const conversation = selected.id;
+ const result = await api({ op: 'history', conversation, count: 0, before: 0 });
+ if (selected?.id === conversation) counters(result.conversation);
+ return result.conversation;
+}
+
+async function loadHistory(count, cursor = 0) {
if (!selected) throw new Error('Choose a conversation first');
- if (!Number.isSafeInteger(count) || count < 0 || count > 50) throw new Error('Choose 0 to 50 messages');
- const result = await api({ op: 'history', conversation: selected.id, count, before: cursor });
- counters(result.conversation);
- if (!cursor) element('messages').replaceChildren();
- if (result.messages.length) {
- status('Decrypting and verifying selected messages locally...');
- const requests = result.messages.map(message => ({ sender: message.sender === selected.id ? selected.public : config.owner, ciphertext: message.ciphertext }));
- const decrypted = await cryptoOperation(protectRequest('decrypt_batch', { messages: requests }));
- for (let index = 0; index < result.messages.length; index += 1) {
- const message = result.messages[index];
- const item = document.createElement('li');
- const label = document.createElement('small');
- label.textContent = `#${message.seq} / ${message.sender === session.id ? 'YOU' : 'THEM'}`;
- const text = document.createElement('p');
- try {
- const entry = decrypted.messages[index];
- if (entry.signer !== message.sender) throw new Error('Sender fingerprint mismatch');
- if (entry.error) throw new Error('Invalid ciphertext or signature');
- const payload = checkedPayload(entry.payload, 'message', selected.id, message.sender);
- if (payload.id !== message.id || typeof payload.text !== 'string' || new TextEncoder().encode(payload.text).length > 8192) throw new Error('Message binding mismatch');
- text.textContent = payload.text;
- } catch { text.textContent = '[Message rejected: invalid ciphertext, signature, or conversation binding.]'; }
- item.append(label, text);
- element('messages').prepend(item);
- }
- before = Math.min(...result.messages.map(message => message.seq));
+ const conversation = await refreshCounts();
+ if (!Number.isSafeInteger(count) || count < 0 || count > conversation.total) throw new Error(`Choose 0 to ${conversation.total} messages`);
+ if (!cursor) { element('messages').replaceChildren(); before = 0; }
+ if (count === 0) {
+ element('history-count').value = '0';
+ show('older', false);
+ status('No message history loaded.');
+ return;
+ }
+ let remaining = count;
+ let next = cursor;
+ let exhausted = false;
+ while (remaining > 0) {
+ const size = Math.min(50, remaining);
+ const result = await api({ op: 'history', conversation: selected.id, count: size, before: next });
+ counters(result.conversation);
+ if (!Array.isArray(result.messages) || result.messages.length > size) throw new Error('Invalid history response');
+ if (!result.messages.length) { exhausted = true; break; }
+ const sequence = Math.min(...result.messages.map(message => message.seq));
+ if (!Number.isSafeInteger(sequence) || sequence <= 0 || (next > 0 && sequence >= next)) throw new Error('Invalid history cursor');
+ status(`Decrypting and verifying selected messages locally (${count - remaining + result.messages.length}/${count})...`);
+ await renderHistoryBatch(result.messages);
+ remaining -= result.messages.length;
+ next = sequence;
+ before = next;
+ if (result.messages.length < size) { exhausted = true; break; }
}
- show('older', count > 0 && result.messages.length === count);
- status(count === 0 ? 'No message history loaded.' : 'Selected history decrypted and verified locally.');
+ show('older', !exhausted && element('messages').children.length < Number(element('history-count').max));
+ status('Selected history decrypted and verified locally.');
}
async function submitPending() {
@@ -289,15 +326,32 @@ async function send() {
await submitPending();
}
-action('create-choice', async () => { show('entry', false); show('create'); status('Create a purpose-specific protected identity file.'); });
-action('open-choice', async () => { show('entry', false); show('unlock'); status('Select your saved identity file.'); });
+function ownerSetup() {
+ show('entry', false);
+ show('owner-entry', false);
+ show('unlock', false);
+ show('create', !config.owner);
+ show('owner-access', Boolean(config.owner));
+ show('setup-label', !config.owner);
+ element('create-title').textContent = 'Create the owner identity (owner only)';
+ status('');
+}
+
+action('create-choice', async () => { show('entry', false); show('owner-entry', false); show('setup-label', false); element('create-title').textContent = 'Create a new chat'; show('create'); status(''); });
+action('open-choice', async () => { show('entry', false); show('owner-entry', false); show('unlock'); status(''); });
+action('owner-choice', async () => { window.history.replaceState(null, '', '#setup'); ownerSetup(); });
+action('owner-open', async () => { show('owner-access', false); show('unlock'); status(''); });
action('create-form', createIdentity);
action('unlock-form', unlockIdentity);
-action('history-form', () => history(Number(element('history-count').value)));
+element('history-count').addEventListener('focus', () => {
+ const current = generation;
+ if (session && selected && !busy) refreshCounts().catch(error => { if (current === generation) status(error.message); });
+});
+action('history-form', () => loadHistory(Number(element('history-count').value)));
action('send-form', send);
action('retry', submitPending);
action('refresh-inbox', inbox);
-action('older', () => history(Number(element('history-count').value), before));
+action('older', () => loadHistory(Number(element('history-count').value), before));
element('lock').addEventListener('click', () => { if (session) api({ op: 'lock' }).catch(() => {}); clearState(); });
window.addEventListener('pagehide', clearState);
window.addEventListener('pageshow', event => { if (event.persisted) clearState(); });
@@ -310,14 +364,10 @@ async function start() {
await wasm;
config = await api({ op: 'config' });
if (config.origin !== location.origin) throw new Error('Server origin mismatch');
- if (!config.owner) {
- if (location.hash === '#setup') {
- show('create');
- show('setup-label');
- element('create-title').textContent = 'Create the dedicated owner identity';
- status('Owner setup. Keep this identity separate from your canonical OpenPGP key.');
- } else { status('Owner setup is not complete. Please return later.'); }
- } else { show('entry'); status('Choose CREATE NEW CHAT or OPEN CHAT FILE.'); }
+ show('owner-entry');
+ show('entry', Boolean(config.owner));
+ status('');
+ if (location.hash === '#setup') ownerSetup();
}
start().catch(error => status(error.message));
diff --git a/crates/chat-server/web/index.html b/crates/chat-server/web/index.html
index 9783789..79026b0 100644
--- a/crates/chat-server/web/index.html
+++ b/crates/chat-server/web/index.html
@@ -25,32 +25,59 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
</head>
<body>
<main>
-<header><a href="https://doan.luuduct.ai/">~doan</a> / message me <span class="status">EXPERIMENTAL / LOCAL TEST</span></header>
-<h1>[ private chat ]</h1>
-<p>Text only. A dedicated identity file. Encrypted for you and Doan.</p>
-<p class="notice">This is an experimental application, not an audited messenger. <a href="/LIMITATIONS.txt">Read its limitations</a> before use. Keep your file and password safe: there is no account recovery.</p>
+<h1 class="sr-only">Message Me</h1>
+<div class="libre-badge">[ <a href="https://www.gnu.org/software/librejs/" aria-describedby="js-warning">GNU LibreJS-compliant</a><span id="js-warning" role="tooltip">LibreJS compliance concerns software freedom, not a guarantee of privacy or security. Review the source code, dependencies, and scripts delivered to your browser. Server-delivered code can change between visits; free software can still track users or behave maliciously.</span> ]
+<a class="script-licenses" href="/javascript.html" rel="jslicense">[ JAVASCRIPT LICENSES ]</a></div>
+<header>
+<pre class="logo-art"><a href="{{SITE_ORIGIN}}/" class="logo" aria-label="Doan Luu Duc Tai home">
+ ____ ___ _ _ _
+| _ \ / _ \ / \ | \ | |
+| | | | | | |/ _ \ | \| |
+| |_| | |_| / ___ \| |\ |
+|____/ \___/_/ \_\_| \_| LUU DUC TAI
+</a></pre>
+<nav class="site-nav" aria-label="Site navigation"><a href="{{SITE_ORIGIN}}/">Home</a><a href="{{SITE_ORIGIN}}/#services">Services</a><a href="/" aria-current="page">Message Me</a></nav>
+</header>
+<div class="ascii-panel introduction">
+<div class="ascii-bar" aria-hidden="true"><span>+</span><span class="ascii-rule">--------------------------------------------------------------------------------</span><span>+</span></div>
+<div class="panel-body">
+<p class="build-status">EXPERIMENTAL / LOCAL TEST</p>
+<p>Keep your file and password. There is no account recovery.<br><a href="/LIMITATIONS.txt">Read the limitations</a> before using this experimental messenger.</p>
+</div>
+<div class="ascii-bar" aria-hidden="true"><span>+</span><span class="ascii-rule">--------------------------------------------------------------------------------</span><span>+</span></div>
+</div>
<p id="status" role="status" aria-live="polite">Loading cryptographic module...</p>
-<section id="entry" hidden>
+<section id="entry" class="actions" hidden>
<button id="create-choice">CREATE NEW CHAT</button>
<button id="open-choice">OPEN CHAT FILE</button>
</section>
+<section id="owner-entry" class="owner-entry" hidden>
+<button id="owner-choice">OWNER SETUP</button>
+<span class="owner-note">/* Owner (Doan Luu Duc Tai) only. */</span>
+</section>
+<section id="owner-access" hidden>
+<h2>Owner access (owner only)</h2>
+<p>An owner identity is already registered. Open your saved owner file with its password.</p>
+<p>If you lost that file, <a href="/LIMITATIONS.txt">reset the chat service from the backend</a> before creating a new owner identity. A reset clears the chat history; it cannot recover the lost key.</p>
+<button id="owner-open">OPEN OWNER FILE</button>
+</section>
<section id="create" hidden>
<h2 id="create-title">Create a new chat</h2>
<form id="create-form" autocomplete="off">
-<label>Display name <input id="name" maxlength="80" required autocomplete="off"></label>
-<label>Password <input id="new-password" type="password" minlength="12" maxlength="1024" required autocomplete="off"></label>
-<label>Confirm password <input id="confirm-password" type="password" minlength="12" required autocomplete="off"></label>
-<label id="setup-label" hidden>Owner setup token from the root .env <input id="setup-token" type="password" autocomplete="off"></label>
+<div class="ascii-field"><div class="ascii-bar field-header"><span aria-hidden="true">+--[ </span><label class="field-heading" for="name">Display name</label><span aria-hidden="true"> ]</span><span class="ascii-rule" aria-hidden="true">--------------------------------------------------------------------------------</span><span aria-hidden="true">+</span></div><div class="field-row"><input id="name" maxlength="80" required autocomplete="off"></div><div class="ascii-bar field-end" aria-hidden="true"><span>+</span><span class="ascii-rule">--------------------------------------------------------------------------------</span><span>+</span></div></div>
+<div class="ascii-field"><div class="ascii-bar field-header"><span aria-hidden="true">+--[ </span><label class="field-heading" for="new-password">Password</label><span aria-hidden="true"> ]</span><span class="ascii-rule" aria-hidden="true">--------------------------------------------------------------------------------</span><span aria-hidden="true">+</span></div><div class="field-row"><input id="new-password" type="password" minlength="12" maxlength="1024" required autocomplete="off"></div><div class="ascii-bar field-end" aria-hidden="true"><span>+</span><span class="ascii-rule">--------------------------------------------------------------------------------</span><span>+</span></div></div>
+<div class="ascii-field"><div class="ascii-bar field-header"><span aria-hidden="true">+--[ </span><label class="field-heading" for="confirm-password">Confirm password</label><span aria-hidden="true"> ]</span><span class="ascii-rule" aria-hidden="true">--------------------------------------------------------------------------------</span><span aria-hidden="true">+</span></div><div class="field-row"><input id="confirm-password" type="password" minlength="12" required autocomplete="off"></div><div class="ascii-bar field-end" aria-hidden="true"><span>+</span><span class="ascii-rule">--------------------------------------------------------------------------------</span><span>+</span></div></div>
+<div class="ascii-field" id="setup-label" hidden><p id="setup-help">Read CHAT_SETUP_TOKEN from your root .env.</p><div class="ascii-bar field-header"><span aria-hidden="true">+--[ </span><label class="field-heading" for="setup-token">Owner setup token</label><span aria-hidden="true"> ]</span><span class="ascii-rule" aria-hidden="true">--------------------------------------------------------------------------------</span><span aria-hidden="true">+</span></div><div class="field-row"><input aria-describedby="setup-help" id="setup-token" type="password" autocomplete="off"></div><div class="ascii-bar field-end" aria-hidden="true"><span>+</span><span class="ascii-rule">--------------------------------------------------------------------------------</span><span>+</span></div></div>
<p>Use a strong, unique passphrase. This identity is solely for this chat; do not reuse it elsewhere.</p>
-<button type="submit">GENERATE AND DOWNLOAD IDENTITY FILE</button>
+<button type="submit">DOWNLOAD IDENTITY FILE</button>
</form>
</section>
<section id="unlock" hidden>
<h2>Open your saved identity file</h2>
<p id="reopen-note">Your file is opened locally. The file and password are never uploaded.</p>
<form id="unlock-form" autocomplete="off">
-<label>Identity file <input id="file" type="file" required></label>
-<label>Password <input id="password" type="password" required autocomplete="off"></label>
+<div class="ascii-field"><div class="ascii-bar field-header"><span aria-hidden="true">+--[ </span><label class="field-heading" for="file">Identity file</label><span aria-hidden="true"> ]</span><span class="ascii-rule" aria-hidden="true">--------------------------------------------------------------------------------</span><span aria-hidden="true">+</span></div><div class="field-row"><input id="file" type="file" required></div><div class="ascii-bar field-end" aria-hidden="true"><span>+</span><span class="ascii-rule">--------------------------------------------------------------------------------</span><span>+</span></div></div>
+<div class="ascii-field"><div class="ascii-bar field-header"><span aria-hidden="true">+--[ </span><label class="field-heading" for="password">Password</label><span aria-hidden="true"> ]</span><span class="ascii-rule" aria-hidden="true">--------------------------------------------------------------------------------</span><span aria-hidden="true">+</span></div><div class="field-row"><input id="password" type="password" required autocomplete="off"></div><div class="ascii-bar field-end" aria-hidden="true"><span>+</span><span class="ascii-rule">--------------------------------------------------------------------------------</span><span>+</span></div></div>
<button type="submit">UNLOCK CHAT</button>
</form>
</section>
@@ -62,20 +89,19 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
<h3 id="thread-name"></h3>
<p id="conversation-fingerprint"></p>
<p id="counts"></p>
-<form id="history-form"><label>Latest messages to load (0–50) <input id="history-count" type="number" min="0" max="50" step="1" value="0" required></label><button type="submit">LOAD HISTORY</button></form>
+<form id="history-form" novalidate><div class="ascii-field"><div class="ascii-bar field-header"><span aria-hidden="true">+--[ </span><label id="history-range" class="field-heading" for="history-count">Latest messages (0-0)</label><span aria-hidden="true"> ]</span><span class="ascii-rule" aria-hidden="true">--------------------------------------------------------------------------------</span><span aria-hidden="true">+</span></div><div class="field-row"><input id="history-count" type="number" min="0" max="0" step="1" value="0" required></div><div class="ascii-bar field-end" aria-hidden="true"><span>+</span><span class="ascii-rule">--------------------------------------------------------------------------------</span><span>+</span></div></div><button type="submit">LOAD HISTORY</button></form>
<button id="older" hidden>LOAD OLDER</button>
<ol id="messages" aria-label="Messages"></ol>
-<form id="send-form" autocomplete="off"><label>Plain text message (up to 8192 UTF-8 bytes) <textarea id="text" rows="5" required maxlength="8192" autocomplete="off"></textarea></label><button type="submit">ENCRYPT AND SEND</button></form>
-<button id="retry" hidden>RETRY THE SAME ENCRYPTED MESSAGE</button>
+<p id="message-limit">Plain text only. Up to 8192 UTF-8 bytes per message.</p>
+<form id="send-form" autocomplete="off"><div class="ascii-field"><div class="ascii-bar field-header"><span aria-hidden="true">+--[ </span><label class="field-heading" for="text">Message body</label><span aria-hidden="true"> ]</span><span class="ascii-rule" aria-hidden="true">--------------------------------------------------------------------------------</span><span aria-hidden="true">+</span></div><div class="field-row"><textarea aria-describedby="message-limit" id="text" rows="5" required maxlength="8192" autocomplete="off"></textarea></div><div class="ascii-bar field-end" aria-hidden="true"><span>+</span><span class="ascii-rule">--------------------------------------------------------------------------------</span><span>+</span></div></div><button type="submit">ENCRYPT AND SEND</button></form>
+<button id="retry" hidden>RETRY MESSAGE</button>
</section>
</section>
<noscript>This chat requires free JavaScript and WebAssembly for local cryptography. The main website remains JavaScript-free.</noscript>
-<footer>
-<p><a class="badge" href="https://www.gnu.org/software/librejs/" aria-describedby="js-warning">GNU LibreJS-compliant</a><span id="js-warning" role="tooltip">LibreJS compliance concerns software freedom, not a guarantee of privacy or security. Review the source code, dependencies, and scripts delivered to your browser. Server-delivered code can change between visits; free software can still track users or behave maliciously.</span></p>
-<a href="https://www.gnu.org/licenses/agpl-3.0.html">LICENSE</a>
-<a href="/THIRD-PARTY-LICENSES.html">THIRD PARTY LICENSES</a>
-<a href="/SOURCE.tar.gz">CORRESPONDING SOURCE CODE</a>
-<a href="/javascript.html" rel="jslicense">JAVASCRIPT LICENSES / RAW SOURCE</a>
+<footer class="source-footer" aria-label="Licensing and source">
+<a class="project-license" href="https://www.gnu.org/licenses/agpl-3.0.html">[ LICENSE ]</a>
+<a class="dependency-licenses" href="/THIRD-PARTY-LICENSES.html">[ THIRD PARTY LICENSES ]</a>
+<a href="/SOURCE.tar.gz">[ SOURCE CODE ]</a>
</footer>
</main>
</body>
diff --git a/crates/chat-server/web/javascript.html b/crates/chat-server/web/javascript.html
index 927a678..205a103 100644
--- a/crates/chat-server/web/javascript.html
+++ b/crates/chat-server/web/javascript.html
@@ -15,14 +15,14 @@ You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
-->
<!doctype html>
-<html lang="en"><head><meta charset="utf-8"><title>JavaScript licenses</title><link rel="stylesheet" href="/style.css"></head><body><main>
+<html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><title>JavaScript licenses</title><link rel="stylesheet" href="/style.css"></head><body><main class="license-page">
<h1>JavaScript licenses and source</h1>
<p>All first-party scripts are available under the GNU Affero General Public License, version 3 or, at your option, any later version. The table uses the license identifiers recognized by GNU LibreJS.</p>
-<table id="jslicense-labels1"><thead><tr><th>Script / raw file</th><th>License</th><th>Corresponding source</th></tr></thead><tbody>
+<div class="license-table"><table id="jslicense-labels1"><thead><tr><th>Script / raw file</th><th>License</th><th>Corresponding source</th></tr></thead><tbody>
<tr><td><a href="/app.js">app.js</a></td><td><a href="https://www.gnu.org/licenses/agpl-3.0.html">GNU-AGPL-3.0</a></td><td><a href="/SOURCE.tar.gz">Complete corresponding source</a></td></tr>
<tr><td><a href="/worker.js">worker.js</a></td><td><a href="https://www.gnu.org/licenses/agpl-3.0.html">GNU-AGPL-3.0</a></td><td><a href="/SOURCE.tar.gz">Complete corresponding source</a></td></tr>
<tr><td><a href="/wasi.mjs">wasi.mjs</a></td><td><a href="https://www.gnu.org/licenses/agpl-3.0.html">GNU-AGPL-3.0</a></td><td><a href="/SOURCE.tar.gz">Complete corresponding source</a></td></tr>
-</tbody></table>
+</tbody></table></div>
<p>The WebAssembly module is compiled from the Rust workspace and unmodified OpenSSL 3.6.5, under their respective free software licenses. The source archive includes first-party sources, Cargo dependencies, the OpenSSL source archive, build scripts, and notices. General-purpose Rust and WASI SDK tools are documented with verified download locations in CHAT-OPENSSL-MIGRATION.txt.</p>
<p><a href="/THIRD-PARTY-LICENSES.html">Third-party licenses</a> / <a href="/SOURCE.tar.gz">Source archive</a> / <a href="/">Return</a></p>
</main></body></html>
diff --git a/crates/chat-server/web/style.css b/crates/chat-server/web/style.css
index 0983b2e..5587f58 100644
--- a/crates/chat-server/web/style.css
+++ b/crates/chat-server/web/style.css
@@ -14,36 +14,108 @@ GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
+
+:root {
+ color-scheme: light dark;
+ --background: #fff;
+ --foreground: #000;
+ --link: #06c;
+ --logo: #a00;
+ --good: #090;
+ --warning: #806000;
+ --license: #923900;
+ --third-party: #355b3c;
+ --muted: #555;
+}
+
* { box-sizing: border-box; }
-:root { color-scheme: dark; font-family: "Courier New", monospace; background: #131715; color: #d4d8cd; line-height: 1.6; }
-body { margin: 0; }
-main { max-width: 58rem; margin: 2rem auto; padding: 0 1.25rem; }
-header, footer { border-top: 1px solid #667367; padding-top: 1rem; }
-header { display: flex; flex-wrap: wrap; gap: .6rem; }
-h1 { font-size: 1.8rem; color: #e3e3ce; }
-h2, h3 { font-size: 1.05rem; }
-a { color: #aec2a5; text-underline-offset: .2rem; }
-.status, .badge { color: #e0c46d; }
-.status { margin-left: auto; }
-.notice { border-left: 2px solid #c5ad68; padding-left: 1rem; }
-button, input, textarea { font: inherit; color: inherit; background: #1c231e; border: 1px solid #667367; border-radius: 0; padding: .55rem .7rem; }
-button { cursor: pointer; margin: .4rem .6rem .4rem 0; }
-button:hover, button:focus-visible { border-color: #d7c884; color: #f0e5b0; }
+html { overflow-y: scroll; scrollbar-gutter: stable; }
+body { overflow: visible; font: 16px/1.5 monospace, monospace; margin: 0; background: var(--background); color: var(--foreground); }
+main { width: 80ch; max-width: calc(100% - 32px); margin: 16px auto; position: relative; }
+a { color: var(--link); text-decoration: none; }
+a:hover { text-decoration: underline; }
+a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid var(--link); outline-offset: 4px; }
+.logo-art { font: inherit; line-height: 1.2; margin: 0 0 2em; overflow: visible; }
+.logo { color: var(--logo); display: inline-block; }
+.logo:hover { text-decoration: none; }
+.site-nav { display: flex; flex-wrap: wrap; gap: 2ch; margin: 0 0 2em; }
+.site-nav [aria-current] { color: inherit; }
+h1, h2, h3 { font: inherit; font-weight: bold; }
+h1 { margin: 0; }
+h2, h3 { margin: 0 0 1em; }
+p { margin: 0 0 1em; }
+.introduction { text-align: center; }
+.introduction p:last-child { margin-bottom: 0; }
+.build-status, .notice { color: var(--warning); }
+.ascii-bar { display: flex; white-space: pre; line-height: 1.5; user-select: none; }
+.ascii-rule { flex: 1; min-width: 0; overflow: hidden; }
+.panel-body { padding: 1em 2ch; background-image: repeating-linear-gradient(to bottom, currentColor 0 1em, transparent 1em 1.5em), repeating-linear-gradient(to bottom, currentColor 0 1em, transparent 1em 1.5em); background-size: 1px 100%; background-position: .5ch 0, calc(100% - .5ch) 0; background-repeat: no-repeat; }
+.ascii-panel { margin: 1.5em 0; }
+.ascii-field { margin: 1.5em 0; }
+.field-heading { white-space: nowrap; font-weight: normal; margin: 0; }
+.field-row { background-image: repeating-linear-gradient(to bottom, currentColor 0 1em, transparent 1em 1.5em), repeating-linear-gradient(to bottom, currentColor 0 1em, transparent 1em 1.5em); background-size: 1px 100%; background-position: .5ch 0, calc(100% - .5ch) 0; background-repeat: no-repeat; padding: .25em 2ch; display: flex; gap: 1ch; align-items: baseline; }
+.field-row::before { content: '>'; color: var(--good); font-weight: bold; }
+.field-end { height: 1.5em; }
+button, input, textarea { font: inherit; color: inherit; background: transparent; border-radius: 0; }
+button { appearance: none; border: 0; padding: 0; margin: .5em 2ch .5em 0; color: var(--link); font-weight: bold; cursor: pointer; }
+button::before { content: '[ < '; }
+button::after { content: ' > ]'; }
+button:hover { text-decoration: underline; }
button:disabled { opacity: .5; cursor: wait; }
-input, textarea { display: block; width: 100%; margin: .35rem 0 1rem; }
-input[type=number] { width: 8rem; }
+#create-choice, #create-form button, #unlock-form button, #send-form button { color: var(--good); }
+#lock { color: var(--logo); }
+#retry { color: var(--warning); }
+input, textarea { appearance: none; border: 0; padding: 0; margin: 0; min-width: 0; width: 100%; line-height: 1.5; }
+input[type=file] { font-size: .875em; }
+input[type=file]::file-selector-button { font: inherit; color: var(--link); background: transparent; border: 1px dashed currentColor; margin-right: 1ch; padding: .2em 1ch; cursor: pointer; }
+input[type=number] { width: 7ch; }
+textarea { resize: vertical; min-height: 7.5em; }
label { display: block; }
-section { margin: 1.5rem 0; }
+section { margin: 2em 0; }
[hidden] { display: none !important; }
-.chat-heading { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; }
-#fingerprint, #conversation-fingerprint { overflow-wrap: anywhere; font-size: .8rem; }
-#messages { padding: 0; list-style: none; }
-#messages li { border-top: 1px dashed #48564a; padding: 1rem 0; }
-#messages p { white-space: pre-wrap; overflow-wrap: anywhere; margin: .4rem 0; }
-#messages small { color: #a8b39e; }
-#status { min-height: 1.6rem; color: #e0c46d; }
-footer { margin-top: 3rem; padding-bottom: 2rem; }
-footer > a { display: block; width: fit-content; }
-footer p { position: relative; }
-#js-warning { display: none; max-width: 48rem; border: 1px solid #c5ad68; background: #1c231e; padding: 1rem; margin: .8rem 0; }
-.badge:hover + #js-warning, .badge:focus-visible + #js-warning { display: block; }
+.actions { display: flex; flex-wrap: wrap; gap: 0 2ch; }
+.actions button { margin-right: 0; }
+.chat-heading { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 1ch; }
+.chat-heading h2 { margin-bottom: 0; }
+#fingerprint, #conversation-fingerprint { overflow-wrap: anywhere; font-size: .875em; color: var(--muted); margin-top: 1em; }
+#thread { margin-top: 3em; }
+#counts { color: var(--good); }
+#history-form { display: flex; flex-wrap: wrap; align-items: baseline; gap: 1ch 2ch; }
+#history-form .ascii-field { flex: 0 1 31ch; min-width: 24ch; margin: .5em 0; }
+#messages { padding: 0; list-style: none; margin: 2em 0; }
+#messages li::before { content: '--------------------------------------------------------------------------------'; display: block; overflow: hidden; white-space: pre; margin: 1em 0; }
+#messages p { white-space: pre-wrap; overflow-wrap: anywhere; margin: .5em 0 1em; }
+#messages small { color: var(--link); font: inherit; }
+#status:empty { display: none; }
+#status { min-height: 1.5em; color: var(--link); margin: 2em 0 1em; padding-left: 2ch; position: relative; }
+#status::before { content: '>'; color: var(--good); position: absolute; left: 0; font-weight: bold; }
+.libre-badge { position: absolute; top: 0; right: 0; color: var(--warning); font-weight: bold; }
+.libre-badge > a[aria-describedby] { color: inherit; text-decoration: underline wavy; text-underline-offset: .2em; }
+#js-warning { display: none; position: absolute; top: 2em; right: 0; width: 48ch; max-width: calc(100vw - 32px); padding: 1em 2ch; background: var(--background); color: var(--foreground); border: 1px dashed var(--warning); z-index: 1; font-weight: normal; }
+.libre-badge > a[aria-describedby]:hover + #js-warning, .libre-badge > a[aria-describedby]:focus-visible + #js-warning { display: block; }
+.script-licenses { display: block; color: var(--link); font-size: .875em; text-align: right; margin-top: .5em; }
+.owner-entry { display: flex; flex-wrap: wrap; align-items: baseline; gap: .5em 1ch; margin: 1em 0; }
+.owner-entry button { margin-right: 0; }
+.owner-note { color: var(--muted); font-size: .875em; }
+.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
+.source-footer { display: flex; flex-direction: column; align-items: flex-end; gap: .5em; text-align: right; margin: 3em 0 1em; font-weight: bold; }
+.source-footer::before { content: '________________________________________________________________________________'; display: block; width: 100%; overflow: hidden; white-space: pre; margin-bottom: 1em; font-weight: normal; }
+.project-license { color: var(--license); }
+.dependency-licenses { color: var(--third-party); }
+.license-page h1 { margin: 2em 0 1em; }
+.license-table { overflow-x: auto; }
+table { border-collapse: collapse; width: 100%; font: inherit; }
+th, td { padding: .75em 1ch; text-align: left; border-bottom: 1px dashed currentColor; vertical-align: top; }
+
+@media (prefers-color-scheme: dark) {
+ :root { --background: #000; --foreground: #fff; --link: #6cf; --logo: #f33; --good: #0f0; --warning: #fc3; --license: #efb366; --third-party: #a3c7a8; --muted: #aaa; }
+}
+
+@media (max-width: 600px) {
+ .libre-badge { position: relative; width: fit-content; margin: 0 0 2em auto; }
+ .logo-art { font-size: clamp(10px, 2.4vw, 16px); }
+ .field-heading { font-size: .875em; }
+ .panel-body { padding-inline: 2ch; }
+ .source-footer { align-items: flex-start; text-align: left; }
+ .actions { flex-direction: column; align-items: flex-start; }
+}