BTCPAY_HOST can be empty
This commit is contained in:
@@ -74,11 +74,11 @@ if [ "$1" != "-i" ]; then
|
|||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "$BTCPAY_HOST" ]; then
|
if [ -z "$BTCPAYGEN_CRYPTO1" ]; then
|
||||||
if [ -f "/etc/profile.d/btcpay-env.sh" ]; then
|
if [ -f "/etc/profile.d/btcpay-env.sh" ]; then
|
||||||
echo "This script must be run as root after running \"sudo su -\""
|
echo "This script must be run as root after running \"sudo su -\""
|
||||||
else
|
else
|
||||||
echo "BTCPAY_HOST should not be empty"
|
echo "BTCPAYGEN_CRYPTO1 should not be empty"
|
||||||
fi
|
fi
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
@@ -129,7 +129,7 @@ if [[ -f "$BTCPAY_HOST_SSHKEYFILE" ]]; then
|
|||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "$BTCPAYGEN_REVERSEPROXY" == "nginx" ]]; then
|
if [[ "$BTCPAYGEN_REVERSEPROXY" == "nginx" ]] && [[ "$BTCPAY_HOST" ]]; then
|
||||||
DOMAIN_NAME="$(echo "$BTCPAY_HOST" | grep -P '(?=^.{4,253}$)(^(?:[a-zA-Z0-9](?:(?:[a-zA-Z0-9\-]){0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$)')"
|
DOMAIN_NAME="$(echo "$BTCPAY_HOST" | grep -P '(?=^.{4,253}$)(^(?:[a-zA-Z0-9](?:(?:[a-zA-Z0-9\-]){0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$)')"
|
||||||
if [[ ! "$DOMAIN_NAME" ]]; then
|
if [[ ! "$DOMAIN_NAME" ]]; then
|
||||||
echo "BTCPAYGEN_REVERSEPROXY is set to nginx, so BTCPAY_HOST must be a domain name which point to this server (with port 80 and 443 open), but the current value of BTCPAY_HOST ('$BTCPAY_HOST') is not a valid domain name."
|
echo "BTCPAYGEN_REVERSEPROXY is set to nginx, so BTCPAY_HOST must be a domain name which point to this server (with port 80 and 443 open), but the current value of BTCPAY_HOST ('$BTCPAY_HOST') is not a valid domain name."
|
||||||
|
|||||||
Reference in New Issue
Block a user