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

OPSEXP-3015: set secure, sensible yet usable default for max upload files #1049

Merged
merged 5 commits into from
Feb 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .envrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export AWS_REGION=eu-west-1
export MOLECULE_IT_AWS_VPC_SUBNET_ID=subnet-6bdd4223
export BRANCH_NAME=local
export BUILD_NUMBER=1
export DTAS_VERSION=v1.6.0
export DTAS_VERSION=v1.6.1
export MOLECULE_IT_ID=$(echo "$LOGNAME" | sha256sum | cut -c1-6)
ANSIBLE_VAULT_PASSWORD_FILE=$(expand_path ./.vault_pass.txt)
export ANSIBLE_VAULT_PASSWORD_FILE
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/enteprise.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ on:
workflow_dispatch:

env:
DTAS_VERSION: v1.6.0
DTAS_VERSION: v1.6.1
BUILD_NUMBER: ${{ github.run_id }}
PY_COLORS: 1
PYTHONUNBUFFERED: 1
Expand Down
1 change: 0 additions & 1 deletion roles/adf_app/templates/default_server.conf.j2
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
server {
listen {{ adf_app_port }};
client_max_body_size 0;

set $allowOriginSite *;
proxy_pass_request_headers on;
Expand Down
5 changes: 5 additions & 0 deletions roles/nginx/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,9 @@ setup_vhosts: true

# Disable when nginx node is behind another reverse proxy (e.g. AWS ELB)
nginx_set_proxy_headers: true

nginx_absolute_redirect: true

# Allow 5GB or 20 minutes long max uploads by default
nginx_max_upload_size: "5g"
nginx_max_upload_time: "20m"
8 changes: 8 additions & 0 deletions roles/nginx/meta/argument_specs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,11 @@ argument_specs:
description: Useful when nginx node is behind another reverse proxy (e.g. should be disabled when behind an AWS ELB)
type: bool
default: true
nginx_max_upload_size:
description: The maximum allowed size of an upload (client request body)
type: str
default: 5g
nginx_max_upload_time:
description: Timeout of uploads (client requests read timeout)
type: str
default: 20m
6 changes: 4 additions & 2 deletions roles/nginx/templates/alfresco_proxy.include.j2
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
client_max_body_size 0;

absolute_redirect {{ 'on' if nginx_absolute_redirect else 'off' }};

set $allowOriginSite *;
Expand Down Expand Up @@ -30,11 +28,15 @@
#ENV_ACCESS_LOG

location /share/ {
client_max_body_size {{ nginx_max_upload_size }};
client_body_timeout {{ nginx_max_upload_time }};
proxy_pass http://share_lb;
include {{ nginx_vhost_path }}/alfresco_proxy_headers.include;
}

location /alfresco/ {
client_max_body_size {{ nginx_max_upload_size }};
client_body_timeout {{ nginx_max_upload_time }};
proxy_pass http://repo_lb;
include {{ nginx_vhost_path }}/alfresco_proxy_headers.include;
}
Expand Down
Loading