Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Permit to change the forcesave options with env variables #545

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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