Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into nightly
Browse files Browse the repository at this point in the history
  • Loading branch information
Overhang.IO committed Feb 7, 2023
2 parents bbab35e + 4b14d20 commit 928859c
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- [Improvement] Make it possible to override the max upload size in the LMS and the CMS. This is achieved by moving the "caddyfile-lms" and "caddyfile-cms" patches just before the `import proxy` declarations. We also wrap the `request_body` directives within `handle` statements, which means that the `max_body` sizes can be overridden for specific paths. (by @regisb)
2 changes: 1 addition & 1 deletion docs/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ This configuration parameter defines the name of the Docker image to run for the

This configuration paramater defines the name of the Docker image to run the development version of the lms and cms containers. By default, the Docker image tag matches the Tutor version it was built with.

- ``DOCKER_IMAGE_CADDY`` (default: ``"docker.io/caddy:2.4.6"``)
- ``DOCKER_IMAGE_CADDY`` (default: ``"docker.io/caddy:2.6.2"``)

This configuration paramater defines which Caddy Docker image to use.

Expand Down
25 changes: 16 additions & 9 deletions tutor/templates/apps/caddy/Caddyfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,21 @@
rewrite @favicon_matcher /theming/asset/images/favicon.ico

# Limit profile image upload size
request_body /api/profile_images/*/*/upload {
max_size 1MB
}
request_body {
max_size 4MB
handle_path /api/profile_images/*/*/upload {
request_body {
max_size 1MB
}
}

import proxy "lms:8000"

{{ patch("caddyfile-lms")|indent(4) }}

handle_path /* {
request_body {
max_size 4MB
}
}
}

{{ CMS_HOST }}{$default_site_port} {
Expand All @@ -55,13 +60,15 @@
}
rewrite @favicon_matcher /theming/asset/images/favicon.ico

request_body {
max_size 250MB
}

import proxy "cms:8000"

{{ patch("caddyfile-cms")|indent(4) }}

handle_path /* {
request_body {
max_size 250MB
}
}
}

{{ patch("caddyfile") }}
2 changes: 1 addition & 1 deletion tutor/templates/config/defaults.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ DOCKER_COMPOSE_VERSION: "3.7"
DOCKER_REGISTRY: "docker.io/"
DOCKER_IMAGE_OPENEDX: "{{ DOCKER_REGISTRY }}overhangio/openedx:{{ TUTOR_VERSION }}"
DOCKER_IMAGE_OPENEDX_DEV: "openedx-dev:{{ TUTOR_VERSION }}"
DOCKER_IMAGE_CADDY: "docker.io/caddy:2.4.6"
DOCKER_IMAGE_CADDY: "docker.io/caddy:2.6.2"
DOCKER_IMAGE_ELASTICSEARCH: "docker.io/elasticsearch:7.10.1"
DOCKER_IMAGE_MONGODB: "docker.io/mongo:4.2.17"
DOCKER_IMAGE_MYSQL: "docker.io/mysql:5.7.35"
Expand Down

0 comments on commit 928859c

Please sign in to comment.