Compare commits

...

2 Commits

Author SHA1 Message Date
nicolas.dorier
a4d6bf117f
Fix deadlink 2022-07-03 22:10:39 +09:00
nicolas.dorier
1e25405108
Cloudflare-tunnel: Pass the original client's IP address to BTCPayServer 2022-07-01 22:04:05 +09:00
4 changed files with 14 additions and 4 deletions

View File

@ -21,6 +21,7 @@
{{ end }}
{{ define "redirects" }}
{{ if eq $.HostName "btcpay" }}
{{ range $container := $.Containers }}
@ -35,6 +36,12 @@
rewrite ^/lnd-rest/btc/(.*) /$1 break;
proxy_pass http://lnd_bitcoin:8080/;
}
{{ end }}
{{ if $container.Env.REAL_IP_HEADER }}
{{ range $containerNetwork := $container.Networks }}
set_real_ip_from {{ $containerNetwork.IP }};
{{ end }}
real_ip_header {{ $container.Env.REAL_IP_HEADER }};
{{ end }}
{{ if (eq $serviceName "bitcoin_rtl") }}
location /rtl/ {

View File

@ -127,7 +127,7 @@ Additionally, there are specific environment variables for some addons:
* If Bitcoin Wallet Tracker is activated with [opt-add-bwt](docker-compose-generator/docker-fragments/opt-add-bwt.yml), you can use `BWT_XPUB`/`BWT_XPUB_*` (to set your XPUB/YPUB/ZPUB), `BWT_DESCRIPTOR`/`BWT_DESCRIPTOR_*` (for script descriptors), `BWT_RESCAN_SINCE` (set to the wallet creation date in YYYY-MM-DD to speed up the rescan), `BWT_BITCOIND_WALLET` and `BWT_GAP_LIMIT`.
* `LND_WTCLIENT_SWEEP_FEE`: If LND watchtower is activated with [opt-lnd-wtclient](docker-compose-generator/docker-fragments/opt-lnd-wtclient.yml), you can use `LND_WTCLIENT_SWEEP_FEE` to change the sweep fee used in constructing the justice transaction (default is 10 sat/byte)
* `FIREFLY_HOST`: If fireflyiii is activated with [opt-add-fireflyiii](docker-compose-generator/docker-fragments/opt-add-fireflyiii.yml), the hostname of your fireflyiii website (eg. `firefly.example.com`)
* `CLOUDFLARE_TUNNEL_TOKEN`: Used to expose your instance to clearnet with a Cloudflare Argo Tunnel (if cloudflare tunnel is activated with [opt-add-cloudflare](docker-compose-generator/docker-fragments/opt-add-cloudflare.yml), for setup instructions [see documentation](docs/cloudflare-tunnel.md))
* `CLOUDFLARE_TUNNEL_TOKEN`: Used to expose your instance to clearnet with a Cloudflare Argo Tunnel (if cloudflare tunnel is activated with [opt-add-cloudflare](docker-compose-generator/docker-fragments/opt-add-cloudflared.yml), for setup instructions [see documentation](docs/cloudflare-tunnel.md))
# Tooling

View File

@ -4,6 +4,9 @@ services:
cloudflared:
container_name: 'cloudflared-tunnel'
image: btcpayserver/cloudflared:2022.6.3
network_mode: host
command: 'tunnel --no-autoupdate run --token ${CLOUDFLARE_TUNNEL_TOKEN}'
restart: 'on-failure'
restart: 'on-failure'
environment:
REAL_IP_HEADER: Cf-Connecting-Ip
links:
- nginx

View File

@ -33,7 +33,7 @@ First we are going to create the tunnel on Cloudflare.
5. In `Choose your environment`, click on docker and copy your token, you will need it later (the string after `--token`, as shown in the following screenshot)
![](./img/Cloudflare-Tunnel-Token.png)
6. Click on the `Next` button
7. Enter your subdomain, select your domain in the list. Then in `Service` select `HTTP` and enter `localhost`.
7. Enter your subdomain, select your domain in the list. Then in `Service` select `HTTP` and enter `nginx`.
8. In your the SSH session of your server, add cloudflare tunnel by running the following script. (replace `<YOUR_TOKEN_HERE>` by what you copied in step `5.`, and also replace `<YOUR_DOMAIN_HERE>` with the domain you entered in steps `7.`)
```bash
BTCPAY_HOST="<YOUR_DOMAIN_HERE>"