From b3055c362cfda49863b890f9acfefeaf568eceb7 Mon Sep 17 00:00:00 2001 From: Semyon Bezrukov Date: Wed, 27 Nov 2019 11:35:08 +0300 Subject: [PATCH] Add support JWT_IN_BODY param (#194) --- README.md | 1 + docker-compose.yml | 1 + run-document-server.sh | 4 ++++ 3 files changed, 6 insertions(+) diff --git a/README.md b/README.md index eec79bc..bea73b9 100644 --- a/README.md +++ b/README.md @@ -177,6 +177,7 @@ Below is the complete list of parameters that can be set using environment varia - **JWT_ENABLED**: Specifies the enabling the JSON Web Token validation by the ONLYOFFICE Document Server. Defaults to `false`. - **JWT_SECRET**: Defines the secret key to validate the JSON Web Token in the request to the ONLYOFFICE Document Server. Defaults to `secret`. - **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`. ## Installing ONLYOFFICE Document Server integrated with Community and Mail Servers diff --git a/docker-compose.yml b/docker-compose.yml index 3df7230..6e73ff5 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -17,6 +17,7 @@ services: #- JWT_ENABLED=true #- JWT_SECRET=secret #- JWT_HEADER=Authorization + #- JWT_IN_BODY=true stdin_open: true restart: always networks: diff --git a/run-document-server.sh b/run-document-server.sh index 3e3bb2b..436a017 100755 --- a/run-document-server.sh +++ b/run-document-server.sh @@ -38,6 +38,7 @@ NGINX_WORKER_CONNECTIONS=${NGINX_WORKER_CONNECTIONS:-$(ulimit -n)} JWT_ENABLED=${JWT_ENABLED:-false} JWT_SECRET=${JWT_SECRET:-secret} JWT_HEADER=${JWT_HEADER:-Authorization} +JWT_IN_BODY=${JWT_IN_BODY:-false} ONLYOFFICE_DEFAULT_CONFIG=${CONF_DIR}/local.json ONLYOFFICE_LOG4JS_CONFIG=${CONF_DIR}/log4js/production.json @@ -235,6 +236,9 @@ update_jwt_settings(){ ${JSON} -I -e "this.services.CoAuthoring.token.inbox.header = '${JWT_HEADER}'" ${JSON} -I -e "this.services.CoAuthoring.token.outbox.header = '${JWT_HEADER}'" + ${JSON} -I -e "this.services.CoAuthoring.token.inbox.inBody = '${JWT_IN_BODY}'" + ${JSON} -I -e "this.services.CoAuthoring.token.outbox.inBody = '${JWT_IN_BODY}'" + if [ -f "${ONLYOFFICE_EXAMPLE_CONFIG}" ] && [ "${JWT_ENABLED}" == "true" ]; then ${JSON_EXAMPLE} -I -e "this.server.token.enable = ${JWT_ENABLED}" ${JSON_EXAMPLE} -I -e "this.server.token.secret = '${JWT_SECRET}'"