gitoria

calendar

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commite9fec7bbe9fec7bb|||PR HL-STANDARD clean-up: typed parameters, plain locals, by-reference cacheAtlase9fec7bb/tests/security.mjs

21.4 KB

  1. // tests/security.mjs — SECURITY GATE of calendar.worldapi.org (mission SC): real HTTP requests against a real local
  2. // calendar + its own ident (tests/identkit.mjs). Who may do what (signed out / another user / owner) on every route and face;
  3. // injection; the session cookie; secrets; the answer headers.
  4. // node tests/security.mjs (CALENDAR_SEC_PORT default 8912 = the app, +1 the https-configured app, +2 ident)
  5. // Known hl:web gaps are PRINTED as `known:` lines, not counted.
  6. import { spawn } from 'node:child_process';
  7. import { request } from 'node:http';
  8. import { mkdirSync, rmSync, existsSync, readFileSync, readdirSync } from 'node:fs';
  9. import { dirname, join, resolve } from 'node:path';
  10. import { fileURLToPath } from 'node:url';
  11. import { generateKeyPairSync } from 'node:crypto';
  12. import { startIdent } from './identkit.mjs';
  13. const HERE = dirname(fileURLToPath(import.meta.url));
  14. const APP = resolve(HERE, '..');
  15. const PORT = Number(process.env.CALENDAR_SEC_PORT || 8912), PORT2 = PORT + 1, IDENT_PORT = PORT + 2;
  16. const IDENT_DIR = process.env.CALENDAR_GATE_IDENT_DIR || [resolve(APP, '../ident.worldapi.org'), '/media/STORAGE/projects/WorldAPI/ident.worldapi.org'].find(d => existsSync(join(d, 'project.hl')));
  17. const STORE = resolve(process.env.CALENDAR_SEC_SCRATCH || join(APP, '.scratch/sec-store'));
  18. const J = JSON.stringify, sleep = (ms) => new Promise(r => setTimeout(r, ms));
  19. let passes = 0, failures = 0;
  20. const check = (label, ok, detail = '') => { console.log(`${ok ? 'ok ' : 'FAIL'} ${label}${ok ? '' : ' — ' + detail}`); if (ok) passes++; else failures++; };
  21. const known = (label) => console.log('known: ' + label);
  22. const info = (label) => { if (process.env.SEC_INFO) console.log('info: ' + label); };
  23. function raw(port, method, path, { host = `localhost:${port}`, headers = {}, body = null, cookie = null } = {}) {
  24. return new Promise((res, rej) => {
  25. const h = { host, ...headers }; if (cookie) h.cookie = cookie;
  26. if (body !== null) h['content-length'] = Buffer.byteLength(body);
  27. const r = request({ host: '127.0.0.1', port, method, path, headers: h }, (m) => { const c = []; m.on('data', d => c.push(d)); m.on('end', () => res({ status: m.statusCode, headers: m.headers, body: Buffer.concat(c).toString('latin1') })); });
  28. r.on('error', rej); if (body !== null) r.write(body); r.end();
  29. });
  30. }
  31. const get = (path, o = {}) => raw(PORT, 'GET', path, o);
  32. const procs = [];
  33. function spawnServer(port, base, env) {
  34. let log = '';
  35. const p = spawn(join(APP, 'bin/hybriel'), ['project.hl'], { cwd: APP, stdio: ['ignore', 'pipe', 'pipe'],
  36. env: { ...process.env, CALENDAR_PORT: String(port), CALENDAR_WATCH: '0', CALENDAR_PUBLIC_URL: base, HL_HOST: '127.0.0.1', ...env } });
  37. p.stdout.on('data', d => log += d); p.stderr.on('data', d => log += d); procs.push(p);
  38. return { p, log: () => log };
  39. }
  40. async function up(port, srv) {
  41. for (let i = 0; i < 960; i++) { try { if ((await raw(port, 'GET', '/')).status === 200) return; } catch {} await sleep(250); }
  42. throw new Error('calendar did not come up\n' + srv.log());
  43. }
  44. let ident;
  45. try {
  46. rmSync(STORE, { recursive: true, force: true }); mkdirSync(STORE, { recursive: true });
  47. ident = await startIdent({ identDir: IDENT_DIR, workDir: join(STORE, 'ident'), port: IDENT_PORT });
  48. const alice = await ident.signIn('[email protected]'), bob = await ident.signIn('[email protected]');
  49. const BASE = `http://localhost:${PORT}`;
  50. const app = await ident.registerApp(alice, 'calendar (security gate)', [BASE]);
  51. const env = (d) => ({ CALENDAR_STORAGE: join(STORE, d, 'mpackdb'), CALENDAR_SESSIONS: join(STORE, d, 'sessions') + '/', IDENT_URL: ident.base, IDENT_EXCHANGE_URL: ident.base, IDENT_API_KEY: app.key, IDENT_API_SECRET: app.secret });
  52. const kp = generateKeyPairSync('ec', { namedCurve: 'P-256' }).privateKey.export({ format: 'jwk' });
  53. const PRIV = kp.d, PUB = Buffer.concat([Buffer.from([4]), Buffer.from(kp.x, 'base64url'), Buffer.from(kp.y, 'base64url')]).toString('base64url');
  54. const push = { CALENDAR_PUSH_PUBLIC: PUB, CALENDAR_PUSH_PRIVATE: PRIV, CALENDAR_PUSH_SUBJECT: 'mailto:[email protected]' };
  55. const s1 = spawnServer(PORT, BASE, { ...env('one'), ...push, CALENDAR_LOGIN_LIMIT: '12', CALENDAR_MAX_EVENTS: '4' });
  56. const s2 = spawnServer(PORT2, `https://localhost:${PORT2}`, env('two')); // https public URL: the cookie must be Secure
  57. await Promise.all([up(PORT, s1), up(PORT2, s2)]);
  58. const cookieOf = (r) => (r.headers['set-cookie'] || []).map(c => c.split(';')[0])[0] || null;
  59. const login = async (who, pre = null, next = '/') => {
  60. const ck = pre || cookieOf(await get('/'));
  61. const code = await ident.selectorCode(who, app, BASE);
  62. const cb = await get('/login/callback?ident_code=' + code + '&next=' + encodeURIComponent(next), { cookie: ck });
  63. return { cookie: cookieOf(cb) || ck, cb, pre: ck };
  64. };
  65. let n = 0;
  66. const face = async (who, event, payload) => {
  67. const r = await raw(PORT, 'POST', '/__hl/emit', { headers: { 'content-type': 'application/json' }, cookie: who && who.cookie, body: J({ t: 'emit', i: ++n, event, payload }) });
  68. let j = null; try { j = JSON.parse(r.body); } catch {}
  69. return { status: r.status, value: j && j.value, error: j && j.error, raw: r.body };
  70. };
  71. const A = await login(alice), B = await login(bob);
  72. const W = ['2026-10-01', '2026-11-15'];
  73. const ev = (o = {}) => ({ title: 'Dentist', allDay: false, startDate: '2026-10-20', startTime: '10:00', endDate: '', endTime: '', place: 'Main street 1', notes: 'bring card', zone: 'Europe/Vienna', custom: false, reminders: [], ...o });
  74. const titles = (v) => ((v && v.events) || []).map(e => e.title);
  75. // ---- 1. authz: the faces (who may, result) ---------------------------------------------------------------------
  76. const mk = await face(A, 'calSave', [ev({ title: 'Alice secret' }), ...W]);
  77. check('face calSave: owner creates', titles(mk.value).includes('Alice secret'), mk.raw);
  78. const aid = mk.value.events[0].id;
  79. check('face calSave: signed out refused', !!(await face(null, 'calSave', [ev(), ...W])).value.error);
  80. check('face calLoad: owner sees the event', titles((await face(A, 'calLoad', W)).value).includes('Alice secret'));
  81. check('face calLoad: signed out refused, nothing leaks', (await face(null, 'calLoad', W)).value.error && !(await face(null, 'calLoad', W)).raw.includes('Alice secret'));
  82. check('face calLoad: another user sees none of it', !(await face(B, 'calLoad', W)).raw.includes('Alice secret'));
  83. const bc = await face(B, 'calSave', [ev({ id: aid, title: 'HACKED' }), ...W]);
  84. check('face calSave: another user cannot change my event by id', !!bc.value.error && titles((await face(A, 'calLoad', W)).value).includes('Alice secret') && !(await face(A, 'calLoad', W)).raw.includes('HACKED'), bc.raw);
  85. const bd = await face(B, 'calDelete', [aid, ...W]);
  86. check('face calDelete: another user cannot delete my event', !!bd.value.error && titles((await face(A, 'calLoad', W)).value).includes('Alice secret'), bd.raw);
  87. check('face calDelete: signed out refused', !!(await face(null, 'calDelete', [aid, ...W])).value.error && titles((await face(A, 'calLoad', W)).value).includes('Alice secret'));
  88. const bq = await face(B, 'calSaveQueued', [ev({ id: aid, title: 'HACKED2' }), ...W]);
  89. check('face calSaveQueued: another user cannot change my event', !!bq.value.error && !(await face(A, 'calLoad', W)).raw.includes('HACKED2'), bq.raw);
  90. check('face calSaveQueued: signed out refused', !!(await face(null, 'calSaveQueued', [ev(), ...W])).value.error);
  91. // the temporary id ("local-…") of another user must not reach my event
  92. await face(A, 'calSave', [ev({ id: 'local-abc123', title: 'Alice local' }), ...W]);
  93. const bl = await face(B, 'calDelete', ['local-abc123', ...W]);
  94. check('face calDelete: another user\'s temporary id reaches nothing', !!bl.value.error && titles((await face(A, 'calLoad', W)).value).includes('Alice local'), bl.raw);
  95. const bl2 = await face(B, 'calSave', [ev({ id: 'local-abc123', title: 'B local' }), ...W]);
  96. check('face calSave: another user\'s temporary id makes B\'s own event, A\'s stays', titles((await face(A, 'calLoad', W)).value).includes('Alice local') && !titles((await face(A, 'calLoad', W)).value).includes('B local'), bl2.raw);
  97. check('face calSettingsLoad / calSettingsSave: signed out refused', !!(await face(null, 'calSettingsLoad', [])).value.error && !!(await face(null, 'calSettingsSave', [[]])).value.error);
  98. const ss = await face(A, 'calSettingsSave', [[{ n: '5', unit: 'minutes' }]]);
  99. check('face calSettingsSave: owner saves', J(ss.value.rows).includes('5'), ss.raw);
  100. check('face calSettingsLoad: another user does not get my settings', J((await face(B, 'calSettingsLoad', [])).value.rows) !== J((await face(A, 'calSettingsLoad', [])).value.rows));
  101. const sub = (p) => ({ endpoint: 'https://push.example.org/' + p, keys: { p256dh: 'B'.repeat(87), auth: 'a'.repeat(22) } });
  102. check('face calPushSave: signed out refused', !!(await face(null, 'calPushSave', [sub('x'), 'Europe/Vienna'])).value.error);
  103. check('face calPushSave: owner stores', (await face(A, 'calPushSave', [sub('alice'), 'Europe/Vienna'])).value.ok === true);
  104. check('face calPushTest: another user cannot test my device', !!(await face(B, 'calPushTest', [sub('alice').endpoint])).value.error);
  105. await face(B, 'calPushOff', [sub('alice').endpoint]);
  106. check('face calPushOff: another user cannot drop my device', (await face(B, 'calPushTest', [sub('alice').endpoint])).value.error && !(await face(A, 'calPushTest', [sub('alice').endpoint])).value.error);
  107. const badEps = ['https://127.0.0.1:1/x', 'https://localhost/x', 'https://LOCALHOST./x', 'https://[::1]/x', 'https://10.0.0.5/x', 'https://169.254.169.254/latest', 'https://2130706433/x', 'https://0x7f.1/x', 'https://intranet/x', 'https://printer.local/x', 'https://db.internal/x', 'https://x.localhost/x', 'https://[email protected]/x', 'https://push.example.org:8080/x', 'https://push.example.org\\@127.0.0.1/x', 'https://127.1/x', 'http://push.example.org/x', 'ftp://push.example.org/x'];
  108. const acc = []; for (const ep of badEps) { const r = await face(A, 'calPushSave', [{ endpoint: ep, keys: sub('x').keys }, 'Europe/Vienna']); if (!(r.value && r.value.error)) acc.push(ep); }
  109. check('face calPushSave: no internal / IP-literal / non-443 / userinfo endpoint (SSRF: the server POSTs there)', acc.length === 0, 'accepted: ' + J(acc));
  110. check('face calPushSave: a real push service address is still accepted', ['https://fcm.googleapis.com/fcm/send/abc', 'https://updates.push.services.mozilla.com/wpush/v2/abc', 'https://web.push.apple.com/abc', 'https://wns2-par02p.notify.windows.com/w/?token=x'].every(async () => true) && (await face(A, 'calPushSave', [{ endpoint: 'https://fcm.googleapis.com/fcm/send/abc', keys: sub('x').keys }, 'Europe/Vienna'])).value.ok === true && (await face(A, 'calPushSave', [{ endpoint: 'https://updates.push.services.mozilla.com:443/wpush/v2/abc', keys: sub('y').keys }, 'Europe/Vienna'])).value.ok === true && (await face(A, 'calPushSave', [{ endpoint: 'https://wns2-par02p.notify.windows.com/w/?token=x', keys: sub('z').keys }, 'Europe/Vienna'])).value.ok === true);
  111. check('face calendarLogOut / calendarLogin: junk code refused', !!(await face(B, 'calendarLogin', ['not a code'])).value.error);
  112. check('client-side events cannot be called by a peer', !(await face(null, 'calendarSignedIn', ['x'])).value);
  113. // events per user are capped (CALENDAR_MAX_EVENTS=4 here): a signed-in user cannot fill the disk
  114. let capped = null; for (let i = 0; i < 6 && !capped; i++) { const r = await face(B, 'calSave', [ev({ title: 'fill ' + i }), ...W]); if (r.value && r.value.error) capped = r.value.error; }
  115. check('face calSave: events per user are capped', !!capped, 'six events were all accepted');
  116. // ---- 2. injection ------------------------------------------------------------------------------------------------
  117. const evil = '<img src=x onerror=alert(1)>"\'><script>alert(1)</script>';
  118. const own = (b) => b.replace(/<script type="application\/json" id="hl-seed">[\s\S]*?<\/script>/, '');
  119. const C0 = await login(await ident.signIn('[email protected]'));
  120. const cm = await face(C0, 'calSave', [ev({ title: evil, place: evil, notes: evil }), ...W]);
  121. check('user text in title / place / notes is stored as text', titles(cm.value).includes(evil), cm.raw.slice(0, 200));
  122. const page = await get('/', { cookie: C0.cookie });
  123. check('page: no event text lands as HTML (the page is rendered before the events load)', !/<img src=x|<script>alert/.test(own(page.body)));
  124. check('page data seed cannot close its script tag', !/<\/script/i.test((page.body.match(/id="hl-seed">([\s\S]*?)<\/script>/) || [, ''])[1]));
  125. const bad = [{ title: 'x'.repeat(201) }, { place: 'x'.repeat(201) }, { notes: 'x'.repeat(5001) }, { startDate: '2026-02-30' }, { startTime: '25:00' }, { zone: 'Europe/Vienna; rm -rf' }, { title: { a: 1 } }, { allDay: 'yes' }, { custom: true, reminders: new Array(50).fill({ n: '1', unit: 'minutes' }) }, { custom: true, reminders: [{ n: '99999', unit: 'minutes' }] }];
  126. const took = []; for (const o of bad) { const r = await face(C0, 'calSave', [ev(o), ...W]); if (!(r.value && r.value.error)) took.push(J(o).slice(0, 60)); }
  127. check('event fields: too long / not a date / not a time / bad zone / wrong type / too many reminders are refused', took.length === 0, J(took));
  128. for (const f of [['calLoad', ['x', 'y']], ['calLoad', [{ a: 1 }, null]], ['calSave', [null, ...W]], ['calSave', ['str', ...W]], ['calDelete', [{ a: 1 }, ...W]], ['calDelete', [null, ...W]], ['calSettingsSave', ['x']], ['calSettingsSave', [null]], ['calPushSave', [null, null]], ['calPushTest', [null]], ['calPushOff', [{ a: 1 }]]]) {
  129. const r = await face(C0, f[0], f[1]);
  130. check(`face ${f[0]}: junk arguments get an error answer, not a crash (${J(f[1]).slice(0, 30)})`, !!(r.value && r.value.error) || r.value === true || (r.value && r.value.ok), r.raw.slice(0, 120));
  131. }
  132. // ---- 1b. routes, files, secrets ---------------------------------------------------------------------------------------
  133. check('files: source, storage, .env, .git, sessions are not served', (await Promise.all(['/.env', '/project.hl', '/lib/users.hl', '/lib/push.hl', '/storage/mpackdb/users.db', '/storage/mpackdb/push.db', '/.git/config', '/icons/%2e%2e/project.hl', '/%2e%2e/%2e%2e/etc/passwd', '/docker-compose.yml', '/tools/vapid-keys.hl', '/.sessions/x', '/tests/security.mjs'].map(p => get(p)))).every(r => r.status === 404));
  134. const allText = [];
  135. const pg = await get('/', { cookie: C0.cookie }); allText.push(pg.body);
  136. const mods = [...new Set([...pg.body.matchAll(/"module":"([^"]+)"/g)].map(m => m[1]))];
  137. for (const m of mods.concat(['/login.js', '/__hl/sw.js', '/__hl/manifest.webmanifest', '/login/failed'])) allText.push((await get(m, { cookie: C0.cookie })).body);
  138. check('pages, client modules, service worker hold no secret (VAPID private key, ident secret, session id, ident identity)', !allText.some(b => b.includes(PRIV) || b.includes(app.secret) || b.includes(C0.cookie.split('=')[1]) || /"identity"/.test(b)), J(allText.map(b => [b.includes(PRIV), b.includes(app.secret)])));
  139. // ---- 4. sessions and cookies --------------------------------------------------------------------------------------------
  140. check('an anonymous GET / sets no cookie', !(await get('/')).headers['set-cookie']);
  141. const c1 = A.cb.headers['set-cookie'][0];
  142. check('cookie: HttpOnly, SameSite=Lax, Path=/, Max-Age', /HttpOnly/.test(c1) && /SameSite=Lax/.test(c1) && /Path=\//.test(c1) && /Max-Age=/.test(c1), c1);
  143. const c2 = (await raw(PORT2, 'GET', '/login/callback?ident_code=' + await ident.selectorCode(alice, app, BASE))).headers['set-cookie'][0];
  144. check('cookie: Secure when the public address is https', /; Secure/.test(c2), c2);
  145. // SO28 (ident#28): the callback never signs out the session it finds; the same cookie value becomes the signed-in one
  146. const ipH = () => ({ 'x-client-ip': '5.5.5.' + (++n % 200) });
  147. const cb = async (who, ck, code = null) => get('/login/callback?ident_code=' + (code || await ident.selectorCode(who, app, BASE)), { cookie: ck, headers: ipH() });
  148. const isIn = async (ck) => !(await face({ cookie: ck }, 'calLoad', W)).value.error;
  149. // W124 lazy sessions: a failed login stores its error and creates an anonymous session.
  150. const anon = cookieOf(await get('/login/callback'));
  151. const r1 = await cb(bob, anon);
  152. const sc = r1.headers['set-cookie'] || [];
  153. check('login keeps the session: a good code on an anonymous session leaves the same cookie value, and it is now signed in', sc.length === 1 && sc[0].split(';')[0] === anon && await isIn(anon), J(sc) + ' vs ' + anon);
  154. check('login Set-Cookie: host-only (no Domain), same name', sc.length === 1 && !/domain=/i.test(sc[0]) && sc[0].split('=')[0] === anon.split('=')[0], J(sc));
  155. const signedIn = (await login(alice)).cookie;
  156. const r2 = await cb(bob, signedIn);
  157. check('a good code on a signed-in session: the same cookie works signed in, the old session was not made anonymous', (r2.headers['set-cookie'] || [])[0]?.split(';')[0] === signedIn && await isIn(signedIn), J(r2.headers));
  158. const badCb = await cb(bob, signedIn, 'cd'.repeat(24));
  159. check('a bad code changes nothing: the signed-in session stays signed in', await isIn(signedIn) && !(badCb.headers['set-cookie'] || []).some(c => !c.startsWith(signedIn)), J(badCb.headers));
  160. const usedCode = await ident.selectorCode(alice, app, BASE);
  161. await cb(alice, null, usedCode);
  162. const reuse = await cb(alice, signedIn, usedCode);
  163. check('a reused code changes nothing: the signed-in session stays signed in', reuse.headers.location === '/login/failed' && await isIn(signedIn));
  164. const D = await login(bob);
  165. await face(D, 'calendarLogOut', []);
  166. check('logout: the same cookie is signed out afterwards', !!(await face(D, 'calLoad', W)).value.error);
  167. const code2 = await ident.selectorCode(bob, app, BASE);
  168. await get('/login/callback?ident_code=' + code2); const again = await get('/login/callback?ident_code=' + code2);
  169. check('a login code works once (reuse → /login/failed)', again.headers.location === '/login/failed');
  170. const nextOf = async (nx) => (await get('/login/callback?ident_code=' + await ident.selectorCode(bob, app, BASE) + '&next=' + encodeURIComponent(nx), { headers: { 'x-client-ip': '7.7.7.' + (++n % 200) } })).headers.location;
  171. let okNext = true; const badNext = [];
  172. for (const nx of ['//evil.com', '/\\evil.com', 'http://evil.com/', 'javascript:alert(1)', '/a\r\nSet-Cookie: x=1', 'https://localhost:' + PORT + '@evil.com/']) { const l = await nextOf(nx); if (l !== '/') { okNext = false; badNext.push(nx + ' → ' + l); } }
  173. check('login ?next=: no open redirect, no header injection', okNext, badNext.join('; '));
  174. check('login ?next=: a path of this app is kept', (await nextOf('/?m=2026-11')) === '/?m=2026-11');
  175. const failedPage = (cb) => get('/login/failed', { cookie: cookieOf(cb) });
  176. let limited = null;
  177. for (let i = 0; i < 16 && !limited; i++) { const r = await get('/login/callback?ident_code=ab' + i, { headers: { 'x-client-ip': '9.9.9.9' } }); if (/too many/.test((await failedPage(r)).body)) limited = i; }
  178. check('login: /login/callback is rate limited per client (X-Client-IP): ≤ 12 exchanges then refused', limited !== null && limited <= 12, 'never limited in 16 tries');
  179. const other = await get('/login/callback?ident_code=ab99', { headers: { 'x-client-ip': '8.8.8.8' } });
  180. check('login: another client is not limited by the first one', !/too many/.test((await failedPage(other)).body));
  181. // ---- 3. uploads -------------------------------------------------------------------------------------------------
  182. const upl = await raw(PORT, 'POST', '/__hl/upload', { headers: { 'content-type': 'application/json' }, body: J({ name: 'x', type: 'text/plain', size: 900000000 }) });
  183. check('/__hl/upload: a signed-out visitor cannot start a 900 MB upload (no face takes a file) → 413', upl.status === 413, upl.status + ' ' + upl.body.slice(0, 100));
  184. // ---- 6. headers on the function / file routes (pages: known gap) ------------------------------------------------------
  185. const nos = (label, r) => check(`X-Content-Type-Options: nosniff — ${label}`, (r.headers['x-content-type-options'] || '') === 'nosniff', J(r.headers));
  186. nos('/login/callback redirect', await get('/login/callback?ident_code=zz'));
  187. nos('/login/callback success', await get('/login/callback?ident_code=' + await ident.selectorCode(bob, app, BASE), { headers: { 'x-client-ip': '6.6.6.6' } }));
  188. nos('/login.js', await get('/login.js'));
  189. nos('/icons/icon-192.png', await get('/icons/icon-192.png'));
  190. nos('/icons/icon-512.png', await get('/icons/icon-512.png'));
  191. const hp = await get('/');
  192. for (const h of ['content-security-policy', 'x-content-type-options', 'x-frame-options', 'referrer-policy']) if (!hp.headers[h]) known(`page answers carry no ${h} (hl:web has no hook for page headers — .scratch/SC-hlweb-gaps.md)`);
  193. const nf = await get('/nope%3Cscript%3Ealert(1)%3C/script%3E');
  194. if (/<script>alert/.test(nf.body) && /html/.test(nf.headers['content-type'])) known('hl:web 404 page echoes the decoded path as text/html: reflected XSS');
  195. const ep = await raw(PORT, 'POST', '/__hl/emit', { headers: { 'content-type': 'text/plain', origin: 'https://evil.example' }, cookie: A.cookie, body: J({ t: 'emit', i: 999, event: 'calLoad', payload: W }) });
  196. if (/events/.test(ep.body)) known('/__hl/emit does not check Origin (SameSite=Lax is the only CSRF guard)');
  197. if (process.env.SEC_HOLD) { await sleep(Number(process.env.SEC_HOLD) * 1000); }
  198. } catch (e) {
  199. check('the security gate ran to its end', false, String(e && e.stack || e));
  200. } finally {
  201. for (const p of procs) { try { p.kill('SIGTERM'); } catch {} }
  202. if (ident) await ident.stop();
  203. await sleep(500);
  204. console.log(`\n${passes} passed, ${failures} failed`);
  205. process.exit(failures ? 1 : 0);
  206. }

Branches

Latest commits

  • e9fec7bb|||PR HL-STANDARD clean-up: typed parameters, plain locals, by-reference cacheAtlas
  • eff166a4Re-vendor complete Hybriel plugins and runtime to day44mre
  • cef81394Wait for the DST fixture page instead of an unused socketmre
  • 42434f47Check lazy-session cookies after login with a stored anonymous fixturemre
  • 728e84e3Re-vendor complete Hybriel day41 plugin directoriesmre
  • cbd7ff43Backup tar: --hard-dereference, so mpackdb sidecars are never stored as hard links (Tracker's finding)mre
  • 59d1da0acalendar: plain declarations instead of needless let in 9 files (calendar#17): 49 declarations that are never reassigned; reassigned ones and the timer closure's p stay letmre
  • f5415cf9calendar: the Style blocks in the language's nested form (calendar#16): rules named after the View's own elements with their children nested, pseudo-classes and @media nested, merged duplicate select rule; same CSS, shots identical in Chrome at 4 sizesmre
  • edb7c947calendar: the sign-in callback keeps the session it finds and signs it in (same cookie, nothing signed out; ident#28); security gate 56+4 failing → 60 passedmre
  • bf8cc0fcStyles move into their components: the shell's styles into main.hl, the events and the editors into the month view's Style block; styles.hl keeps only the theme inherit, the accent and the message line; .gitignore ignores a bin symlink too; tests/styles-shots.mjs for the before/after pixel comparemre
  • 5d8579d7README: login.js stays by caramboleyo's explicit rulemre
  • cc759328Merge sb3-standby: calendar deploys through its standbymre
  • f2fcdc6dcalendar: a standby container (port 45015, profile standby, reminder clock off) and a /health page; deploy hands over through standby-swap.sh without a gapmre
  • 229643f7Merge branch 'cal-14'mre
  • 1110b26fcalendar#14: the month name no longer breaks into two lines on a phone (Reminder settings drops to its own row when the header is too narrow), gate checks for one-line title and all header controls on screenmre
  • 490c658aident#31: the selector's sign-in returns to the page the user started on (return attribute = the login callback with next), gate checkmre
  • 18095868calendar: Reminder settings button opens its dialog again (the dialog's open handler still closed the removed user menu and stopped); old e2e and gate scripts use the new headermre
  • 6eee4b5acalendar header: the selector alone top right plus Log out as before the theme missions; Reminder settings back on the month page (WIP: the settings test still fails)mre
  • 0b909decident selector back in the header (creator 2026-10-24): selector top right signed in and out on phone and desktop, no second Log in button, new gate checks (WIP: gates not re-run after the last edits)mre
  • 0c8f9364Merge branch 'sy-sync'mre