From bc60120758e68e6377c292835ab44db9f3250b26 Mon Sep 17 00:00:00 2001 From: Igor Santos Date: Tue, 24 Sep 2024 11:39:27 -0300 Subject: [PATCH 1/3] fix(wsgi): add settings to increase size uploads limit --- app/wsgi.ini | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/wsgi.ini b/app/wsgi.ini index 2ac17f36..ba6bd327 100644 --- a/app/wsgi.ini +++ b/app/wsgi.ini @@ -6,4 +6,8 @@ processes = 4 threads = 2 http = 0.0.0.0:8000 die-on-term = true -buffer-size=131070 \ No newline at end of file +buffer-size = 65535 +post-buffering = 4096 +limit-post = 62914560 # 60 MB (ajuste para seu limite) +harakiri = 120 # Tempo em segundos +socket-timeout = 120 \ No newline at end of file From 4c9a2a4021fc09e0282d35fb7875a171a0474f62 Mon Sep 17 00:00:00 2001 From: Igor Santos Date: Tue, 24 Sep 2024 11:49:23 -0300 Subject: [PATCH 2/3] fix(wsgi): observe wsgi file in Github deploy workflows --- .github/workflows/pubish_org_eleicoes.yml | 1 + .github/workflows/publish_org_amazonia_de_pe.yml | 1 + .github/workflows/publish_org_nossas.yml | 1 + app/wsgi.ini | 6 ++++-- 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pubish_org_eleicoes.yml b/.github/workflows/pubish_org_eleicoes.yml index ae142d4a..0a3f932a 100644 --- a/.github/workflows/pubish_org_eleicoes.yml +++ b/.github/workflows/pubish_org_eleicoes.yml @@ -6,6 +6,7 @@ on: - 'app/project/**' - 'app/tailwind/**' - 'app/admin_styled/**' + - 'app/wsgi.ini' - 'app/org_eleicoes/**' branches: - main diff --git a/.github/workflows/publish_org_amazonia_de_pe.yml b/.github/workflows/publish_org_amazonia_de_pe.yml index e2f7aa89..0ee4c2c0 100644 --- a/.github/workflows/publish_org_amazonia_de_pe.yml +++ b/.github/workflows/publish_org_amazonia_de_pe.yml @@ -6,6 +6,7 @@ on: - 'app/project/**' - 'app/tailwind/**' - 'app/admin_styled/**' + - 'app/wsgi.ini' - 'app/org_amazonia_de_pe/**' branches: - main diff --git a/.github/workflows/publish_org_nossas.yml b/.github/workflows/publish_org_nossas.yml index 74d44c04..57bb4d40 100644 --- a/.github/workflows/publish_org_nossas.yml +++ b/.github/workflows/publish_org_nossas.yml @@ -6,6 +6,7 @@ on: - 'app/project/**' - 'app/tailwind/**' - 'app/admin_styled/**' + - 'app/wsgi.ini' - 'app/org_nossas/**' branches: - main diff --git a/app/wsgi.ini b/app/wsgi.ini index ba6bd327..d8f66aa8 100644 --- a/app/wsgi.ini +++ b/app/wsgi.ini @@ -8,6 +8,8 @@ http = 0.0.0.0:8000 die-on-term = true buffer-size = 65535 post-buffering = 4096 -limit-post = 62914560 # 60 MB (ajuste para seu limite) -harakiri = 120 # Tempo em segundos +# 60 MB (ajuste para seu limite) +limit-post = 62914560 +# Tempo em segundos +harakiri = 120 socket-timeout = 120 \ No newline at end of file From 3ca98904d52bd2daee2158b6b506ea6540a65a9f Mon Sep 17 00:00:00 2001 From: Igor Santos Date: Tue, 24 Sep 2024 15:22:17 -0300 Subject: [PATCH 3/3] fix(vote): change buffer size in traefik service to upload large files --- deploy/docker-compose.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/deploy/docker-compose.yml b/deploy/docker-compose.yml index 9a8e303c..ac09ba17 100644 --- a/deploy/docker-compose.yml +++ b/deploy/docker-compose.yml @@ -59,6 +59,9 @@ services: - traefik.http.routers.votepeloclima.tls=true - traefik.http.routers.votepeloclima.tls.certresolver=myresolver - traefik.http.routers.votepeloclima.rule=${VOTEPELOCLIMA_TRAEFIK_ROUTERS_RULE:-HostRegexp(`votepeloclima.staging.bonde.org`,`www.votepeloclima.staging.bonde.org`)} + # Regras de upload + - traefik.http.middlewares.votepeloclima.buffering.maxRequestBodyBytes=62914560 + - traefik.http.middlewares.votepeloclima.buffering.maxResponseBodyBytes=62914560 nossas: image: ${NOSSAS_DOCKER_IMAGE:-nossas/nossas-cms:latest}