문제: (1) live probe는 배포된 release-manifest.json의 buildId·releaseId만 후보와 비교했다. 두 값은 CI run 번호로 만든 이름이라, 같은 run에서 로컬 프로필로 다시 빌드한 release(APP_ENV=local, AUTH_MODE=demo, loopback API)를 올려도 PASS(live)였다(리뷰 실험 E-2c). 공개 대상 승인 (FE-GATE-027)을 받은 것은 후보의 config.json인데, 호스트가 내주는 config.json은 헤더만 보았다. entry script도 호스트의 두 응답끼리만 비교했다. (2) 템플릿은 HTTP/2와 압축을 전제로 초기 청크를 나누고 gzip 바이트로 예산을 재는데, 그 전제가 호스팅 계약에 없고 probe도 보지 않았다. 템플릿 nginx 예시는 http2도 gzip도 켜지 않았다. 고른 방법: - 받은 /config.json을 후보 dist/config.json과 비교한다. 비상 스위치 두 개(CAPABILITY_OVERRIDES, FEATURE_OVERRIDES) 밖의 필드가 다르거나 읽을 수 없으면 FAIL. 규칙은 check-release-admission과 같은 함수 (scripts/lib/runtime-config-switches.ts)로 옮겨 같이 쓴다. - 받은 index.html의 entry script를 후보 index.html의 것과 비교한다. - cache-policy.json에 transport.alpnProtocols(["h2"])와 hashedAsset.contentEncodings(br, gzip, zstd)를 선언한다. probe는 TLS handshake의 ALPN(node:tls, h2와 http/1.1을 제안)과 entry script 응답의 Content-Encoding을 본다. Node fetch는 h2를 지원하는 서버에도 HTTP/1.1로 붙어서 프로토콜은 따로 확인해야 한다. - nginx 예시에 http2 on과 gzip·gzip_types를 넣고, static-delivery.md와 release-cache-rollback.md에 두 전제와 실패 조건을 적었다. 두 수정은 같은 probe 함수와 테스트를 고쳐 한 커밋에 넣었다. 버린 대안: archive SHA를 호스트에 올려 대조하기(호스트에 새 파일 규약이 생기고 일부 파일만 다른 배포는 못 잡는다). HTTP/2를 기록만 하기 (아무도 읽지 않는 경고는 청크를 묶는 결정을 부르지 못한다. 선언을 바꾸면 제품이 끌 수 있다). 위험·한계: HTTP/1.1만 되는 호스트는 이제 FE-GATE-019에서 FAIL한다. 그 제품은 cache-policy.json 선언을 바꾸고 초기 청크를 묶는다. 실제 nginx와 Gitea runner에서는 돌리지 않았다. 슬롯이 후보를 받도록 강제하는 계약 규칙은 다음 커밋(제품 overlay)에 있다. 검증: hosting-probe.test.ts에 같은 이름·다른 config.json → FAIL, 비상 스위치만 다름 → PASS, 읽을 수 없는 config.json → FAIL, 다른 entry → FAIL, ALPN http/1.1·없음 → FAIL, 압축 없는 entry → FAIL, 정책 선언 확인을 더했다(고치기 전 실패). 33건 통과. 로컬 자체 서명 TLS 서버 실험: http2.createSecureServer → "h2", https.createServer → "http/1.1", 인증서 이름 불일치 → ERR_TLS_CERT_ALTNAME_INVALID. verify:hosting-headers(fixture) UNVERIFIED exit 3, deployment-admission 통과. Refs: docs/reviews/2026-11-03-maturity-review/13-build-release-supply-chain.md 13-01, 13-02
50 lines
1.3 KiB
JSON
50 lines
1.3 KiB
JSON
{
|
|
"schemaVersion": 1,
|
|
"transport": {
|
|
"alpnProtocols": ["h2"]
|
|
},
|
|
"surfaces": {
|
|
"index": {
|
|
"path": "/",
|
|
"cacheControl": "no-cache",
|
|
"contentTypes": ["text/html"],
|
|
"securityHeaders": true
|
|
},
|
|
"runtimeConfig": {
|
|
"path": "/config.json",
|
|
"cacheControl": "no-store",
|
|
"contentTypes": ["application/json"],
|
|
"securityHeaders": true
|
|
},
|
|
"releaseManifest": {
|
|
"path": "/release-manifest.json",
|
|
"cacheControl": "no-store",
|
|
"contentTypes": ["application/json"],
|
|
"securityHeaders": true
|
|
},
|
|
"hashedAsset": {
|
|
"pathPattern": "/assets/*",
|
|
"cacheControl": "public, max-age=31536000, immutable",
|
|
"contentTypes": ["text/javascript", "application/javascript"],
|
|
"contentEncodings": ["br", "gzip", "zstd"],
|
|
"securityHeaders": false
|
|
},
|
|
"sourceMap": {
|
|
"public": false
|
|
},
|
|
"appRoute": {
|
|
"path": "/__probe/deep-link",
|
|
"cacheControl": "no-cache",
|
|
"contentTypes": ["text/html"],
|
|
"securityHeaders": true
|
|
},
|
|
"serviceWorker": {
|
|
"path": "/service-worker.js",
|
|
"requiredWhen": "service-worker-shipped",
|
|
"cacheControl": "no-cache",
|
|
"contentTypes": ["text/javascript", "application/javascript"],
|
|
"securityHeaders": false
|
|
}
|
|
}
|
|
}
|