Skip to content

Commit

Permalink
Permit to change the forcesave options with env variables
Browse files Browse the repository at this point in the history
  • Loading branch information
Paco committed Nov 10, 2022
1 parent c709025 commit 80602bf
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
9 changes: 9 additions & 0 deletions run-document-server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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}'"
Expand Down

0 comments on commit 80602bf

Please sign in to comment.