feat(core): 리버스 프록시 신뢰 설정 지원 및 미설정 진단
TLS 가 앞단에서 종단되고 앱에는 HTTP 로 전달되는 구성에서 X-Forwarded-* 가 전부 무시되어 화면 백지·IP 왜곡·webhook 403 이 함께 발생했다. 코어에 신뢰 프록시 설정 지점이 아예 없던 것이 원인이다. - config/trustedproxy.php 로 내장 TrustProxies 미들웨어에 값을 공급한다. bootstrap/app.php 는 건드리지 않는다 — withMiddleware 클로저는 .env 로드 전에 평가되어 env 가 항상 null 이 되는 조용한 no-op 이다. - 판정은 App\Support\TrustedProxyDiagnostic 단일 SSoT 에서 계산하고 대시보드 알림·환경설정 고급 탭·설치 마법사·trusted-proxy:status 네 면이 소비한다. 판정식은 "HTTPS 인식 실패" 가 아니라 "X-Forwarded-* 수신 중 AND 신뢰 프록시 미설정" 이다 — HTTP 전용 사이트가 프록시 뒤에 있으면 화면은 정상인 채로 나머지만 조용히 어긋나기 때문이다. - 값 편집 UI 와 쓰기 엔드포인트는 두지 않는다(잠금 역설 + XFF 위조 경로). - 혼합 콘텐츠 차단을 부트스트랩 폴백의 별도 사유로 가른다. 새로고침으로 낫지 않으므로 버튼을 렌더하지 않고, 원인·조치는 콘솔로 운영자에게 보낸다. - 대시보드 알림을 심각도로 배치한다 — warning 은 상단 배너, 그 외는 하단 카드. 같은 알림이 두 곳에 뜨지 않으며, 여러 건은 간격을 두고 쌓인다. 공개 이슈: (@lyg-kaban 제보)
This commit is contained in:
1 parent
46ada4dddb
commit
b6c5e1f323
55 files changed
+2861
-38
No files matched your search
@@ -49,5 +49,13 @@ return [
|
||||
// 새로고침해도 낫지 않으므로 이 분기에서는 새로고침 버튼을 렌더하지 않는다.
|
||||
'incompatible_title' => 'This browser cannot display the page',
|
||||
'incompatible_message' => 'Your browser is too old to run this site. Please update it to the latest version, or try a different browser.',
|
||||
|
||||
// The HTTPS page requested an http:// asset and the browser blocked it (running behind a
|
||||
// reverse proxy without trusted proxies configured, #124). Ordinary visitors see this
|
||||
// screen, but only the operator can act on it, so the screen carries no server-side
|
||||
// instructions — the cause and the fix go to the console for the operator. Reloading does
|
||||
// not help, so no button is rendered and no natural recovery is implied.
|
||||
'blocked_title' => 'Something went wrong with this site',
|
||||
'blocked_message' => 'The site cannot be displayed because of a configuration problem. This is not caused by anything on your side — the site operator needs to fix it.',
|
||||
],
|
||||
];
|
||||
@@ -206,4 +206,19 @@ return [
|
||||
'source_vendor_missing' => 'No vendor directory in source. composer install may not have been executed.',
|
||||
'composer_failed_with_output' => 'composer install failed.:output',
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Trusted Proxy Diagnostic (#124)
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The value is edited in .env only — the screen shows a read-only diagnostic.
|
||||
|
|
||||
*/
|
||||
|
||||
'trusted_proxy' => [
|
||||
'alert_title' => 'Trusted proxies are not configured',
|
||||
'alert_message' => 'Proxy headers (:headers) are being received but no trusted proxy is configured, so every visitor is recorded with the same address (:ip). Set TRUSTED_PROXIES in .env. Details: https://github.com/gnuboard/g7/blob/main/docs/backend/reverse-proxy.md',
|
||||
],
|
||||
|
||||
];
|
||||
@@ -49,5 +49,13 @@ return [
|
||||
// 새로고침해도 낫지 않으므로 이 분기에서는 새로고침 버튼을 렌더하지 않는다.
|
||||
'incompatible_title' => '이 브라우저에서는 화면을 표시할 수 없습니다',
|
||||
'incompatible_message' => '브라우저가 오래되어 사이트를 실행하지 못했습니다. 브라우저를 최신 버전으로 업데이트하거나 다른 브라우저로 접속해 주세요.',
|
||||
|
||||
// HTTPS 페이지가 http:// 자산을 요청해 브라우저가 차단한 경우 (리버스 프록시 뒤에서
|
||||
// 신뢰 프록시가 설정되지 않은 상태, #124). 이 화면은 일반 방문자도 보지만 조치할 수
|
||||
// 있는 사람은 운영자뿐이므로, 화면에는 서버 설정 지시를 쓰지 않는다. 원인과 조치는
|
||||
// 콘솔에 운영자 기준으로 남긴다. 새로고침으로도 낫지 않으므로 버튼을 렌더하지 않고,
|
||||
// 설정을 고치기 전에는 낫지 않으므로 '잠시 후 다시 시도' 류의 자연 복구도 암시하지 않는다.
|
||||
'blocked_title' => '사이트에 문제가 발생했습니다',
|
||||
'blocked_message' => '사이트 설정 문제로 화면을 표시할 수 없습니다. 방문자 쪽 문제가 아니며, 사이트 운영자의 조치가 필요합니다.',
|
||||
],
|
||||
];
|
||||
@@ -206,4 +206,19 @@ return [
|
||||
'source_vendor_missing' => '소스 디렉토리에 vendor가 없습니다. composer install이 실행되지 않았을 수 있습니다.',
|
||||
'composer_failed_with_output' => 'composer install 실행에 실패했습니다.:output',
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| 신뢰 프록시 진단 (#124)
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| 값 편집은 .env 전용이다 — 화면에는 읽기 전용 진단만 노출한다.
|
||||
|
|
||||
*/
|
||||
|
||||
'trusted_proxy' => [
|
||||
'alert_title' => '신뢰 프록시가 설정되지 않았습니다',
|
||||
'alert_message' => '프록시 헤더(:headers)를 받고 있으나 신뢰 프록시가 설정되지 않아, 모든 방문자가 같은 주소(:ip)로 기록되고 있습니다. .env 에 TRUSTED_PROXIES 를 지정하세요. 상세: https://github.com/gnuboard/g7/blob/main/docs/backend/reverse-proxy.md',
|
||||
],
|
||||
|
||||
];
|
||||
Reference in new issue
Block a user