fix: upload limit 500MB, mount all public dirs in docker
Deploy to VPS / deploy (push) Has been cancelled
@@ -59,7 +59,14 @@ services:
|
||||
SMTP_SECURE: ${SMTP_SECURE}
|
||||
NODE_ENV: production
|
||||
volumes:
|
||||
|
||||
|
||||
- ./public/footage:/app/public/footage
|
||||
- ./public/applications:/app/public/applications
|
||||
- ./public/cases:/app/public/cases
|
||||
- ./public/news:/app/public/news
|
||||
- ./public/parts:/app/public/parts
|
||||
- ./public/operations-inbox:/app/public/operations-inbox
|
||||
networks:
|
||||
- flux-net
|
||||
expose:
|
||||
|
||||
@@ -22,6 +22,7 @@ server {
|
||||
server {
|
||||
listen 443 ssl;
|
||||
http2 on;
|
||||
client_max_body_size 500M;
|
||||
server_name rf-flux.com www.rf-flux.com;
|
||||
|
||||
ssl_certificate /etc/letsencrypt/live/rf-flux.com/fullchain.pem;
|
||||
|
||||
@@ -17,7 +17,7 @@ http {
|
||||
tcp_nodelay on;
|
||||
keepalive_timeout 65;
|
||||
types_hash_max_size 2048;
|
||||
client_max_body_size 50M;
|
||||
client_max_body_size 500M;
|
||||
|
||||
gzip on;
|
||||
gzip_vary on;
|
||||
|
||||
|
Before Width: | Height: | Size: 95 KiB After Width: | Height: | Size: 95 KiB |
|
Before Width: | Height: | Size: 3.9 MiB After Width: | Height: | Size: 3.9 MiB |
|
Before Width: | Height: | Size: 4.2 MiB After Width: | Height: | Size: 4.2 MiB |
|
Before Width: | Height: | Size: 3.9 MiB After Width: | Height: | Size: 3.9 MiB |
|
Before Width: | Height: | Size: 3.9 MiB After Width: | Height: | Size: 3.9 MiB |
|
Before Width: | Height: | Size: 3.8 MiB After Width: | Height: | Size: 3.8 MiB |
|
Before Width: | Height: | Size: 133 KiB After Width: | Height: | Size: 133 KiB |
|
Before Width: | Height: | Size: 297 KiB After Width: | Height: | Size: 297 KiB |
|
Before Width: | Height: | Size: 146 KiB After Width: | Height: | Size: 146 KiB |
|
Before Width: | Height: | Size: 10 MiB After Width: | Height: | Size: 10 MiB |
|
Before Width: | Height: | Size: 11 MiB After Width: | Height: | Size: 11 MiB |
|
Before Width: | Height: | Size: 12 MiB After Width: | Height: | Size: 12 MiB |
|
After Width: | Height: | Size: 392 KiB |
|
Before Width: | Height: | Size: 36 MiB After Width: | Height: | Size: 36 MiB |
|
Before Width: | Height: | Size: 1.1 MiB After Width: | Height: | Size: 1.1 MiB |
|
Before Width: | Height: | Size: 147 KiB After Width: | Height: | Size: 147 KiB |
|
Before Width: | Height: | Size: 2.1 MiB After Width: | Height: | Size: 2.1 MiB |
|
Before Width: | Height: | Size: 889 KiB After Width: | Height: | Size: 889 KiB |
|
After Width: | Height: | Size: 392 KiB |
|
Before Width: | Height: | Size: 406 KiB After Width: | Height: | Size: 406 KiB |
|
Before Width: | Height: | Size: 1.1 MiB After Width: | Height: | Size: 1.1 MiB |
|
Before Width: | Height: | Size: 1.1 MiB After Width: | Height: | Size: 1.1 MiB |
|
Before Width: | Height: | Size: 889 KiB After Width: | Height: | Size: 889 KiB |
|
Before Width: | Height: | Size: 730 KiB After Width: | Height: | Size: 730 KiB |
|
Before Width: | Height: | Size: 1.5 MiB After Width: | Height: | Size: 1.5 MiB |
|
Before Width: | Height: | Size: 1.1 MiB After Width: | Height: | Size: 1.1 MiB |
|
Before Width: | Height: | Size: 1.1 MiB After Width: | Height: | Size: 1.1 MiB |
|
Before Width: | Height: | Size: 889 KiB After Width: | Height: | Size: 889 KiB |
|
Before Width: | Height: | Size: 1.4 MiB After Width: | Height: | Size: 1.4 MiB |
|
Before Width: | Height: | Size: 89 KiB After Width: | Height: | Size: 89 KiB |
|
Before Width: | Height: | Size: 166 KiB After Width: | Height: | Size: 166 KiB |
|
Before Width: | Height: | Size: 324 KiB After Width: | Height: | Size: 324 KiB |
|
Before Width: | Height: | Size: 341 KiB After Width: | Height: | Size: 341 KiB |
|
Before Width: | Height: | Size: 107 KiB After Width: | Height: | Size: 107 KiB |
|
Before Width: | Height: | Size: 155 KiB After Width: | Height: | Size: 155 KiB |
|
Before Width: | Height: | Size: 70 KiB After Width: | Height: | Size: 70 KiB |
|
Before Width: | Height: | Size: 130 KiB After Width: | Height: | Size: 130 KiB |
|
Before Width: | Height: | Size: 97 KiB After Width: | Height: | Size: 97 KiB |
|
Before Width: | Height: | Size: 163 KiB After Width: | Height: | Size: 163 KiB |
|
Before Width: | Height: | Size: 183 KiB After Width: | Height: | Size: 183 KiB |
|
Before Width: | Height: | Size: 98 KiB After Width: | Height: | Size: 98 KiB |
|
Before Width: | Height: | Size: 193 KiB After Width: | Height: | Size: 193 KiB |
|
Before Width: | Height: | Size: 1.1 MiB After Width: | Height: | Size: 1.1 MiB |
|
Before Width: | Height: | Size: 1.1 MiB After Width: | Height: | Size: 1.1 MiB |
|
Before Width: | Height: | Size: 889 KiB After Width: | Height: | Size: 889 KiB |
|
Before Width: | Height: | Size: 2.3 MiB After Width: | Height: | Size: 2.3 MiB |
|
Before Width: | Height: | Size: 1.5 MiB After Width: | Height: | Size: 1.5 MiB |
|
Before Width: | Height: | Size: 1.4 MiB After Width: | Height: | Size: 1.4 MiB |
|
Before Width: | Height: | Size: 3.7 MiB After Width: | Height: | Size: 3.7 MiB |
|
Before Width: | Height: | Size: 1.4 MiB After Width: | Height: | Size: 1.4 MiB |
|
Before Width: | Height: | Size: 1.1 MiB After Width: | Height: | Size: 1.1 MiB |
@@ -176,8 +176,8 @@ export async function POST(request: NextRequest) {
|
||||
if (!ALL_EXTENSIONS.includes(ext)) {
|
||||
return NextResponse.json({ error: `Type "${ext}" not allowed. Accepted: ${ALL_EXTENSIONS.join(", ")}` }, { status: 400 });
|
||||
}
|
||||
if (file.size > 50 * 1024 * 1024) {
|
||||
return NextResponse.json({ error: "File exceeds 50MB limit" }, { status: 400 });
|
||||
if (file.size > 500 * 1024 * 1024) {
|
||||
return NextResponse.json({ error: "File exceeds 500MB limit" }, { status: 400 });
|
||||
}
|
||||
|
||||
const dirPath = buildSafePath(scope, slug, subPath);
|
||||
|
||||
@@ -4,7 +4,7 @@ import path from "path";
|
||||
|
||||
// 1. REGLAS DE SEGURIDAD ESTRICTAS
|
||||
const ALLOWED_EXTENSIONS = ['.jpg', '.jpeg', '.png', '.webp', '.mp4', '.mov'];
|
||||
const MAX_FILE_SIZE = 50 * 1024 * 1024; // 50MB Límite
|
||||
const MAX_FILE_SIZE = 500 * 1024 * 1024; // 500MB Límite
|
||||
|
||||
export async function POST(request: NextRequest) {
|
||||
try {
|
||||
@@ -19,7 +19,7 @@ export async function POST(request: NextRequest) {
|
||||
}
|
||||
|
||||
if (file.size > MAX_FILE_SIZE) {
|
||||
return NextResponse.json({ error: "El archivo excede el límite de 50MB" }, { status: 400 });
|
||||
return NextResponse.json({ error: "El archivo excede el límite de 500MB" }, { status: 400 });
|
||||
}
|
||||
|
||||
const ext = path.extname(file.name).toLowerCase();
|
||||
|
||||