Skip to content

Commit baec4f3

Browse files
committed
feat: make maximum upload size configurable
1 parent 6f014ae commit baec4f3

File tree

6 files changed

+11
-2
lines changed

6 files changed

+11
-2
lines changed

deploy/docker/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ Image can be configured by setting environment variables.
3636
| `ENCRYPTION_PASSWORD` | Encryption password | `lowcoder.org` |
3737
| `ENCRYPTION_SALT` | Salt used for encrypting password | `lowcoder.org` |
3838
| `CORS_ALLOWED_DOMAINS` | CORS allowed domains | `*` |
39+
| `LOWCODER_MAX_REQUEST_SIZE` | Lowcoder max request size | `5m` |
3940
| `LOWCODER_API_SERVICE_URL` | Lowcoder API service URL | `http://localhost:8080` |
4041
| `LOWCODER_NODE_SERVICE_URL` | Lowcoder Node service (js executor) URL | `http://localhost:6060` |
4142
| `DEFAULT_ORGS_PER_USER` | Default maximum organizations per user | `100` |
@@ -121,6 +122,7 @@ Image can be configured by setting environment variables.
121122
| --------------------------------| --------------------------------------------------------------------| ------------------------------------------------------- |
122123
| `PUID` | ID of user running services. It will own all created logs and data. | `9001` |
123124
| `PGID` | ID of group of the user running services. | `9001` |
125+
| `LOWCODER_MAX_REQUEST_SIZE` | Lowcoder max request size | `5m` |
124126
| `LOWCODER_API_SERVICE_URL` | Lowcoder API service URL | `http://localhost:8080` |
125127
| `LOWCODER_NODE_SERVICE_URL` | Lowcoder Node service (js executor) URL | `http://localhost:6060` |
126128

deploy/docker/docker-compose-multi.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ services:
7575
environment:
7676
PUID: "9001"
7777
PGID: "9001"
78+
LOWCODER_MAX_REQUEST_SIZE: 5m
7879
LOWCODER_API_SERVICE_URL: "http://lowcoder-api-service:8080"
7980
LOWCODER_NODE_SERVICE_URL: "http://lowcoder-node-service:6060"
8081
restart: unless-stopped

deploy/docker/docker-compose.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ services:
3636
# api and node service parameters
3737
LOWCODER_API_SERVICE_URL: "http://localhost:8080"
3838
LOWCODER_NODE_SERVICE_URL: "http://localhost:6060"
39+
# frontend parameters
40+
LOWCODER_MAX_REQUEST_SIZE: 5m
3941
volumes:
4042
- ./lowcoder-stacks:/lowcoder-stacks
4143
restart: unless-stopped

deploy/docker/frontend/01-update-nginx-conf.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,11 @@ else
1818
ln -s /etc/nginx/nginx-http.conf /etc/nginx/nginx.conf
1919
fi;
2020

21+
sed -i "s@__LOWCODER_MAX_REQUEST_SIZE__@${LOWCODER_MAX_REQUEST_SIZE:=5m}@" /etc/nginx/nginx.conf
2122
sed -i "s@__LOWCODER_API_SERVICE_URL__@${LOWCODER_API_SERVICE_URL:=http://localhost:8080}@" /etc/nginx/nginx.conf
2223
sed -i "s@__LOWCODER_NODE_SERVICE_URL__@${LOWCODER_NODE_SERVICE_URL:=http://localhost:6060}@" /etc/nginx/nginx.conf
2324

2425
echo "nginx config updated with:"
25-
echo " Lowcoder api service URL: ${LOWCODER_API_SERVICE_URL}"
26-
echo " Lowcoder node service URL: ${LOWCODER_NODE_SERVICE_URL}"
26+
echo " Lowcoder max upload size: ${LOWCODER_MAX_REQUEST_SIZE:=5m}"
27+
echo " Lowcoder api service URL: ${LOWCODER_API_SERVICE_URL:=http://localhost:8080}"
28+
echo " Lowcoder node service URL: ${LOWCODER_NODE_SERVICE_URL:=http://localhost:6060}"

deploy/docker/frontend/nginx-http.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ http {
1010

1111
include /etc/nginx/mime.types;
1212
default_type application/octet-stream;
13+
client_max_body_size __LOWCODER_MAX_REQUEST_SIZE__;
1314

1415
log_format main '"$time_local" client=$remote_addr '
1516
'method=$request_method request="$request" '

deploy/docker/frontend/nginx-https.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ http {
1010

1111
include /etc/nginx/mime.types;
1212
default_type application/octet-stream;
13+
client_max_body_size __LOWCODER_MAX_REQUEST_SIZE__;
1314

1415
log_format main '"$time_local" client=$remote_addr '
1516
'method=$request_method request="$request" '

0 commit comments

Comments
 (0)