[api] 파일업로드, tus파일 주소변경, md 파일 변경

This commit is contained in:
2026-05-08 17:21:19 +09:00
parent 0fc91fddac
commit 13e41f6e3c
23 changed files with 981 additions and 268 deletions
+19
View File
@@ -17,6 +17,25 @@
- URL: `http://localhost:8106/swagger-ui.html`
- 인증: `swagger.login.id` / `swagger.login.password` (환경별 yaml에 설정)
## 파일 업로드 설정
- `tus-file.upload.final-root` 는 TUS 완료 파일과 단순 업로드 파일이 공유하는 최종 저장 루트다.
- `tus-file.upload.tmp-root` 는 tusd 임시 업로드 루트다. file-domain nginx 에서는 `/uploads/tmp/` 접근을 404로 막는다.
- `file.upload.root-path` 는 보통 `${tus-file.upload.final-root}` 를 사용해 단순 업로드와 TUS 완료 파일의 마운트 루트를 맞춘다.
- `file.upload.view.file-domain` 은 SunEditor 이미지 응답 URL 생성에 사용한다. 예: `https://file-alist.pjt.kr`.
- `file.upload.max-size` 는 단순 업로드 전역 최대 용량이다. `file.upload.types.{folder}.max-size` 가 있으면 폴더별 설정이 우선한다.
- `file.upload.allowed-extensions` 는 단순 업로드 전역 확장자 허용 목록이다.
- `file.upload.types.{key}.folder` 는 실제 저장 폴더명이다. 설정되지 않은 folder 값도 전역 정책을 통과하면 동적 폴더로 저장할 수 있다.
- `file.upload.types.{key}.image-only``true` 이면 이미지 확장자만 허용한다.
- `file.upload.types.{key}.resize.enabled``true` 이고 업로드 파일이 이미지이면 resize 함수를 거친다. `width``height` 가 모두 있으면 중앙 crop 후 고정 크기로 저장하고, `max-width` 만 있으면 비율을 유지해 축소한다.
- `spring.servlet.multipart.max-file-size``max-request-size``-1` 로 두고, 실제 제한은 업로드 서비스 정책에서 처리한다.
## file-domain nginx 기준
- `/tus/files/` 는 tusd 로 프록시하며 `auth_request /_upload_auth``/tusFiles/uploadAuth` 를 호출한다.
- `/_upload_auth` 는 내부 location 으로만 열고 `Authorization`, `X-File-Uuid`, 필요 시 `Upload-Metadata`, `Upload-Length` 헤더를 API 로 전달한다.
- `/uploads/``/srv/project/alist/uploads/` 를 정적 파일로 제공한다.
- `/uploads/tmp/` 는 tusd 임시 파일 노출을 막기 위해 404 처리한다.
- 그 외 경로는 `location /` fallback 에서 차단한다.
## 실행 명령
- 로컬 실행: `./gradlew bootRun`
- 테스트 실행: `./gradlew test`