From 9ddf624ab254716eeeaed2e008836ddc44e9d573 Mon Sep 17 00:00:00 2001 From: marshyski <3740784+marshyski@users.noreply.github.com> Date: Fri, 12 Apr 2024 15:19:11 -0400 Subject: [PATCH] Disable CSRFToken requests and increase upload client max body size --- ui/h3.nginx.conf | 9 +++++---- ui/nginx.conf | 1 + ui/static/js/functions.js | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/ui/h3.nginx.conf b/ui/h3.nginx.conf index e0f600c..1c189b5 100755 --- a/ui/h3.nginx.conf +++ b/ui/h3.nginx.conf @@ -136,7 +136,7 @@ server { # Opensearch Dashboards route location /opensearch_dashboards { - client_max_body_size 40M; + client_max_body_size 100M; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; @@ -149,7 +149,7 @@ server { # API route location /v1 { - client_max_body_size 40M; + client_max_body_size 100M; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; @@ -163,6 +163,7 @@ server { # Swagger apidocs route location ~ ^/(apidocs|flasgger_static|apispec_[0-9].json) { + client_max_body_size 100M; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; @@ -175,7 +176,7 @@ server { # Docs route location /docs { - client_max_body_size 40M; + client_max_body_size 10M; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; @@ -189,7 +190,7 @@ server { # UI route location /ui { - client_max_body_size 40M; + client_max_body_size 100M; alias /usr/share/nginx/html; index index.html; } diff --git a/ui/nginx.conf b/ui/nginx.conf index 626bc0a..3f0c3a5 100755 --- a/ui/nginx.conf +++ b/ui/nginx.conf @@ -44,6 +44,7 @@ http { open_file_cache_valid 30s; open_file_cache_min_uses 2; open_file_cache_errors on; + client_max_body_size 100M; # copies data between one FD and other from within the kernel # faster then read() + write() diff --git a/ui/static/js/functions.js b/ui/static/js/functions.js index 14e7530..2966e09 100755 --- a/ui/static/js/functions.js +++ b/ui/static/js/functions.js @@ -18,7 +18,7 @@ async function getCsrfToken () { // Function to handle all fetch requests export async function fetchRequest (apiUrl, method = 'GET', body = null, headers = { 'Content-Type': 'application/json' }) { - headers['X-CSRFToken'] = await getCsrfToken() + // headers['X-CSRFToken'] = await getCsrfToken() const res = fetch(apiUrl, { method: method, body: body,