+1
-1
@@ -34,7 +34,7 @@ services:
|
||||
environment:
|
||||
FILE_STORAGE_PATH: /data/uploads
|
||||
MAX_FILE_SIZE: 10737418240
|
||||
FILE_CHUNK_SIZE: 1000000
|
||||
FILE_CHUNK_SIZE: 5242880
|
||||
POSTGRES_DB: no_copy_
|
||||
POSTGRES_USER: postgres
|
||||
POSTGRES_PASSWORD: postgres
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
package ru.soune.nocopy.configuration.file;
|
||||
|
||||
import jakarta.servlet.MultipartConfigElement;
|
||||
import org.springframework.boot.web.servlet.MultipartConfigFactory;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.util.unit.DataSize;
|
||||
|
||||
@Configuration
|
||||
public class MultipartConfiguration {
|
||||
|
||||
@Bean
|
||||
public MultipartConfigElement multipartConfigElement() {
|
||||
MultipartConfigFactory factory = new MultipartConfigFactory();
|
||||
|
||||
factory.setMaxFileSize(DataSize.ofGigabytes(10));
|
||||
factory.setMaxRequestSize(DataSize.ofGigabytes(10));
|
||||
|
||||
factory.setFileSizeThreshold(DataSize.ofBytes(0));
|
||||
|
||||
|
||||
return factory.createMultipartConfig();
|
||||
}
|
||||
}
|
||||
@@ -16,22 +16,29 @@ spring:
|
||||
|
||||
servlet:
|
||||
multipart:
|
||||
max-file-size: 10MB
|
||||
max-request-size: 100MB
|
||||
enabled: true
|
||||
resolve-lazily: false
|
||||
resolve-lazily: true
|
||||
file-size-threshold: 0
|
||||
max-file-size: 10GB
|
||||
max-request-size: 10GB
|
||||
|
||||
file:
|
||||
storage:
|
||||
base-path: ${FILE_STORAGE_PATH:/data/uploads}
|
||||
# chunk-size: ${FILE_CHUNK_SIZE:5242880} # 5MB
|
||||
chunk-size: ${FILE_CHUNK_SIZE:1000000} # 5MB
|
||||
chunk-size: ${FILE_CHUNK_SIZE:5242880} # 5MB
|
||||
max-file-size: ${MAX_FILE_SIZE:10737418240} # 10GB
|
||||
max-retry-attempts: ${MAX_RETRY_ATTEMPTS:3}
|
||||
chunk-timeout-ms: ${CHUNK_TIMEOUT_MS:300000} # 5 минут
|
||||
temp-ttl-hours: ${TEMP_TTL_HOURS:72} # 3 дня
|
||||
chunk-timeout-ms: ${CHUNK_TIMEOUT_MS:300000}
|
||||
temp-ttl-hours: ${TEMP_TTL_HOURS:72}
|
||||
session-expiry-hours: ${SESSION_EXPIRY_HOURS:24}
|
||||
|
||||
server:
|
||||
port: ${SERVER_PORT:8080}
|
||||
tomcat:
|
||||
max-swallow-size: -1
|
||||
max-http-form-post-size: -1
|
||||
connection-timeout: 300000
|
||||
|
||||
security:
|
||||
cors:
|
||||
allowed-origins: "*"
|
||||
@@ -39,15 +46,12 @@ security:
|
||||
allowed-headers: "*"
|
||||
allow-credentials: true
|
||||
|
||||
server:
|
||||
port: ${SERVER_PORT:8080}
|
||||
|
||||
logging:
|
||||
level:
|
||||
com.example.fileupload: DEBUG
|
||||
org.springframework.web: DEBUG
|
||||
org.springframework.web.multipart: TRACE
|
||||
org.apache.tomcat: DEBUG
|
||||
org.hibernate.SQL: DEBUG
|
||||
file:
|
||||
name: logs/application.log
|
||||
pattern:
|
||||
console: "%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %msg%n"
|
||||
name: logs/application.log
|
||||
Reference in New Issue
Block a user