Add user config option for upload size

This commit is contained in:
Paul Sinclair 2019-04-05 20:02:26 -04:00
parent 95e878a1ee
commit c54ee540a6
No known key found for this signature in database
GPG key ID: 779C7A23E1AA845D
5 changed files with 14 additions and 5 deletions

View file

@ -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_ **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 ## Embedding into Home Assistant
It is possible to embed the Grocy interface directly into It is possible to embed the Grocy interface directly into
@ -121,10 +126,6 @@ panel_iframe:
url: http://addres.to.your.hass.io:9192 url: http://addres.to.your.hass.io:9192
``` ```
## Known issues and limitations
- Lorem ipsum.
## Changelog & Releases ## Changelog & Releases
This repository keeps a change log using [GitHub's releases][releases] This repository keeps a change log using [GitHub's releases][releases]

View file

@ -53,6 +53,7 @@
"tasks": "bool" "tasks": "bool"
}, },
"certfile": "str", "certfile": "str",
"keyfile": "str" "keyfile": "str",
"max_upload_size": "int?"
} }
} }

View file

@ -16,3 +16,8 @@ if bashio::config.true 'ssl'; then
sed -i "s/%%certfile%%/${certfile}/g" /etc/nginx/nginx.conf sed -i "s/%%certfile%%/${certfile}/g" /etc/nginx/nginx.conf
sed -i "s/%%keyfile%%/${keyfile}/g" /etc/nginx/nginx.conf sed -i "s/%%keyfile%%/${keyfile}/g" /etc/nginx/nginx.conf
fi 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

View file

@ -11,6 +11,7 @@ http {
default_type application/octet-stream; default_type application/octet-stream;
sendfile on; sendfile on;
keepalive_timeout 65; keepalive_timeout 65;
client_max_body_size 1M;
server { server {
server_name hassio.local; server_name hassio.local;

View file

@ -11,6 +11,7 @@ http {
default_type application/octet-stream; default_type application/octet-stream;
sendfile on; sendfile on;
keepalive_timeout 65; keepalive_timeout 65;
client_max_body_size 1M;
server { server {
server_name hassio.local; server_name hassio.local;