Permit to change the forcesave options with env variables

This commit is contained in:
Paco 2022-11-10 16:11:39 +01:00
parent c7090252ff
commit 3589af42e4
2 changed files with 12 additions and 0 deletions

View file

@ -195,6 +195,9 @@ Below is the complete list of parameters that can be set using environment varia
- **JWT_SECRET**: Defines the secret key to validate the JSON Web Token in the request to the ONLYOFFICE Document Server. Defaults to random value.
- **JWT_HEADER**: Defines the http header that will be used to send the JSON Web Token. Defaults to `Authorization`.
- **JWT_IN_BODY**: Specifies the enabling the token validation in the request body to the ONLYOFFICE Document Server. Defaults to `false`.
- **FORCESAVE_ENABLE**: Whether to activate [forcesaving](https://api.onlyoffice.com/editors/save#forcesave) on the ONLYOFFICE Document Server. Defaults to `false`.
- **FORCESAVE_INTERVAL**: Which interval to choose for forcesaving. Defaults to `5m`.
- **FORCESAVE_STEP**: Which step to choose for forcesaving. Defaults to `5m`.
- **WOPI_ENABLED**: Specifies the enabling the wopi handlers. Defaults to `false`.
- **USE_UNAUTHORIZED_STORAGE**: Set to `true`if using selfsigned certificates for your storage server e.g. Nextcloud. Defaults to `false`
- **GENERATE_FONTS**: When 'true' regenerates fonts list and the fonts thumbnails etc. at each start. Defaults to `true`

View file

@ -75,6 +75,10 @@ NGINX_CONFIG_PATH="/etc/nginx/nginx.conf"
NGINX_WORKER_PROCESSES=${NGINX_WORKER_PROCESSES:-1}
NGINX_WORKER_CONNECTIONS=${NGINX_WORKER_CONNECTIONS:-$(ulimit -n)}
FORCESAVE_ENABLE=${FORCESAVE_ENABLE:-false}
FORCESAVE_INTERVAL=${FORCESAVE_INTERVAL:-5m}
FORCESAVE_STEP=${FORCESAVE_STEP:-1m}
JWT_ENABLED=${JWT_ENABLED:-true}
# validate user's vars before usinig in json
@ -328,6 +332,11 @@ update_ds_settings(){
${JSON} -I -e "this.services.CoAuthoring.token.inbox.inBody = ${JWT_IN_BODY}"
${JSON} -I -e "this.services.CoAuthoring.token.outbox.inBody = ${JWT_IN_BODY}"
${JSON} -I -e "if(this.services.CoAuthoring.autoAssembly===undefined)this.services.CoAuthoring.autoAssembly={};"
${JSON} -I -e "this.services.CoAuthoring.autoAssembly.enable = ${FORCESAVE_ENABLE}"
${JSON} -I -e "this.services.CoAuthoring.autoAssembly.interval = '${FORCESAVE_INTERVAL}'"
${JSON} -I -e "this.services.CoAuthoring.autoAssembly.step = '${FORCESAVE_STEP}'"
if [ -f "${ONLYOFFICE_EXAMPLE_CONFIG}" ]; then
${JSON_EXAMPLE} -I -e "this.server.token.enable = ${JWT_ENABLED}"
${JSON_EXAMPLE} -I -e "this.server.token.secret = '${JWT_SECRET}'"