feat(runtime): 공통 메뉴 설정을 영속 데이터로 보존
최초 기동에만 Core 메뉴 기본값을 복사하고 이후 운영 편집은 배포와 컨테이너 재생성에서 유지한다. Compose 환경과 안전 검증 문서를 함께 갱신한다.
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
import test from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import fs from 'node:fs/promises';
|
||||
|
||||
test('runtime menu config is seeded once in persistent data and never overwritten', async () => {
|
||||
const entrypoint = await fs.readFile(new URL('../runtime/entrypoint.sh', import.meta.url), 'utf8');
|
||||
const existenceGuard = entrypoint.indexOf('if [ ! -e "$navigation_config_file" ]; then');
|
||||
const copy = entrypoint.indexOf('cp "$core_root/resources/navigation.json" "$navigation_config_file"');
|
||||
|
||||
assert.ok(existenceGuard >= 0, 'persistent navigation config must have an existence guard');
|
||||
assert.ok(copy > existenceGuard, 'the default config must only be copied inside that guard');
|
||||
assert.equal(entrypoint.indexOf('cp -f "$core_root/resources/navigation.json"'), -1);
|
||||
});
|
||||
Reference in New Issue
Block a user