From 6cf41fa955f6ecc1b559af9a46a55aea4b79a277 Mon Sep 17 00:00:00 2001 From: Alexey Golubev Date: Wed, 6 Sep 2017 17:21:52 +0300 Subject: [PATCH] Added jwt setup to example --- run-document-server.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/run-document-server.sh b/run-document-server.sh index da40e9a..5763d70 100755 --- a/run-document-server.sh +++ b/run-document-server.sh @@ -34,9 +34,11 @@ JWT_HEADER=${JWT_HEADER:-Authorization} ONLYOFFICE_DEFAULT_CONFIG=${CONF_DIR}/default.json ONLYOFFICE_LOG4JS_CONFIG=${CONF_DIR}/log4js/production.json +ONLYOFFICE_EXAMPLE_CONFIG=${CONF_DIR}-example/default.json JSON="json -q -f ${ONLYOFFICE_DEFAULT_CONFIG}" JSON_LOG="json -q -f ${ONLYOFFICE_LOG4JS_CONFIG}" +JSON_EXAMPLE="json -q -f ${ONLYOFFICE_EXAMPLE_CONFIG}" LOCAL_SERVICES=() @@ -152,6 +154,12 @@ 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}'" + + 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}'" + ${JSON_EXAMPLE} -I -e "this.server.token.authorizationHeader = '${JWT_HEADER}'" + fi fi }