- Panel zeigt bei 503/G10 und 403/G07 einen Hinweis statt sich auszublenden; ohne Login unsichtbar - Startlog: Info-Zeile bei aktivem Backend (kid, Allowlist), ohne Secrets - docs/git: Abschnitt Fehlersuche / nachträglich aktivieren - docs/deploy: compose.yaml-Vorlage für das veröffentlichte Image, Verlinkung aus README/FORK/auth/storage - Dev-Compose reicht HB_ASSET_* durch Refs #30 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
29 lines
1.2 KiB
JavaScript
29 lines
1.2 KiB
JavaScript
import { createGitBackend } from '../../server/fork/git/index.js';
|
|
import { configureGitHooks } from '../../server/fork/git/hooks.js';
|
|
|
|
const KEY = Buffer.alloc(32, 7).toString('base64');
|
|
const boot = (env)=>{
|
|
const logger = { warn: jest.fn(), info: jest.fn(), error: jest.fn() };
|
|
createGitBackend({ getStorage: ()=>({}), api: {}, splitTextStyleAndMetadata: ()=>({}), env, logger });
|
|
configureGitHooks(undefined);
|
|
return logger;
|
|
};
|
|
|
|
describe('Git-Backend: Startlog (FLW-258)', ()=>{
|
|
test('ohne Schlüssel: Warnung, keine Info-Zeile', ()=>{
|
|
const l = boot({});
|
|
expect(l.warn).toHaveBeenCalledWith(expect.stringMatching(/deaktiviert.*HB_GIT_TOKEN_KEY/));
|
|
expect(l.info).not.toHaveBeenCalled();
|
|
});
|
|
test('mit Schlüssel: Info mit kid und Allowlist, ohne Secrets', ()=>{
|
|
const l = boot({ HB_GIT_TOKEN_KEY: KEY, HB_GIT_ALLOWED_HOSTS: 'git.example.org' });
|
|
expect(l.warn).not.toHaveBeenCalled();
|
|
const line = l.info.mock.calls[0][0];
|
|
expect(line).toMatch(/aktiv \(kid=[0-9a-f]{8}.*Host-Allowlist: ja/);
|
|
expect(line).not.toContain(KEY);
|
|
});
|
|
test('ohne Allowlist: „nein“', ()=>{
|
|
expect(boot({ HB_GIT_TOKEN_KEY: KEY }).info.mock.calls[0][0]).toMatch(/Host-Allowlist: nein/);
|
|
});
|
|
});
|