Files
Gnuboard7/tests/Unit/Config/BackupDirectoryRestoreOwnershipConfigTest.php
HeuJung de18159986 fix(core,admin_basic): 정적 게시 재게시 누락 3건 수정 + 관리자 수동 복구 UI + sudo core:update 소유권 정합
- 템플릿 update 는 레이아웃 변경 여부와 무관하게 캐시 버전을 올리고(실패 복원 뒤에도), 자산 주소 방식 전환 3경로도 bump 한다
- config:cache 가 컨테이너 인스턴스를 덮어 이후 terminating 재게시가 사라지던 결함을 복원 헬퍼로 차단
- custom/ 변경 감지와 게시가 같은 열거자(재귀·크기 포함)를 쓰고, 서명은 호스트별로 저장
- 캐시 버전·서명 키를 만료시키지 않는다(기본 TTL 24h 로 매일 전체 재생성되던 문제)
- 관리자 > 환경설정 > 일반 「초기 화면 정적 파일」 카드: 상태 조회 + 지금 다시 만들기(확인 모달), 대시보드 알림 버튼 연결, CLI 와 같은 statusReport 소비
- sudo core:update 경로의 root 소유 잔존(설정 디렉토리·임시 폴더·로그·업그레이드 마이그레이션 산출물) 상속·정합화, ext-static 명령 root 경고와 sudo -u 힌트
- 안내·문서·트러블슈팅 4건·audit 룰 ext-cache-version-raw-read·ja 언어팩 동기
2026-09-06 15:22:52 +09:00

54 lines
2.2 KiB
PHP

<?php
namespace Tests\Unit\Config;
use Tests\TestCase;
/**
* 백업 디렉토리가 코어 업데이트 소유권 복원 대상에 포함되는지 검증 (OS 무관).
*
* 회귀 가드 (버그 ③): sudo 업데이트가 백업 디렉토리(storage/app/{extension,core}_backups)
* 를 root 소유로 잔존시켜 이후 www-data 의 mkdir 이 "mkdir(): Permission denied" 로
* 실패하던 결함. config 의 restore_ownership / restore_ownership_group_writable 목록에
* 백업 2경로가 포함되어야 Step 11 restoreOwnership 이 이를 정상화한다.
*/
class BackupDirectoryRestoreOwnershipConfigTest extends TestCase
{
/**
* restore_ownership 목록에 백업 2경로가 포함됨.
*/
public function test_restore_ownership_includes_backup_directories(): void
{
$paths = config('app.update.restore_ownership');
$this->assertIsArray($paths);
$this->assertContains('storage/app/extension_backups', $paths);
$this->assertContains('storage/app/core_backups', $paths);
}
/**
* 정적 게시 트리(`public/build/ext`)가 두 목록에 포함된다 (#651 F22).
*
* root 프로세스는 자동 게시를 예약하지 않으므로 이 항목의 목적은 "terminating 게시가 만든 root
* 디렉토리" 가 아니라 **실존하는** 게시 트리(웹 계정이 게시한 사이트)의 소유권을 코어 업데이트
* 뒤 되돌리는 것이다 — 빠지면 재게시·GC 가 영구 실패해 정적 fast path 가 꺼진다.
*/
public function test_restore_ownership_includes_static_publish_tree(): void
{
$this->assertContains('public/build/ext', config('app.update.restore_ownership'));
$this->assertContains('public/build/ext', config('app.update.restore_ownership_group_writable'));
}
/**
* restore_ownership_group_writable 목록에 백업 2경로가 포함됨.
*/
public function test_restore_ownership_group_writable_includes_backup_directories(): void
{
$paths = config('app.update.restore_ownership_group_writable');
$this->assertIsArray($paths);
$this->assertContains('storage/app/extension_backups', $paths);
$this->assertContains('storage/app/core_backups', $paths);
}
}