ShtukbaseStandard
package file→ .shtukbase/packages/live/checks/l01_host.ts

checks/l01_host.ts

12 lines, 688 B.

  1. // LIVE-R01. The live server listens only on this computer: `host:` of /base/live.md is 127.0.0.1, localhost or ::1
  2. // (or absent: then 127.0.0.1). The server itself refuses to start otherwise; this check catches the setting before.
  3. import { type Project, type Result } from '../../collections/checks/lib/speclib.ts';
  4. import { main, settingsFindings } from './lib.ts';
  5. export const RULE = { id: 'live01', title: 'The live server listens only on this computer', scope: 'page /base/live.md, field host' };
  6. export function check(p: Project, res: Result): void {
  7. settingsFindings(p, res, 'LIVE-R01', 'host: 127.0.0.1 or remove the field');
  8. }
  9. if (import.meta.main) main({ RULE, check });