From f2a1dc57d7ecdb70bbf12abeb15273dba7a3e2ad Mon Sep 17 00:00:00 2001 From: "nicolas.dorier" Date: Tue, 21 Nov 2023 11:09:37 +0900 Subject: [PATCH] Add BTCPAY_LIGHTNING_HOST (Fix #845) --- Production/README.md | 1 + btcpay-setup.sh | 2 ++ helpers.sh | 4 ++++ 3 files changed, 7 insertions(+) diff --git a/Production/README.md b/Production/README.md index 4b5ac40..01e269a 100644 --- a/Production/README.md +++ b/Production/README.md @@ -18,6 +18,7 @@ The relevant environment variables are: * `NBITCOIN_NETWORK`: The blockchain identifier used by NBitcoin (eg., `regtest`, `testnet`, `mainnet`) * `BTCPAY_HOST`: The external url used to access the NGINX server from internet. This domain name must point to this machine for Let's Encrypt to create your certificate. (typically with a CNAME or A record) +* `BTCPAY_LIGHTNING_HOST`: The hostname announced for your node on the lightning network (by default, the `BTCPAY_HOST` will be used) * `BTCPAY_ROOTPATH`: The root path directory where BTCPay is accessed, more information below. (default: /) * `LETSENCRYPT_EMAIL`: The email Let's Encrypt will use to notify you about certificate expiration. * `ACME_CA_URI`: Let's encrypt API endpoint (`staging` for a staging certificate, `production` for a production one) diff --git a/btcpay-setup.sh b/btcpay-setup.sh index c3b008f..047c71d 100755 --- a/btcpay-setup.sh +++ b/btcpay-setup.sh @@ -81,6 +81,7 @@ Or, if you want to offload SSL because you have an existing web proxy, change RE Environment variables: BTCPAY_HOST: The hostname of your website (eg. btcpay.example.com) + BTCPAY_LIGHTNING_HOST: The hostname announced for your node on the lightning network (by default, the BTCPAY_HOST will be used) REVERSEPROXY_HTTP_PORT: The port the reverse proxy binds to for public HTTP requests. Default: 80 REVERSEPROXY_HTTPS_PORT: The port the reverse proxy binds to for public HTTPS requests. Default: 443 REVERSEPROXY_DEFAULT_HOST: Optional, if using a reverse proxy nginx, specify which website should be presented if the server is accessed by its IP. @@ -282,6 +283,7 @@ echo " Parameters passed: BTCPAY_PROTOCOL:$BTCPAY_PROTOCOL BTCPAY_HOST:$BTCPAY_HOST +BTCPAY_LIGHTNING_HOST: $BTCPAY_LIGHTNING_HOST BTCPAY_ADDITIONAL_HOSTS:$BTCPAY_ADDITIONAL_HOSTS REVERSEPROXY_HTTP_PORT:$REVERSEPROXY_HTTP_PORT REVERSEPROXY_HTTPS_PORT:$REVERSEPROXY_HTTPS_PORT diff --git a/helpers.sh b/helpers.sh index f73eaea..4eee80e 100755 --- a/helpers.sh +++ b/helpers.sh @@ -66,6 +66,9 @@ btcpay_expand_variables() { if [[ "$BTCPAY_HOST" != *.local ]] && [[ "$BTCPAY_HOST" != *.lan ]]; then BTCPAY_ANNOUNCEABLE_HOST="$BTCPAY_HOST" fi + if [[ "$BTCPAY_LIGHTNING_HOST" ]]; then + BTCPAY_ANNOUNCEABLE_HOST="$BTCPAY_LIGHTNING_HOST" + fi } # Set .env file @@ -94,6 +97,7 @@ fi echo " BTCPAY_PROTOCOL=$BTCPAY_PROTOCOL BTCPAY_HOST=$BTCPAY_HOST +BTCPAY_LIGHTNING_HOST=$BTCPAY_LIGHTNING_HOST BTCPAY_ADDITIONAL_HOSTS=$BTCPAY_ADDITIONAL_HOSTS BTCPAY_ANNOUNCEABLE_HOST=$BTCPAY_ANNOUNCEABLE_HOST REVERSEPROXY_HTTP_PORT=$REVERSEPROXY_HTTP_PORT