fix(core,admin_basic): S3 스토리지 드라이버 실동작 결함 수정 및 S3 호환 스토리지 연결 지원

공개 제보 — 파일 스토리지에서 S3 를 선택해 저장해도 실제 파일 저장이
동작하지 않던 결함의 전면 수정.

- S3 어댑터(league/flysystem-aws-s3-v3)·predis 를 코어 기본 의존성으로 포함
 — 어댑터 부재 즉사, phpredis 확장 없는 서버의 redis 선택 전면 다운 차단
 (부트 시 확장 부재 감지 → predis 자동 폴백)
- storage_driver=s3 저장 시 코어 첨부 업로드 디스크를 s3 로 전환
 (ATTACHMENT_DISK env 명시가 항상 우선, 기존 행은 저장 당시 disk 로 서빙)
- 첨부·템플릿 레이아웃 첨부 서빙을 행 disk 를 따르는 스토리지 스트림으로 교체
 — 로컬 절대 경로 전제 fileResponse 는 S3 행에서 filemtime stat 500
 (streamedFileResponse: 행 메타 기반 ETag/304/Cache-Control)
- S3 호환 스토리지(R2/MinIO/NCP) 연결 지원: 엔드포인트 URL·path-style 설정
 신설, 리전 목록 선택 → 자유 입력 전환, 연결 테스트를 실제 저장 경로와
 동일 설정(endpoint/path-style)으로 정렬
- 사용 불능 드라이버(어댑터·PHP 확장 부재)의 저장/테스트 요청을 사유와 함께
 422 로 차단하는 서버 게이트 신설 (DriverRegistryService 능력 판정)
- 웹소켓 연결 테스트에 서버(백엔드 발송용) endpoint 검사 추가 — 클라이언트만
 검사해 테스트 성공 + 실제 발송 실패가 가능하던 비대칭 해소
- env 빈 값(`KEY=`) 함정 정규화: AWS_URL/AWS_ENDPOINT/ATTACHMENT_DISK 빈 문자열을
 미설정으로 취급 (config 정규화 + 예시 파일 주석 처리)
- 플러그인 드라이버 폴백의 log 카테고리 죽은 키(logging.default) 정정 및
 websocket 유령 설정 키 제거
- 실 AWS S3 종단 검증 완료 (설정 저장 → 업로드 S3 실저장 → 서빙 200/304)
This commit is contained in:
HeuJung committed 2026-08-13 15:15:19 +09:00
1 parent c128a6ea3a
commit ea58c606a2
56 files changed
+2899 -243

No files matched your search

+19 -1
View File
@@ -9,8 +9,26 @@ return [
| 첨부파일 저장에 사용할 디스크를 지정합니다.
| config/filesystems.php에 정의된 디스크 이름을 사용합니다.
|
| 빈 값(`ATTACHMENT_DISK=`)은 미설정으로 간주한다 — env() 는 키가 존재하면
| 빈 문자열을 그대로 돌려주므로(기본값 미적용), `cp .env.example .env` 설치
| 절차에서 빈 값이 그대로 오면 Storage::disk('') 로 업로드가 전면 실패한다.
|
*/
'disk' => env('ATTACHMENT_DISK', 'attachments'),
'disk' => env('ATTACHMENT_DISK') ?: 'attachments',
/*
|--------------------------------------------------------------------------
| 디스크 명시 설정 여부 (내부 판별용)
|--------------------------------------------------------------------------
|
| ATTACHMENT_DISK env 가 명시되었는지 판별하기 위한 키. env() 직접 호출은
| config:cache 환경에서 항상 null 이므로, config 캐시에 태워 두고 이 값으로
| 판별한다. null 이면 미명시 — 관리자 환경설정의 storage_driver(s3) 가
| 업로드 디스크를 전환할 수 있다 (SettingsServiceProvider::applyDriverConfig).
| 빈 값(`ATTACHMENT_DISK=`)도 미명시로 정규화한다 (위 disk 의 사유와 동일).
|
*/
'disk_explicit' => env('ATTACHMENT_DISK') ?: null,
/*
|--------------------------------------------------------------------------
+5 -2
View File
@@ -99,8 +99,11 @@ return [
'secret' => env('AWS_SECRET_ACCESS_KEY'),
'region' => env('AWS_DEFAULT_REGION'),
'bucket' => env('AWS_BUCKET'),
'url' => env('AWS_URL'),
'endpoint' => env('AWS_ENDPOINT'),
// 빈 값(`AWS_URL=`/`AWS_ENDPOINT=`)은 미설정으로 정규화 — env() 는 키가
// 존재하면 빈 문자열을 돌려주므로, '' 가 endpoint 로 주입되면 S3 클라이언트
// 구성이 깨진다 (cp .env.example 설치 절차 방어).
'url' => env('AWS_URL') ?: null,
'endpoint' => env('AWS_ENDPOINT') ?: null,
'use_path_style_endpoint' => env('AWS_USE_PATH_STYLE_ENDPOINT', false),
'throw' => true,
'report' => false,
+6 -1
View File
@@ -123,6 +123,8 @@
"s3_access_key": "",
"s3_secret_key": "",
"s3_url": "",
"s3_endpoint": "",
"s3_use_path_style": false,
"cache_driver": "file",
"redis_host": "127.0.0.1",
"redis_port": 6379,
@@ -305,6 +307,8 @@
"s3_access_key": { "type": "string", "sensitive": true },
"s3_secret_key": { "type": "string", "sensitive": true },
"s3_url": { "type": "string", "sensitive": false },
"s3_endpoint": { "type": "string", "sensitive": false },
"s3_use_path_style": { "type": "boolean", "sensitive": false },
"cache_driver": { "type": "string", "sensitive": false },
"redis_host": { "type": "string", "sensitive": false },
"redis_port": { "type": "integer", "sensitive": false },
@@ -328,7 +332,8 @@
"websocket_verify_ssl": { "type": "boolean", "sensitive": false },
"websocket_server_host": { "type": "string", "sensitive": false },
"websocket_server_port": { "type": "integer", "sensitive": false },
"websocket_server_scheme": { "type": "string", "sensitive": false }
"websocket_server_scheme": { "type": "string", "sensitive": false },
"search_engine_driver": { "type": "string", "sensitive": false }
}
},
"notifications": {