|
18 | 18 | ln -s /etc/nginx/nginx-http.conf /etc/nginx/nginx.conf |
19 | 19 | fi; |
20 | 20 |
|
21 | | -sed -i"s@__LOWCODER_MAX_REQUEST_SIZE__@${LOWCODER_MAX_REQUEST_SIZE:=20m}@" /etc/nginx/nginx.conf |
| 21 | +# Normalize max. request size for usage with nginx |
| 22 | +MAX_REQUEST_SIZE=$(echo"${LOWCODER_MAX_REQUEST_SIZE:=20m}"| perl -pe's/^([ \t]*)(?<number>\d+(\.\d+)?)([ \t]*)(?<unit>[kKmMgGtT]{1})?([bB \t]*)$/"$+{number}" . lc($+{unit})/e') |
| 23 | + |
| 24 | + |
| 25 | +sed -i"s@__LOWCODER_MAX_REQUEST_SIZE__@${MAX_REQUEST_SIZE}@" /etc/nginx/nginx.conf |
22 | 26 | sed -i"s@__LOWCODER_MAX_QUERY_TIMEOUT__@${LOWCODER_MAX_QUERY_TIMEOUT:=120}@" /etc/nginx/server.conf |
23 | 27 | sed -i"s@__LOWCODER_API_SERVICE_URL__@${LOWCODER_API_SERVICE_URL:=http://localhost:8080}@" /etc/nginx/server.conf |
24 | 28 | sed -i"s@__LOWCODER_NODE_SERVICE_URL__@${LOWCODER_NODE_SERVICE_URL:=http://localhost:6060}@" /etc/nginx/server.conf |
25 | 29 |
|
26 | 30 | echo"nginx config updated with:" |
27 | | -echo" Lowcoder max upload size:${LOWCODER_MAX_REQUEST_SIZE:=20m}" |
| 31 | +echo" Lowcoder max upload size:${MAX_REQUEST_SIZE:=20m}" |
28 | 32 | echo" Lowcoder api service URL:${LOWCODER_API_SERVICE_URL:=http://localhost:8080}" |
29 | 33 | echo" Lowcoder node service URL:${LOWCODER_NODE_SERVICE_URL:=http://localhost:6060}" |