feat(git): Hinweis im Account-Panel, Startlog, Fehlersuche und Betriebs-Compose (#30)
- 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>
This commit is contained in:
1 parent
3b83125771
commit
f96dec267b
17 files changed
+439
-181
No files matched your search
@@ -0,0 +1,28 @@
|
||||
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/);
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user