feat(core,ecommerce,ckeditor5,board,admin_basic): 공개 자산 직접 URL(CDN) 서빙 옵트인
StorageInterface::url 의 public 하드코딩을 완화하고 core.storage.filter_url 훅을 신설해, 완전 공개 자산(상품·카테고리·리뷰·에디터 이미지)의 직접 URL 서빙을 옵트인으로 열었다. 미설정 시 기존 스트리밍 100% 보존. 디스크 결정은 확장 개별 설정 > 코어 전역 > 미설정 순이며, 서빙·삭제·이동은 행에 기록된 disk 를 따라 전환 전후 자산이 혼재해도 각자 실제 저장 위치를 향한다. 고아 disk(공급 플러그인 비활성화)는 스트리밍으로 폴백해 500 이 되지 않는다. 공개 이슈 (@lyg-kaban 건의) 대응.
This commit is contained in:
1 parent
37fad55333
commit
057e002ad1
125 files changed
+5913
-203
No files matched your search
@@ -111,6 +111,7 @@ class Attachment extends Model
|
||||
*/
|
||||
public function getFullPathAttribute(): string
|
||||
{
|
||||
// audit:allow no-storage-disk-direct reason: 행 disk 의 파일시스템 절대경로 해석 — 코어 첨부 path 는 카테고리 없는 원 경로라 StorageInterface(카테고리/경로) 계약과 형태가 다르고, 모델 accessor 는 DI 지점이 없다 (기존 동작 유지)
|
||||
return Storage::disk($this->disk)->path($this->path);
|
||||
}
|
||||
|
||||
@@ -121,7 +122,21 @@ class Attachment extends Model
|
||||
*/
|
||||
public function getDownloadUrlAttribute(): string
|
||||
{
|
||||
return '/api/attachment/'.$this->hash;
|
||||
return self::urlForHash($this->hash);
|
||||
}
|
||||
|
||||
/**
|
||||
* 해시 기반 다운로드 URL 조립 단일 지점.
|
||||
*
|
||||
* 조인 결과 행처럼 모델 hydration 없이 hash 만 손에 있는 호출측
|
||||
* (예: 게시판 인기 게시물 목록의 아바타 URL)이 사용합니다.
|
||||
*
|
||||
* @param string $hash 첨부파일 해시
|
||||
* @return string 다운로드 URL
|
||||
*/
|
||||
public static function urlForHash(string $hash): string
|
||||
{
|
||||
return '/api/attachment/'.$hash;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user