diff --git a/Production/nginx.tmpl b/Production/nginx.tmpl index 84ffaf5..147820b 100644 --- a/Production/nginx.tmpl +++ b/Production/nginx.tmpl @@ -301,13 +301,26 @@ server { {{ range $container := $ }} {{ $serviceName := (index $container.Labels "com.docker.compose.service") }} {{ if (eq $serviceName "lnd_bitcoin") }} - location /lnrpc.Lightning { - grpc_pass grpcs://lnd_bitcoin:10009; - } - location /lnd-rest/btc/ { - rewrite ^/lnd-rest/btc/(.*) /$1 break; - proxy_pass http://lnd_bitcoin:8080/; - } + location /lnrpc.Lightning { + grpc_pass grpcs://lnd_bitcoin:10009; + } + location /lnd-rest/btc/ { + rewrite ^/lnd-rest/btc/(.*) /$1 break; + proxy_pass http://lnd_bitcoin:8080/; + } + {{ end }} + {{ end }} + + {{ range $container := $ }} + {{ $serviceName := (index $container.Labels "com.docker.compose.service") }} + {{ if (eq $serviceName "btcqbo") }} + location /btcqbo/ { + proxy_pass http://btcqbo:8001; + proxy_redirect off; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + } {{ end }} {{ end }} } diff --git a/README.md b/README.md index ee06db5..efcbf0d 100644 --- a/README.md +++ b/README.md @@ -228,13 +228,7 @@ export BTCPAY_BASE_DIRECTORY="/var/lib/waagent/custom-script/download/0" export BTCPAY_ENV_FILE="/var/lib/waagent/custom-script/download/0/.env" export BTCPAY_HOST_SSHKEYFILE="/root/.ssh/id_rsa_btcpay" if cat $BTCPAY_ENV_FILE &> /dev/null; then -export BTCPAY_HOST="$(cat $BTCPAY_ENV_FILE | sed -n 's/^BTCPAY_HOST=\(.*\)$/\1/p')" -export LETSENCRYPT_EMAIL="$(cat $BTCPAY_ENV_FILE | sed -n 's/^LETSENCRYPT_EMAIL=\(.*\)$/\1/p')" -export NBITCOIN_NETWORK="$(cat $BTCPAY_ENV_FILE | sed -n 's/^NBITCOIN_NETWORK=\(.*\)$/\1/p')" -export LIGHTNING_ALIAS="$(cat $BTCPAY_ENV_FILE | sed -n 's/^LIGHTNING_ALIAS=\(.*\)$/\1/p')" -export ACME_CA_URI="$(cat $BTCPAY_ENV_FILE | sed -n 's/^ACME_CA_URI=\(.*\)$/\1/p')" -export BTCPAY_SSHKEYFILE="$(cat $BTCPAY_ENV_FILE | sed -n 's/^BTCPAY_SSHKEYFILE=\(.*\)$/\1/p')" -export BTCPAY_SSHTRUSTEDFINGERPRINTS="$(cat $BTCPAY_ENV_FILE | sed -n 's/^BTCPAY_SSHTRUSTEDFINGERPRINTS=\(.*\)$/\1/p')" + export $(grep -v '^#' "$BTCPAY_ENV_FILE" | xargs) fi ``` diff --git a/btcpay-setup.sh b/btcpay-setup.sh index ea11ed0..77eacfe 100755 --- a/btcpay-setup.sh +++ b/btcpay-setup.sh @@ -71,6 +71,15 @@ if [ "$1" != "-i" ]; then return fi +if [ -z "$BTCPAY_HOST" ]; then + if [ -f "/etc/profile.d/btcpay-env.sh" ]; then + echo "This script must be run as root after running \"sudo su -\"" + else + echo "BTCPAY_HOST should not be empty" + fi + return +fi + ######### Migration: old pregen environment to new environment ############ if [ ! -z $BTCPAY_DOCKER_COMPOSE ] && [ ! -z $DOWNLOAD_ROOT ] && [ -z $BTCPAYGEN_OLD_PREGEN ]; then echo "Your deployment is too old, you need to migrate by following instructions on this link https://github.com/btcpayserver/btcpayserver-docker/tree/master#i-deployed-before-btcpay-setupsh-existed-before-may-17-can-i-migrate-to-this-new-system" @@ -160,11 +169,6 @@ BTCPAY_SSHTRUSTEDFINGERPRINTS:$BTCPAY_SSHTRUSTEDFINGERPRINTS ---------------------- " -if [ -z "$BTCPAY_HOST" ]; then - echo "BTCPAY_HOST should not be empty" - return -fi - if [ -z "$BTCPAYGEN_CRYPTO1" ]; then echo "BTCPAYGEN_CRYPTO1 should not be empty" return diff --git a/contrib/DockerFileBuildHelper/Program.cs b/contrib/DockerFileBuildHelper/Program.cs index cf5759f..01f6a41 100644 --- a/contrib/DockerFileBuildHelper/Program.cs +++ b/contrib/DockerFileBuildHelper/Program.cs @@ -264,6 +264,16 @@ namespace DockerFileBuildHelper dockerInfo.GitLink = "https://github.com/btcpayserver/docker-letsencrypt-nginx-proxy-companion"; dockerInfo.GitRef = $"v{image.Tag}"; break; + case "btcqbo": + dockerInfo.DockerFilePath = $"Dockerfile"; + dockerInfo.GitLink = "https://github.com/JeffVandrewJr/btcqbo"; + dockerInfo.GitRef = $"v{image.Tag}"; + break; + case "redis": + dockerInfo.DockerFilePath = $"5.0/Dockerfile"; + dockerInfo.GitLink = "https://github.com/docker-library/redis"; + dockerInfo.GitRef = $"f1a8498333ae3ab340b5b39fbac1d7e1dc0d628c"; + break; case "postgres": dockerInfo.DockerFilePath = $"9.6/Dockerfile"; dockerInfo.DockerFilePathARM32v7 = $"9.6/Dockerfile"; diff --git a/contrib/build-all-images.sh b/contrib/build-all-images.sh index 344f77d..ffc69d5 100755 --- a/contrib/build-all-images.sh +++ b/contrib/build-all-images.sh @@ -113,16 +113,16 @@ cd - && cd .. # Build btcpayserver -# https://raw.githubusercontent.com/btcpayserver/btcpayserver/v1.0.3.23/Dockerfile.linuxamd64 +# https://raw.githubusercontent.com/btcpayserver/btcpayserver/v1.0.3.24/Dockerfile.linuxamd64 DOCKERFILE="Dockerfile.linuxamd64" -# https://raw.githubusercontent.com/btcpayserver/btcpayserver/v1.0.3.23/Dockerfile.linuxarm32v7 +# https://raw.githubusercontent.com/btcpayserver/btcpayserver/v1.0.3.24/Dockerfile.linuxarm32v7 [[ "$(uname -m)" == "armv7l" ]] && DOCKERFILE="Dockerfile.linuxarm32v7" -echo "Building btcpayserver/btcpayserver:1.0.3.23" +echo "Building btcpayserver/btcpayserver:1.0.3.24" git clone https://github.com/btcpayserver/btcpayserver btcpayserver cd btcpayserver -git checkout v1.0.3.23 +git checkout v1.0.3.24 cd "$(dirname $DOCKERFILE)" -docker build -f "$DOCKERFILE" -t "btcpayserver/btcpayserver:1.0.3.23" . +docker build -f "$DOCKERFILE" -t "btcpayserver/btcpayserver:1.0.3.24" . cd - && cd .. @@ -282,6 +282,42 @@ docker build -f "$DOCKERFILE" -t "btcpayserver/letsencrypt-nginx-proxy-companion cd - && cd .. +# Build btcqbo +# https://raw.githubusercontent.com/JeffVandrewJr/btcqbo/v0.1.1/Dockerfile +DOCKERFILE="Dockerfile" +echo "Building jvandrew/btcqbo:0.1.1" +git clone https://github.com/JeffVandrewJr/btcqbo btcqbo +cd btcqbo +git checkout v0.1.1 +cd "$(dirname $DOCKERFILE)" +docker build -f "$DOCKERFILE" -t "jvandrew/btcqbo:0.1.1" . +cd - && cd .. + + +# Build btcqbo +# https://raw.githubusercontent.com/JeffVandrewJr/btcqbo/v0.1.1/Dockerfile +DOCKERFILE="Dockerfile" +echo "Building jvandrew/btcqbo:0.1.1" +git clone https://github.com/JeffVandrewJr/btcqbo btcqbo +cd btcqbo +git checkout v0.1.1 +cd "$(dirname $DOCKERFILE)" +docker build -f "$DOCKERFILE" -t "jvandrew/btcqbo:0.1.1" . +cd - && cd .. + + +# Build redis +# https://raw.githubusercontent.com/docker-library/redis/f1a8498333ae3ab340b5b39fbac1d7e1dc0d628c/5.0/Dockerfile +DOCKERFILE="5.0/Dockerfile" +echo "Building redis:5.0.2-alpine" +git clone https://github.com/docker-library/redis redis +cd redis +git checkout f1a8498333ae3ab340b5b39fbac1d7e1dc0d628c +cd "$(dirname $DOCKERFILE)" +docker build -f "$DOCKERFILE" -t "redis:5.0.2-alpine" . +cd - && cd .. + + # Build postgres # https://raw.githubusercontent.com/docker-library/postgres/b7cb3c6eacea93be2259381033be3cc435649369/9.6/Dockerfile DOCKERFILE="9.6/Dockerfile" diff --git a/docker-compose-generator/docker-fragments/btcpayserver.yml b/docker-compose-generator/docker-fragments/btcpayserver.yml index 8e34946..4ae1fa0 100644 --- a/docker-compose-generator/docker-fragments/btcpayserver.yml +++ b/docker-compose-generator/docker-fragments/btcpayserver.yml @@ -4,7 +4,7 @@ services: btcpayserver: restart: unless-stopped - image: ${BTCPAY_IMAGE:-btcpayserver/btcpayserver:1.0.3.23} + image: ${BTCPAY_IMAGE:-btcpayserver/btcpayserver:1.0.3.25} expose: - "49392" environment: diff --git a/docker-compose-generator/docker-fragments/opt-add-btcqbo.yml b/docker-compose-generator/docker-fragments/opt-add-btcqbo.yml new file mode 100644 index 0000000..a862a79 --- /dev/null +++ b/docker-compose-generator/docker-fragments/opt-add-btcqbo.yml @@ -0,0 +1,32 @@ +version: "3" + +services: + btcqbo: + image: jvandrew/btcqbo:0.1.1 + environment: + REDIS_URL: "redis://redis:6379/0" + BTCPAY_HOST: ${BTCPAY_PROTOCOL:-https}://${BTCPAY_HOST} + CALLBACK_URL: ${BTCPAY_PROTOCOL:-https}://${BTCPAY_HOST}/btcqbo/qbologged + expose: + - "8001" + links: + - redis + rq-worker: + image: jvandrew/btcqbo:0.1.1 + entrypoint: /usr/local/bin/rq + command: worker -u redis://redis:6379/0 btcqbo + environment: + REDIS_URL: "redis://redis:6379/0" + expose: + - "8001" + links: + - redis + redis: + image: redis:5.0.2-alpine + expose: + - "6379" + volumes: + - "redis_datadir:/data" + +volumes: + redis_datadir: \ No newline at end of file