feat(packs): per-domain resource packs stored on Nextcloud, served at /pack/<domain>.zip

- api: /api/packs upload/list/delete (zip + pack.mcmeta check, SHA1), files go to
  Nextcloud WebDAV; public GET /pack/<domain>.zip streams from Nextcloud
- nginx: unlimited body for /api/packs/, separate :81 server that only serves /pack/
- frontend: 리소스팩 page with upload progress and server.properties snippet
- compose: NEXTCLOUD_* env from .env, 8081:81 mapping

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-23 15:46:05 +09:00
parent 7362b45846
commit 5474dc2fca
12 changed files with 444 additions and 2 deletions

View File

@@ -3,4 +3,4 @@
# 502 가 나는 경우가 있어 image 안에 직접 포함시킨다.)
FROM nginx:alpine
COPY nginx.conf /etc/nginx/nginx.conf
EXPOSE 80
EXPOSE 80 81

View File

@@ -23,6 +23,21 @@ http {
proxy_set_header X-Forwarded-Proto $scheme;
}
# 리소스팩 업로드: 크기 제한 없음 (Nextcloud 로 넘어가므로)
# 정규식으로 둔다: prefix "/api/packs/" 면 nginx 가 GET /api/packs 를 301 로 돌려버린다
location ~ ^/api/packs/ {
client_max_body_size 0;
proxy_request_buffering off;
proxy_read_timeout 600s;
proxy_send_timeout 600s;
proxy_pass http://mc_api;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
location = /health {
proxy_pass http://mc_api;
}
@@ -38,4 +53,26 @@ http {
proxy_set_header X-Forwarded-Proto $scheme;
}
}
# 리소스팩 공개 다운로드 전용 (외부 mc.tkrmagid.kr/pack/ 이 이 포트로 연결됨).
# 대시보드/API 와 포트를 분리해서, 외부에서는 /pack/ 말고는 아무것도 닿지 않게 한다.
server {
listen 81;
server_name _;
location /pack/ {
limit_except GET HEAD { deny all; }
proxy_buffering off;
proxy_read_timeout 600s;
proxy_pass http://mc_api;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location / {
return 404;
}
}
}