Enable JWT auth by default

Also generate JWT secret if it doesn't set.
This commit is contained in:
Alexey Golubev 2022-08-22 15:32:58 +03:00 committed by GitHub
parent 05c5042985
commit 71c9b5151f
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,7 @@ else
JWT_ENABLED="false" JWT_ENABLED="false"
fi fi
JWT_SECRET=${JWT_SECRET:-secret} 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}