Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow 4GB file uploads #3166

Merged
merged 9 commits into from
Mar 26, 2024
8 changes: 7 additions & 1 deletion packages/client/hmi-client/docker/default.conf
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,13 @@ server {
server_name _;

# max file size. Should be kept in sync with the value in application.properties
client_max_body_size 1024M;
client_max_body_size 4096M;

# disable buffering of response bodies to a temporary file
proxy_buffering off;

# disable buffering of request bodies to a temporary file
proxy_request_buffering off;

access_log /var/log/nginx/access.log combined_no_query;
add_header X-Frame-Options SAMEORIGIN;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import co.elastic.clients.elasticsearch._types.query_dsl.TermsQuery;
import co.elastic.clients.elasticsearch._types.query_dsl.TermsQueryField;
import com.fasterxml.jackson.databind.JsonNode;
import com.google.common.collect.ImmutableList;
import com.google.common.math.Quantiles;
import com.google.common.math.Stats;
import io.swagger.v3.oas.annotations.Operation;
Expand Down Expand Up @@ -44,10 +43,6 @@
import software.uncharted.terarium.hmiserver.proxies.jsdelivr.JsDelivrProxy;
import software.uncharted.terarium.hmiserver.security.Roles;
import software.uncharted.terarium.hmiserver.service.data.DatasetService;
import ucar.ma2.Array;
import ucar.nc2.Attribute;
import ucar.nc2.NetcdfFile;
import ucar.nc2.NetcdfFiles;

import java.io.IOException;
import java.io.StringReader;
Expand Down Expand Up @@ -284,10 +279,9 @@ ResponseEntity<Dataset> updateDataset(
@ApiResponse(responseCode = "500", description = "There was an issue retrieving the dataset from the data store", content = @Content)
})
public ResponseEntity<CsvAsset> getCsv(
@PathVariable("id") final UUID datasetId,
@RequestParam("filename") final String filename,
@RequestParam(name = "limit", defaultValue = "-1", required = false) final Integer limit // -1 means no
// limit
@PathVariable("id") final UUID datasetId,
@RequestParam("filename") final String filename,
@RequestParam(name = "limit", defaultValue = "" + DEFAULT_CSV_LIMIT, required = false) final Integer limit
bigglesandginger marked this conversation as resolved.
Show resolved Hide resolved
) {

final List<List<String>> csv;
Expand Down
4 changes: 2 additions & 2 deletions packages/server/src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ server.http2.enabled=true
spring.jackson.default-property-inclusion=NON_NULL
spring.jackson.mapper.ACCEPT_CASE_INSENSITIVE_ENUMS=true

spring.servlet.multipart.max-file-size=1GB
spring.servlet.multipart.max-request-size=1GB
spring.servlet.multipart.max-file-size=4GB
spring.servlet.multipart.max-request-size=4GB

logging.level.org.springframework.web.servlet.mvc.support.DefaultHandlerExceptionResolver=ERROR
#swagger configuration
Expand Down
Loading