Enable JWT by default and add a JWT status message (#482)

* Enable JWT by default and add a JWT status message

* Correct JWT message

* Add a condition for displaying a JWT message

* Minor correction

* Minor correction
This commit is contained in:
Evgeniy Antonyuk 2022-08-22 20:27:10 +03:00 committed by GitHub
parent 05c5042985
commit 8887cb7a26
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -73,7 +73,7 @@ NGINX_CONFIG_PATH="/etc/nginx/nginx.conf"
NGINX_WORKER_PROCESSES=${NGINX_WORKER_PROCESSES:-1} NGINX_WORKER_PROCESSES=${NGINX_WORKER_PROCESSES:-1}
NGINX_WORKER_CONNECTIONS=${NGINX_WORKER_CONNECTIONS:-$(ulimit -n)} NGINX_WORKER_CONNECTIONS=${NGINX_WORKER_CONNECTIONS:-$(ulimit -n)}
JWT_ENABLED=${JWT_ENABLED:-false} JWT_ENABLED=${JWT_ENABLED:-true}
# validate user's vars before usinig in json # validate user's vars before usinig in json
if [ "${JWT_ENABLED}" == "true" ]; then if [ "${JWT_ENABLED}" == "true" ]; then
@ -82,7 +82,9 @@ else
JWT_ENABLED="false" JWT_ENABLED="false"
fi fi
JWT_SECRET=${JWT_SECRET:-secret} [ -z $JWT_SECRET ] && JWT_MESSAGE="JWT is enabled by default. A random secret is generated automatically. Run the command 'docker exec $(sudo docker ps -q) sudo documentserver-jwt-status.sh' to get information about JWT."
JWT_SECRET=${JWT_SECRET:-$(pwgen -s 20)}
JWT_HEADER=${JWT_HEADER:-Authorization} JWT_HEADER=${JWT_HEADER:-Authorization}
JWT_IN_BODY=${JWT_IN_BODY:-false} JWT_IN_BODY=${JWT_IN_BODY:-false}
@ -641,3 +643,5 @@ documentserver-static-gzip.sh ${ONLYOFFICE_DATA_CONTAINER}
tail -f /var/log/${COMPANY_NAME}/**/*.log & tail -f /var/log/${COMPANY_NAME}/**/*.log &
wait $! wait $!
echo "${JWT_MESSAGE}"