From 01606746c146b298a39f7f57ced85c23bea834a7 Mon Sep 17 00:00:00 2001 From: Evgeniy Antonyuk Date: Tue, 7 Jun 2022 16:16:05 +0300 Subject: [PATCH] Fix Bug 53170 / Add the ability to set secure_link_secret (#444) * Add securelink generation * Add ability to configure securelink_secret * Add a description of SECURE_LINK_SECRET * Update README.md --- README.md | 1 + run-document-server.sh | 2 ++ 2 files changed, 3 insertions(+) diff --git a/README.md b/README.md index 18fb96e..a7bc84d 100644 --- a/README.md +++ b/README.md @@ -187,6 +187,7 @@ Below is the complete list of parameters that can be set using environment varia - **REDIS_SERVER_PORT**: The Redis server port number. - **NGINX_WORKER_PROCESSES**: Defines the number of nginx worker processes. - **NGINX_WORKER_CONNECTIONS**: Sets the maximum number of simultaneous connections that can be opened by a nginx worker process. +- **SECURE_LINK_SECRET**: Defines secret for the nginx config directive [secure_link_md5](http://nginx.org/ru/docs/http/ngx_http_secure_link_module.html#secure_link_md5). Defaults to `random string`. - **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`. diff --git a/run-document-server.sh b/run-document-server.sh index c8dcf39..8011b54 100755 --- a/run-document-server.sh +++ b/run-document-server.sh @@ -468,6 +468,8 @@ update_nginx_settings(){ if [ -f "${NGINX_ONLYOFFICE_EXAMPLE_CONF}" ]; then sed 's/linux/docker/' -i ${NGINX_ONLYOFFICE_EXAMPLE_CONF} fi + + documentserver-update-securelink.sh -s ${SECURE_LINK_SECRET:-$(pwgen -s 20)} } update_supervisor_settings(){