diff --git a/Production/nginx.tmpl b/Production/nginx.tmpl index d8db563..dd5ab12 100644 --- a/Production/nginx.tmpl +++ b/Production/nginx.tmpl @@ -191,8 +191,8 @@ proxy_set_header X-Forwarded-Proto https; proxy_pass http://configurator; } - {{ end }} - {{ if (eq $serviceName "nnostr-relay") }} + {{ end }} + {{ if (eq $serviceName "nnostr-relay") }} location /nostr/ { proxy_set_header Connection ""; proxy_set_header Host $host; @@ -207,7 +207,41 @@ proxy_set_header Connection "Upgrade"; proxy_pass http://nnostr-relay; } - {{ end }} + {{ end }} + {{ if (eq $serviceName "mempool_web") }} + # https://github.com/mempool/mempool/tree/master/production/nginx + location /mempool/ { + proxy_pass http://mempool_web:8080/; + + # Bypass gzip, so that we can apply sub_filter, which does not work with proxy compressed response. + # Details: https://www.nginx.com/resources/wiki/modules/substitutions/#directives + proxy_set_header Accept-Encoding ""; + + sub_filter_types *; + sub_filter_once off; + + sub_filter 'base href="/' 'base href="/mempool/'; + sub_filter '/api/' '/mempool/api/'; + sub_filter '/resources' '/mempool/resources'; + + # mainnet API + location /mempool/api/v1/ws { + proxy_pass http://mempool_api:8999; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + location /mempool/api/v1/ { + proxy_pass http://mempool_api:8999/api/v1/; + } + location /mempool/api/ { + proxy_pass http://mempool_api:8999/api/v1/; + } + } + location ~ "^/[a-z]{2}/mempool" { + rewrite ^/(.*)/mempool $scheme://$server_name/mempool/$1/ redirect; + } + {{ end }} {{ end }} {{ end }} diff --git a/README.md b/README.md index f2ad369..8d332a7 100644 --- a/README.md +++ b/README.md @@ -172,14 +172,15 @@ Available `BTCPAYGEN_ADDITIONAL_FRAGMENTS` currently are: * [opt-txindex](docker-compose-generator/docker-fragments/opt-txindex.yml), to enable txindex=1 in bitcoin.conf if you require txindexing for Bisq, DOJO, etc. * [opt-expose-unsafe](docker-compose-generator/docker-fragments/opt-expose-unsafe.yml), to unsafely expose bitcoind P2P port 8333 if you require P2P for Bisq, DOJO, Esplora, etc. WARNING: ONLY USE ON TRUSTED LAN OR WITH FIREWALL RULES WHITELISTING SPECIFIC HOSTS * [opt-add-tor-relay](docker-compose-generator/docker-fragments/opt-add-tor-relay.yml), for a non-exit tor relay. Make sure to have ports 9001 and 9030 accessible externally. [Please read the legal implications of running a tor relay](https://community.torproject.org/relay/community-resources/eff-tor-legal-faq) and [what resources are used to operate the relay](https://trac.torproject.org/projects/tor/wiki/TorRelayGuide#RelayRequirements). -* [opt-add-electrumx](docker-compose-generator/docker-fragments/opt-add-electrumx.yml), to integrate a full ElectrumX server (from official source) with BTCPay, using the BTCPay server's full bitcoin node for complete privacy when using your own Electrum wallet. You can also open port 50002 up to the internet on your router etc, to be part of the ElectrumX network, helping other Electrum wallet users to get connected. The bitcoin option `-txindex` is mandatory for ElectrumX, and this fragment will enable it on your BTCPay server automatically - NO need to use the fragment opt-txindex.yml. -* [opt-add-electrum-ps](docker-compose-generator/docker-fragments/opt-add-electrum-ps.yml), to integrate Electrum Personal Server (EPS) with BTCPay (EPS is a single-user alternative to the ElectrumX Server option above). EPS will also use the BTCPay server's full bitcoin node for complete privacy when using your own Electrum wallet, for your own personal use (i.e. other users cannot use your server to verify transactions). Also, the bitcoin option `-txindex` is NOT mandatory for EPS, and it will run on a pruned node (unlike ElectrumX). You will need to add your XPUB/YPUB/ZPUB as environment variable `EPS_XPUB` before enabling EPS for the first time (see above section on environment variables, and see [full documentation](https://docs.btcpayserver.org/ElectrumPersonalServer/) for details). +* [opt-add-electrumx](docker-compose-generator/docker-fragments/opt-add-electrumx.yml), to integrate a full ElectrumX server (from official source) with BTCPay, using the BTCPay server's full bitcoin node for complete privacy when using your own Electrum wallet. You can also open port 50002 up to the internet on your router etc, to be part of the ElectrumX network, helping other Electrum wallet users to get connected. The bitcoin option `-txindex` is mandatory for ElectrumX, and this fragment will enable it on your BTCPay server automatically - No need to use the fragment opt-txindex.yml. +* [opt-add-electrum-ps](docker-compose-generator/docker-fragments/opt-add-electrum-ps.yml), to integrate Electrum Personal Server (EPS) with BTCPay (EPS is a single-user alternative to the ElectrumX Server option above). EPS will also use the BTCPay server's full bitcoin node for complete privacy when using your own Electrum wallet, for your own personal use (i.e. other users cannot use your server to verify transactions). Also, the bitcoin option `-txindex` is NOT mandatory for EPS, and it will run on a pruned node (unlike ElectrumX). You will need to add your XPUB/YPUB/ZPUB as environment variable `EPS_XPUB` before enabling EPS for the first time (see above section on environment variables, and see [full documentation](https://docs.btcpayserver.org/ElectrumPersonalServer/) for details). * [opt-add-electrum-bwt](docker-compose-generator/docker-fragments/opt-add-bwt.yml), to integrate the [Bitcoin Wallet Tracker](https://github.com/bwt-dev/bwt) Electrum server, which uses a personal wallet index model similar to that of EPS. You will need to set `BWT_XPUB` with your XPUB/YPUB/ZPUB (see environment variables section). The server will only be available locally and through an onion service. * [opt-add-configurator](docker-compose-generator/docker-fragments/opt-add-configurator.yml), to integrate the [BTCPay Server Configurator](https://install.btcpayserver.org) to manage your BTCPay deployment through a UI, and to allow new deployments elsewhere easily. * [opt-add-pihole](docker-compose-generator/docker-fragments/opt-add-pihole.yml) ([See the documentation](docs/pihole.md)) * [opt-add-bluewallet-lndhub](docker-compose-generator/docker-fragments/opt-add-bluewallet-lndhub.yml) for [Bluewallet LNDHub](https://github.com/BlueWallet/LndHub) - Use non-custodial LND Lightning directly from your Bluewallet, and freely let others open accounts on your node. Fragment maintained by [maltokyo](https://github.com/maltokyo). * [opt-add-ndlc](docker-compose-generator/docker-fragments/opt-add-ndlc.yml) ([See the documentation](docs/ndlc.md)) * [opt-add-lightning-terminal](docker-compose-generator/docker-fragments/opt-add-lightning-terminal.yml) for [Lightning Terminal/LiT](https://github.com/lightninglabs/lightning-terminal). Maintained by [dennisreimann](https://github.com/dennisreimann). +* [opt-add-mempool](docker-compose-generator/docker-fragments/opt-add-mempool.yml) for [Mempool](https://github.com/mempool/mempool). Maintained by [dennisreimann](https://github.com/dennisreimann). * [opt-add-sphinxrelay](docker-compose-generator/docker-fragments/opt-add-sphinxrelay.yml) for [Sphinx Relay](https://github.com/stakwork/sphinx-relay). Maintained by [dennisreimann](https://github.com/dennisreimann). * [opt-add-tallycoin-connect](docker-compose-generator/docker-fragments/opt-add-tallycoin-connect.yml) for [Tallycoin Connect](https://github.com/dennisreimann/tallycoin_connect). Maintained by [dennisreimann](https://github.com/dennisreimann). * [opt-add-thunderhub](docker-compose-generator/docker-fragments/opt-add-thunderhub.yml) for a LND Lightning Node Manager in your Browser. Maintained by [apotdevin](https://github.com/apotdevin). @@ -391,6 +392,7 @@ We are trying to update our dependencies to run on `arm32v7` and `x64` boards. H | jvandrew/librepatron | 0.7.39 | [✔️](https://raw.githubusercontent.com/JeffVandrewJr/patron/v0.7.39/Dockerfile) | ️❌ | ️❌ | [Github](https://github.com/JeffVandrewJr/patron) - [DockerHub](https://hub.docker.com/r/jvandrew/librepatron) | | jvandrew/isso | atron.22 | [✔️](https://raw.githubusercontent.com/JeffVandrewJr/isso/patron.22/Dockerfile) | ️❌ | ️❌ | [Github](https://github.com/JeffVandrewJr/isso) - [DockerHub](https://hub.docker.com/r/jvandrew/isso) | | lightninglabs/lightning-terminal | v0.6.7-alpha-path-prefix | [✔️](https://raw.githubusercontent.com/lightninglabs/lightning-terminal/v0.6.7-alpha/Dockerfile) | ️❌ | [✔️](https://raw.githubusercontent.com/lightninglabs/lightning-terminal/v0.6.7-alpha/Dockerfile) | [Github](https://github.com/lightninglabs/lightning-terminal) - [DockerHub](https://hub.docker.com/r/lightninglabs/lightning-terminal) | +| mempool/mempool | v2.5.0-dev1 | [✔️](https://raw.githubusercontent.com/mempool/mempool/v2.5.0-dev1/docker/frontend/Dockerfile) | [✔️](https://raw.githubusercontent.com/mempool/mempool/v2.5.0-dev1/docker/frontend/Dockerfile) | [✔️](https://raw.githubusercontent.com/mempool/mempool/v2.5.0-dev1/docker/frontend/Dockerfile) | [Github](https://github.com/mempool/mempool) - [DockerHub](https://hub.docker.com/r/mempool/frontend) | | kukks/nnostr-relay | v0.0.7 | [✔️](https://raw.githubusercontent.com/kukks/nnostr/Relay/v0.0.7/Relay/Dockerfile) | [✔️](https://raw.githubusercontent.com/kukks/nnostr/Relay/v0.0.7/Relay/Dockerfile) | [✔️](https://raw.githubusercontent.com/kukks/nnostr/Relay/v0.0.7/Relay/Dockerfile) | [Github](https://github.com/kukks/nnostr) - [DockerHub](https://hub.docker.com/r/kukks/nnostr-relay) | | sphinxlightning/sphinx-relay | v2.2.9 | [✔️](https://raw.githubusercontent.com/stakwork/sphinx-relay/v2.2.9/Dockerfile) | [✔️](https://raw.githubusercontent.com/stakwork/sphinx-relay/v2.2.9/Dockerfile) | [✔️](https://raw.githubusercontent.com/stakwork/sphinx-relay/v2.2.9/Dockerfile) | [Github](https://github.com/stakwork/sphinx-relay) - [DockerHub](https://hub.docker.com/r/sphinxlightning/sphinx-relay) | | dennisreimann/tallycoin_connect | v1.7.3 | [✔️](https://raw.githubusercontent.com/dennisreimann/tallycoin_connect/v1.7.3/Dockerfile) | [✔️](https://raw.githubusercontent.com/dennisreimann/tallycoin_connect/v1.7.3/Dockerfile.arm32v7) | [✔️](https://raw.githubusercontent.com/dennisreimann/tallycoin_connect/v1.7.3/Dockerfile.arm64v8) | [Github](https://github.com/dennisreimann/tallycoin_connect) - [DockerHub](https://hub.docker.com/r/dennisreimann/tallycoin_connect) | diff --git a/contrib/DockerFileBuildHelper/Program.cs b/contrib/DockerFileBuildHelper/Program.cs index ec9215b..f2fc2f0 100644 --- a/contrib/DockerFileBuildHelper/Program.cs +++ b/contrib/DockerFileBuildHelper/Program.cs @@ -305,6 +305,14 @@ namespace DockerFileBuildHelper dockerInfo.GitRef = $"{image.Tag}"; dockerInfo.SupportedByUs = false; break; + case "mempool": + dockerInfo.DockerFilePath = "docker/frontend/Dockerfile"; + dockerInfo.DockerFilePathARM32v7 = "docker/frontend/Dockerfile"; + dockerInfo.DockerFilePathARM64v8 = "docker/frontend/Dockerfile"; + dockerInfo.GitLink = "https://github.com/mempool/mempool"; + dockerInfo.GitRef = $"{image.Tag}"; + dockerInfo.SupportedByUs = false; + break; case "docker-bitcoingold": dockerInfo.DockerFilePath = $"bitcoingold/{image.Tag}/Dockerfile"; dockerInfo.GitLink = "https://github.com/Vutov/docker-bitcoin"; diff --git a/contrib/build-all-images.sh b/contrib/build-all-images.sh index 1528882..b84b383 100644 --- a/contrib/build-all-images.sh +++ b/contrib/build-all-images.sh @@ -741,7 +741,7 @@ DOCKERFILE="Dockerfile" echo "Building fireflyiii/core:latest" git clone https://dev.azure.com/Firefly-III/_git/MainImage core cd core -git checkout +git checkout cd "$(dirname $DOCKERFILE)" docker build -f "$DOCKERFILE" -t "fireflyiii/core:latest" . cd - && cd .. @@ -817,6 +817,18 @@ docker build -f "$DOCKERFILE" -t "lightninglabs/lightning-terminal:v0.6.7-alpha- cd - && cd .. +# Build mempool +# https://raw.githubusercontent.com/mempool/mempool/v2.5.0-dev1/docker/frontend/Dockerfile +DOCKERFILE="docker/frontend/Dockerfile" +echo "Building mempool/mempool:v2.5.0-dev1" +git clone https://github.com/mempool/mempool mempool +cd mempool +git checkout v2.5.0-dev1 +cd "$(dirname $DOCKERFILE)" +docker build -f "$DOCKERFILE" -t "mempool/mempool:v2.5.0-dev1" . +cd - && cd .. + + # Build ndlc-cli # https://raw.githubusercontent.com/dgarage/ndlc/releases/1.0.1/amd64.Dockerfile DOCKERFILE="amd64.Dockerfile" @@ -1165,5 +1177,3 @@ git checkout master cd "$(dirname $DOCKERFILE)" docker build -f "$DOCKERFILE" -t "romanornr/docker-viacoin:0.15.2" . cd - && cd .. - - diff --git a/docker-compose-generator/docker-fragments/opt-add-electrumx.yml b/docker-compose-generator/docker-fragments/opt-add-electrumx.yml index 3bddd6c..428935c 100644 --- a/docker-compose-generator/docker-fragments/opt-add-electrumx.yml +++ b/docker-compose-generator/docker-fragments/opt-add-electrumx.yml @@ -4,11 +4,12 @@ services: bitcoind: environment: BITCOIN_EXTRA_ARGS: | - txindex=1 rpcauth=electrumx:7d8ee47c089e6072635f82b34796e878$$13649d99453ccdf78e85007286422599c00e6953289f41bf8e92961076ba14db electrumx: image: lukechilds/electrumx restart: unless-stopped + expose: + - "50001" ports: - "50002:50002" volumes: @@ -20,3 +21,5 @@ volumes: electrumx_datadir: incompatible: - pruning +required: + - "opt-txindex" diff --git a/docker-compose-generator/docker-fragments/opt-add-mempool.yml b/docker-compose-generator/docker-fragments/opt-add-mempool.yml new file mode 100644 index 0000000..eeacf6b --- /dev/null +++ b/docker-compose-generator/docker-fragments/opt-add-mempool.yml @@ -0,0 +1,72 @@ +version: '3' + +# reference: https://github.com/mempool/mempool/blob/master/docker/docker-compose.yml +services: + bitcoind: + environment: + BITCOIN_EXTRA_ARGS: | + # We need to use rpcauth because we also need cookieauth. rpcpassword disabled cookie file auth. + # Be careful if you copy the line below from the docker-compose.yml! A dollar sign is escaped. + rpcauth=mempool:d77ee0acf132038f6aaa9d4500d745ec$$72cc78dcf18191c91d10c15ff8f7c3dbbd170c4d3107cca35d71c6bf96af2ed9 + mempool_web: + image: mempool/frontend:v2.5.0-dev1 + restart: on-failure + stop_grace_period: 1m + command: "./wait-for mempool_db:3306 --timeout=720 -- nginx -g 'daemon off;'" + expose: + - "8080" + environment: + FRONTEND_HTTP_PORT: "8080" + BACKEND_MAINNET_HTTP_HOST: "mempool_api" + + mempool_api: + image: mempool/backend:v2.5.0-dev1 + restart: on-failure + stop_grace_period: 1m + command: "./wait-for-it.sh mempool_db:3306 --timeout=720 --strict -- ./start.sh" + volumes: + - mempool_api_datadir:/backend/cache + expose: + - "8999" + environment: + MEMPOOL_BACKEND: "electrum" + MEMPOOL_CACHE_DIR: "/backend/cache" + ELECTRUM_HOST: "electrumx" + ELECTRUM_PORT: "50001" + ELECTRUM_TLS_ENABLED: "false" + CORE_RPC_HOST: "bitcoind" + CORE_RPC_PORT: "43782" + CORE_RPC_USERNAME: "mempool" + CORE_RPC_PASSWORD: "mempool" + DATABASE_ENABLED: "true" + DATABASE_HOST: "mempool_db" + DATABASE_DATABASE: "mempool" + DATABASE_USERNAME: "mempool" + DATABASE_PASSWORD: "mempool" + + mempool_db: + image: mariadb:10.5.8 + restart: on-failure + expose: + - "3306" + volumes: + - "mempool_db_datadir:/var/lib/mysql" + environment: + MYSQL_DATABASE: "mempool" + MYSQL_USER: "mempool" + MYSQL_PASSWORD: "mempool" + MYSQL_ROOT_PASSWORD: "admin" + + btcpayserver: + environment: + BTCPAY_EXTERNALSERVICES: "Mempool Explorer:/mempool" + +volumes: + mempool_db_datadir: + mempool_api_datadir: + +required: + - "opt-add-electrumx" + +incompatible: + - pruning