mirror of
https://github.com/thib8956/nginx-proxy
synced 2025-02-24 09:48:14 +00:00
Change dhparam positional args to be inherited vars, standardize naming
PR #913 added `DHPARAM_GENERATION` as a positional argument to generate-dhparam.sh. However, since it was the second positional argument, `DHPARAM_BITS` would also have to be defined or `DHPARAM_GENERATION` would be read into `DHPARAM_BITS`. This changes the arguments to be inherited variables which do not depend on order, just declaration. Also change instances of `GENERATE_DHPARAM` to `DHPARAM_GENERATION` since it's unnecessary to have another variable. I think `GENERATE_DHPARAM` is actually a better name (verb vs. noun), but `DHPARAM_GENERATION` is already defined and may break someone if changed. Addresses https://github.com/jwilder/nginx-proxy/pull/913#issuecomment-476014691
This commit is contained in:
parent
5c1a1c8a6d
commit
cbc6f09d2a
@ -1,8 +1,9 @@
|
|||||||
#!/bin/bash -e
|
#!/bin/bash -e
|
||||||
|
|
||||||
# The first argument is the bit depth of the dhparam, or 4096 if unspecified
|
# DHPARAM_BITS is the bit depth of the dhparam, or 4096 if unspecified
|
||||||
DHPARAM_BITS=${1:-4096}
|
DHPARAM_BITS=${DHPARAM_BITS:-4096}
|
||||||
GENERATE_DHPARAM=${2:-true}
|
# DHPARAM_GENERATION=false skips dhparam generation
|
||||||
|
DHPARAM_GENERATION=${DHPARAM_GENERATION:-true}
|
||||||
|
|
||||||
# If a dhparam file is not available, use the pre-generated one and generate a new one in the background.
|
# If a dhparam file is not available, use the pre-generated one and generate a new one in the background.
|
||||||
# Note that /etc/nginx/dhparam is a volume, so this dhparam will persist restarts.
|
# Note that /etc/nginx/dhparam is a volume, so this dhparam will persist restarts.
|
||||||
@ -26,7 +27,7 @@ if [[ -f $DHPARAM_FILE ]]; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $GENERATE_DHPARAM =~ ^[Ff][Aa][Ll][Ss][Ee]$ ]]; then
|
if [[ $DHPARAM_GENERATION =~ ^[Ff][Aa][Ll][Ss][Ee]$ ]]; then
|
||||||
echo "Skipping Diffie-Hellman parameters generation and Ignoring pre-generated dhparam.pem"
|
echo "Skipping Diffie-Hellman parameters generation and Ignoring pre-generated dhparam.pem"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
Loading…
x
Reference in New Issue
Block a user