tracker
All repositories: gitoria
3.4 KB
// tls-on-plain-port.mjs — a TLS ClientHello sent to a plain hl:http1 port must be// closed at once, not held open until the client times out (routger, 2026-09-27:// Firefox's HTTPS-First tries https:// first on any non-localhost name, so the// page "loaded forever" instead of falling back to http). Drives the built// libhttp1.so through the interpreter (tls_on_plain_port.hl), then talks to it// with raw sockets — this is protocol-shape testing, below what an .hl fixture// can reach.import { spawn } from 'node:child_process';import { connect } from 'node:net';import { fileURLToPath } from 'node:url';import { dirname, resolve } from 'node:path';const HERE = dirname(fileURLToPath(import.meta.url));const ROOT = resolve(HERE, '../../..');const BIN = resolve(ROOT, 'native/zig-out/bin/hybriel');const FIXTURE = resolve(HERE, 'tls_on_plain_port.hl');const PORT = Number(process.env.HL_TEST_PORT || 14980);const sleep = (ms) => new Promise((r) => setTimeout(r, ms));let failed = false;const fail = (msg) => { console.log('FAIL ' + msg); failed = true; };const server = spawn(BIN, [FIXTURE], {env: { ...process.env, HL_TEST_PORT: String(PORT) },stdio: ['ignore', 'pipe', 'pipe'],});let log = '';server.stdout.on('data', (d) => { log += d; });server.stderr.on('data', (d) => { log += d; });let up = false;for (let i = 0; i < 80; i++) {try {const r = await fetch(`http://127.0.0.1:${PORT}/`);if (r.status === 200) { up = true; break; }} catch {}await sleep(250);}if (!up) {console.log('FAIL server did not come up\n' + log.slice(0, 4000));server.kill('SIGKILL');process.exit(1);}// A TLS 1.2-shaped ClientHello record header: content type 0x16 (handshake),// version 0x03 0x03, followed by a plausible length and a few handshake bytes.// The fix only looks at the first two bytes, but this is what a real client// sends, so the fixture proves it against a realistic prefix.const clientHello = Buffer.from([0x16, 0x03, 0x03, 0x00, 0x2f, // TLS record: handshake, TLS 1.2, length 0x2f0x01, 0x00, 0x00, 0x2b, // handshake: ClientHello, length 0x2b0x03, 0x03, // client_version 1.2...Array(32).fill(0x42), // "random"]);const closedInTime = await new Promise((resolvePromise) => {const sock = connect(PORT, '127.0.0.1');const start = Date.now();let settled = false;sock.on('connect', () => sock.write(clientHello));sock.on('close', () => {if (settled) return;settled = true;resolvePromise(Date.now() - start);});sock.on('error', () => {}); // ECONNRESET counts as closedsetTimeout(() => {if (settled) return;settled = true;sock.destroy();resolvePromise(-1); // never closed within the budget}, 1000);});if (closedInTime < 0) {fail(`TLS ClientHello prefix was NOT closed within 1000ms`);} else {console.log(`ClientHello prefix closed in ${closedInTime}ms`);}// Plain HTTP on the same port must still answer — the fix must not have// turned the port TLS-only or broken ordinary requests.try {const r = await fetch(`http://127.0.0.1:${PORT}/`);const body = await r.text();if (r.status === 200 && body === 'ok') {console.log('plain HTTP still answers: 200 ok');} else {fail(`plain HTTP answered ${r.status} ${JSON.stringify(body)}`);}} catch (e) {fail(`plain HTTP request threw: ${e}`);}server.kill('SIGTERM');await sleep(300);if (!server.killed) server.kill('SIGKILL');console.log(failed ? 'FAIL' : 'PASS');process.exit(failed ? 1 : 0);
Branches
- mainmain branch
Latest commits
- 0553b51ftracker#19 (mission 066): franchises and timelines — tables, /franchises, /franchises/<slug>, /timelines/<slug> (Timeline | Release sort, series by last episode), the Prequel | Timeline | Sequel widget with the franchise above, the creator's editor, TMDB collection seed in the app (resumes, paced); gate tests/franchises.mjs 48/0 + browser.mjs 266/0, tests/realdata-066.mjs, docs/franchises.md, README + STATUSmre
- fa1f9dfatracker#29 (mission 063): unwatched check muted grey outline + check (accent only on hover), watched stays solid — no code regression, the accent outline read as ticked; gate checks real checks visibly (computed style + screenshot pixel) on /my/unwatched, show, movie, /my/movies; gate 266, tests/realdata-063.mjs, README + STATUSmre
- d8b12d67tracker#27 (mission 060): short ids for movies, series and persons — old 702 kept (data/old-short-ids.json), new random [a-z0-9]{5} unique across both, claimed at creation, background backfill (resumes), shown under poster/photo, /<shortId> → 301; gate 259, tests/realdata-060*, README + STATUSmre
- f14db671tracker#22-#25 (mission 058): episode air dates, season check = all episodes watched, movie watched check (+ /my/movies count), /genres/<genre> pages (movies + series, newest first, paginated); gate 238, tests/realdata-058.mjs, README + STATUSmre
- 1704ec45tracker#17 (mission 057): season caret down/up, skeleton rows while a season loads, sessionless showSeasonEpisodes face (no page re-mount), client-only close; gate 214, tests/realdata-057.mjs, README + STATUSmre
- f2fe3e36mission 056: README + STATUS (merge, fixes, Hybriel 8590df63, real-data check), tests/realdata-056.mjs, tools/check-public-slugs.hlmre
- f40c250emission 056: re-vendor hybriel master 8590df63 (#121, #122); an adult title's page is Not found for non-followers; gate: leave the page before stopping the servermre
- 2b7fdd6cmission 056: signed-out header one row on phones ("Log in", nowrap), backfill skips adult titles' posters, gate checksmre
- 2c53d5efMerge branch 't16-person' (tracker#16 person pages) into main; filmography shows only public titles (054 adult flag), gate race fix (backfill start line)mre
- c171227emission 054: hide adult/unknown titles from the public lists and the search; in-app adult-flag backfill (TMDB details + poster per title, resumes), gate + real-data proofmre
- 139fafd8tracker#16: short bio (4 lines, click = all), real-data check script, README + STATUSmre
- 93be9476tracker#16: person pages /person/<slug> with the filmography fetched from TMDB on the first visit (step by step), gatemre
- 47a3cae6STATUS: mission 053 merge commit idsmre
- dcc5eecaMerge branch 't14-search'mre
- 03edc783Merge branch 't15-tvmaze'mre
- 71b46345tracker#15: numbering check by date or title, placeholder titles in other languages, docs + real-data proofmre
- 6bb2daf1tracker#13: homepage (tiles, intro, latest movies/shows), /shows, /movies/page/N, /my/movies; lists cached in memorymre
- b8bd1157tracker#14: README + STATUS (search, real-data numbers, gate, merge notes)mre
- 65c694a8tracker#14: search — header magnifier, /search/<text> (in-memory word-prefix index over titles + people), Fetch from web (TMDB search/multi, ours left out), Add = import via syncShow; gate +25 checks, real-data scriptmre
- 34f2c15btracker#15: TVmaze merge in the sync (gaps only: new episodes/seasons, empty titles/air dates; numbering check), fake TVmaze episodes + gatemre