feat(core): 정적 게시 수명주기 보완 — 빌드 파괴·권한·무결성
https://github.com/gnuboard/g7/issues/122 제보자의 추가 지적 2건(빌드가 게시본을 지움 / CLI 최초 게시 후 웹 재생성 불가)에 대응하고, 같은 근본 원인을 공유하는 결함을 전수조사로 함께 고친다. - 빌드가 자기 산출물만 교체한다: 루트 vite `emptyOutDir: false` 기본값 true 는 폴백 없는 코어 3번들과 배달된 immutable URL 의 게시본을 함께 지웠다 - 게시 트리 권한을 웹이 이어받는다: 병합 전 프리플라이트 + 부모 그룹 상속·g+w 종전 소유권 정상화는 root 축만 덮어 비-root CLI 계정은 무방비였다 - 갱신 → 생성 → 완전성 확인을 한 묶음으로: 기록 바이트 대조, .old 원자 스왑, rename 일시 거부 재시도, 프론트 JSON 파싱 검증 - 실패를 억제하고 기록한다: 버전 한정 실패 마커 + 사유별 대시보드 알림 + ext-static:status 점검 커맨드 - 파생: catch-all 제외 목록을 에셋 화이트리스트 합집합에서 파생(mjs·webp·otf 누락), 번들 디스크 쓰기 fail-soft·빈 번들 503, 활성 디렉토리 prune 회피
This commit is contained in:
1 parent
fe973f40af
commit
b4ed33aa44
52 files changed
+3495
-147
No files matched your search
@@ -12,6 +12,7 @@ use App\Extension\PluginManager;
|
||||
use App\Http\View\Composers\TemplateComposer;
|
||||
use App\Http\View\Composers\UserTemplateComposer;
|
||||
use App\Listeners\ExtensionCompatibilityAlertListener;
|
||||
use App\Listeners\StaticPublishFailureAlertListener;
|
||||
use App\Notifications\NotificationChannelManager;
|
||||
use App\Services\ChannelReadinessService;
|
||||
use App\Services\GeoIpService;
|
||||
@@ -99,8 +100,8 @@ class AppServiceProvider extends ServiceProvider
|
||||
View::composer('admin', TemplateComposer::class);
|
||||
View::composer('app', UserTemplateComposer::class);
|
||||
|
||||
// 확장 호환성 알림 리스너 등록
|
||||
$this->registerExtensionCompatibilityAlertListener();
|
||||
// 코어 훅 리스너 등록 (대시보드 알림 등)
|
||||
$this->registerCoreHookListeners();
|
||||
|
||||
// SQL 쿼리 로그 설정
|
||||
$this->configureSqlQueryLogging();
|
||||
@@ -135,25 +136,36 @@ class AppServiceProvider extends ServiceProvider
|
||||
}
|
||||
|
||||
/**
|
||||
* 확장 호환성 알림 리스너를 등록합니다.
|
||||
* 코어가 소유한 훅 리스너를 등록합니다.
|
||||
*
|
||||
* 코어 버전 호환성 문제로 자동 비활성화된 확장에 대한
|
||||
* 알림을 관리자 대시보드에 표시하기 위한 훅 리스너입니다.
|
||||
* 확장 리스너와 달리 코어 리스너는 자동 발견 대상이 아니므로 여기서 등록한다. 목록만
|
||||
* 늘리면 되도록 루프로 둔다 — 리스너마다 등록 메서드를 복제하면 한 곳만 빠져도 그
|
||||
* 리스너가 조용히 동작하지 않는다(등록 실패는 예외도 로그도 남기지 않는다).
|
||||
*
|
||||
* 등록 대상:
|
||||
* - `ExtensionCompatibilityAlertListener` — 코어 호환성으로 자동 비활성화/재호환된 확장
|
||||
* - `StaticPublishFailureAlertListener` — 부트스트랩 리소스 정적 게시 실패 (#122)
|
||||
*/
|
||||
private function registerExtensionCompatibilityAlertListener(): void
|
||||
private function registerCoreHookListeners(): void
|
||||
{
|
||||
$listener = new ExtensionCompatibilityAlertListener;
|
||||
$subscribedHooks = ExtensionCompatibilityAlertListener::getSubscribedHooks();
|
||||
$listenerClasses = [
|
||||
ExtensionCompatibilityAlertListener::class,
|
||||
StaticPublishFailureAlertListener::class,
|
||||
];
|
||||
|
||||
foreach ($subscribedHooks as $hookName => $config) {
|
||||
$method = $config['method'] ?? 'handle';
|
||||
$priority = $config['priority'] ?? 10;
|
||||
$type = $config['type'] ?? 'action';
|
||||
foreach ($listenerClasses as $listenerClass) {
|
||||
$listener = new $listenerClass;
|
||||
|
||||
if ($type === 'filter') {
|
||||
HookManager::addFilter($hookName, [$listener, $method], $priority);
|
||||
} else {
|
||||
HookManager::addAction($hookName, [$listener, $method], $priority);
|
||||
foreach ($listenerClass::getSubscribedHooks() as $hookName => $config) {
|
||||
$method = $config['method'] ?? 'handle';
|
||||
$priority = $config['priority'] ?? 10;
|
||||
$type = $config['type'] ?? 'action';
|
||||
|
||||
if ($type === 'filter') {
|
||||
HookManager::addFilter($hookName, [$listener, $method], $priority);
|
||||
} else {
|
||||
HookManager::addAction($hookName, [$listener, $method], $priority);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user