diff --git a/README.md b/README.md index c59ca04..5c14b58 100755 --- a/README.md +++ b/README.md @@ -104,6 +104,11 @@ The private key file to use for SSL. **Note**: _The file MUST be stored in `/ssl/`, which is the default for Hass.io_ +### Option: `max_upload_size` + +Maximum file size for uploads, defaults if not specified to 1Mb. Should be +specified as an integer, i.e. 2 for 2Mb. + ## Embedding into Home Assistant It is possible to embed the Grocy interface directly into @@ -121,10 +126,6 @@ panel_iframe: url: http://addres.to.your.hass.io:9192 ``` -## Known issues and limitations - -- Lorem ipsum. - ## Changelog & Releases This repository keeps a change log using [GitHub's releases][releases] diff --git a/grocy/config.json b/grocy/config.json index 5f85c6e..11f2a02 100755 --- a/grocy/config.json +++ b/grocy/config.json @@ -53,6 +53,7 @@ "tasks": "bool" }, "certfile": "str", - "keyfile": "str" + "keyfile": "str", + "max_upload_size": "int?" } } diff --git a/grocy/rootfs/etc/cont-init.d/11-nginx.sh b/grocy/rootfs/etc/cont-init.d/11-nginx.sh index 0a05dff..81fb037 100755 --- a/grocy/rootfs/etc/cont-init.d/11-nginx.sh +++ b/grocy/rootfs/etc/cont-init.d/11-nginx.sh @@ -16,3 +16,8 @@ if bashio::config.true 'ssl'; then sed -i "s/%%certfile%%/${certfile}/g" /etc/nginx/nginx.conf sed -i "s/%%keyfile%%/${keyfile}/g" /etc/nginx/nginx.conf fi + +if bashio::config.exists 'max_upload_size'; then + sed -i "s#client_max_body_size 1M#client_max_body_size \ + $(bashio::config 'max_upload_size')M#g" /etc/nginx/nginx.conf +fi diff --git a/grocy/rootfs/etc/nginx/nginx-ssl.conf b/grocy/rootfs/etc/nginx/nginx-ssl.conf index efe737b..95e65f2 100755 --- a/grocy/rootfs/etc/nginx/nginx-ssl.conf +++ b/grocy/rootfs/etc/nginx/nginx-ssl.conf @@ -11,6 +11,7 @@ http { default_type application/octet-stream; sendfile on; keepalive_timeout 65; + client_max_body_size 1M; server { server_name hassio.local; diff --git a/grocy/rootfs/etc/nginx/nginx.conf b/grocy/rootfs/etc/nginx/nginx.conf index a6a7a82..4f0431f 100755 --- a/grocy/rootfs/etc/nginx/nginx.conf +++ b/grocy/rootfs/etc/nginx/nginx.conf @@ -11,6 +11,7 @@ http { default_type application/octet-stream; sendfile on; keepalive_timeout 65; + client_max_body_size 1M; server { server_name hassio.local;