Browse Source

Merge remote-tracking branch 'origin/master' into feature/traefik

feature/auto_ssh
Andrew Camilleri 6 years ago
parent
commit
030c5917b5
  1. 21
      README.md
  2. 3
      build.ps1
  3. 5
      build.sh
  4. 12
      docker-compose-generator/docker-fragments/opt-lnd-autopilot.yml
  5. 19
      docker-compose-generator/docker-fragments/opt-save-storage-s.yml
  6. 19
      docker-compose-generator/docker-fragments/opt-save-storage-xs.yml
  7. 19
      docker-compose-generator/docker-fragments/opt-save-storage-xxs.yml
  8. 19
      docker-compose-generator/docker-fragments/opt-save-storage.yml

21
README.md

@ -271,9 +271,24 @@ BTCPAY_SSHKEYFILE=/datadir/id_rsa
1. Add support for your crypto to [NBitcoin](https://github.com/MetacoSA/NBitcoin/tree/master/NBitcoin.Altcoins), [NBxplorer](https://github.com/dgarage/NBXplorer), and [BTCPayServer](https://github.com/btcpayserver/btcpayserver). (Use examples from other coins) 1. Add support for your crypto to [NBitcoin](https://github.com/MetacoSA/NBitcoin/tree/master/NBitcoin.Altcoins), [NBxplorer](https://github.com/dgarage/NBXplorer), and [BTCPayServer](https://github.com/btcpayserver/btcpayserver). (Use examples from other coins)
2. Create your own docker image ([Example for BTC](https://hub.docker.com/r/nicolasdorier/docker-bitcoin/)) 2. Create your own docker image ([Example for BTC](https://hub.docker.com/r/nicolasdorier/docker-bitcoin/))
3. Create a docker-compose fragment ([Example for BTC](docker-compose-generator/docker-fragments/bitcoin.yml)) 3. Create a docker-compose fragment ([Example for BTC](docker-compose-generator/docker-fragments/bitcoin.yml))
4. Add your coin to CryptoDefinition ([Example for BTC](docker-compose-generator/src/CryptoDefinition.cs)) 4. Add your `CryptoDefinition` ([Example for BTC](docker-compose-generator/src/CryptoDefinition.cs))
5. Tell the setup script to build the docker compose generator image locally by specifying the environment variable `BTCPAYGEN_DOCKER_IMAGE` to `btcpayserver/docker-compose-generator:local`
6. Configure the BtcPay environment variables as usual and run [build.sh](build.sh) (or [build.ps1](build.ps1)) to generate the docker compose script under `Generated` `build.sh` is using a pre-built image of the `docker-compose generator` on [docker hub](https://hub.docker.com/r/btcpayserver/docker-compose-generator/).
If you modify the code source of `docker-compose generator` (for example, the `CryptoDefinition` [Example for BTC](docker-compose-generator/src/CryptoDefinition.cs)), you need to configure `build.sh` to use your own image by setting the environment variable `BTCPAYGEN_DOCKER_IMAGE` to `btcpayserver/docker-compose-generator:local`.
```bash
cd docker-compose-generator
BTCPAYGEN_DOCKER_IMAGE="btcpayserver/docker-compose-generator:local"
```
Or on powershell:
```powershell
cd docker-compose-generator
$BTCPAYGEN_DOCKER_IMAGE="btcpayserver/docker-compose-generator:local"
```
Then run `./build.sh` or `. .\build.ps1`.
This will generate your docker-compose in the `Generated` folder, which you can then run and test.
Note that BTCPayServer developers will not spend excessive time testing your image, so make sure it works. Note that BTCPayServer developers will not spend excessive time testing your image, so make sure it works.

3
build.ps1

@ -2,7 +2,8 @@
if (-not ($BTCPAYGEN_DOCKER_IMAGE)) { $BTCPAYGEN_DOCKER_IMAGE = "btcpayserver/docker-compose-generator" } if (-not ($BTCPAYGEN_DOCKER_IMAGE)) { $BTCPAYGEN_DOCKER_IMAGE = "btcpayserver/docker-compose-generator" }
If (-not ($BTCPAYGEN_DOCKER_IMAGE)) { $BTCPAYGEN_DOCKER_IMAGE = "btcpayserver/docker-compose-generator" } If (-not ($BTCPAYGEN_DOCKER_IMAGE)) { $BTCPAYGEN_DOCKER_IMAGE = "btcpayserver/docker-compose-generator" }
If($BTCPAYGEN_DOCKER_IMAGE -eq "btcpayserver/docker-compose-generator:local"){
If ($BTCPAYGEN_DOCKER_IMAGE -eq "btcpayserver/docker-compose-generator:local"){
docker build docker-compose-generator --tag $BTCPAYGEN_DOCKER_IMAGE docker build docker-compose-generator --tag $BTCPAYGEN_DOCKER_IMAGE
} Else { } Else {
docker pull $BTCPAYGEN_DOCKER_IMAGE docker pull $BTCPAYGEN_DOCKER_IMAGE

5
build.sh

@ -1,10 +1,11 @@
#!/bin/bash #!/bin/bash
: "${BTCPAYGEN_DOCKER_IMAGE:=btcpayserver/docker-compose-generator}"
if [ "$BTCPAYGEN_DOCKER_IMAGE" == "btcpayserver/docker-compose-generator:local" ] if [ "$BTCPAYGEN_DOCKER_IMAGE" == "btcpayserver/docker-compose-generator:local" ]
then then
docker build docker-compose-generator --tag $BTCPAYGEN_DOCKER_IMAGE docker build docker-compose-generator --tag $BTCPAYGEN_DOCKER_IMAGE
else else
docker pull ${BTCPAYGEN_DOCKER_IMAGE:-"btcpayserver/docker-compose-generator"} docker pull $BTCPAYGEN_DOCKER_IMAGE
fi fi
# This script will run docker-compose-generator in a container to generate the yml files # This script will run docker-compose-generator in a container to generate the yml files
@ -23,7 +24,7 @@ docker run -v "$(pwd)/Generated:/app/Generated" \
-e "BTCPAYGEN_ADDITIONAL_FRAGMENTS=$BTCPAYGEN_ADDITIONAL_FRAGMENTS" \ -e "BTCPAYGEN_ADDITIONAL_FRAGMENTS=$BTCPAYGEN_ADDITIONAL_FRAGMENTS" \
-e "BTCPAYGEN_LIGHTNING=$BTCPAYGEN_LIGHTNING" \ -e "BTCPAYGEN_LIGHTNING=$BTCPAYGEN_LIGHTNING" \
-e "BTCPAYGEN_SUBNAME=$BTCPAYGEN_SUBNAME" \ -e "BTCPAYGEN_SUBNAME=$BTCPAYGEN_SUBNAME" \
--rm ${BTCPAYGEN_DOCKER_IMAGE:-"btcpayserver/docker-compose-generator"} --rm $BTCPAYGEN_DOCKER_IMAGE
if [ "$BTCPAYGEN_REVERSEPROXY" == "nginx" ]; then if [ "$BTCPAYGEN_REVERSEPROXY" == "nginx" ]; then
cp Production/nginx.tmpl Generated/nginx.tmpl cp Production/nginx.tmpl Generated/nginx.tmpl

12
docker-compose-generator/docker-fragments/opt-lnd-autopilot.yml

@ -7,3 +7,15 @@ services:
autopilot.active=1 autopilot.active=1
autopilot.maxchannels=5 autopilot.maxchannels=5
autopilot.allocation=0.6 autopilot.allocation=0.6
lnd_litecoin:
environment:
LND_EXTRA_ARGS: |
autopilot.active=1
autopilot.maxchannels=5
autopilot.allocation=0.6
lnd_bitcoingold:
environment:
LND_EXTRA_ARGS: |
autopilot.active=1
autopilot.maxchannels=5
autopilot.allocation=0.6

19
docker-compose-generator/docker-fragments/opt-save-storage-s.yml

@ -1,8 +1,23 @@
version: "3" version: "3"
# If you don't use Lightning Network, use opt-save-store-xxs instead
# This save about 6 months of block, your lightning node won't be able to see channel created 6 months since the time you start it.
services: services:
bitcoind: bitcoind:
environment: environment:
# If you don't use Lightning Network, use opt-save-store-xxs instead BITCOIN_EXTRA_ARGS: prune=50000
# This save about 6 months of block, your lightning node won't be able to see channel created 6 months since the time you start it. bgoldd:
environment:
BITCOIN_EXTRA_ARGS: prune=50000
feathercoind:
environment:
BITCOIN_EXTRA_ARGS: prune=50000
groestlcoind:
environment:
BITCOIN_EXTRA_ARGS: prune=50000
litecoind:
environment:
BITCOIN_EXTRA_ARGS: prune=50000
viacoind:
environment:
BITCOIN_EXTRA_ARGS: prune=50000 BITCOIN_EXTRA_ARGS: prune=50000

19
docker-compose-generator/docker-fragments/opt-save-storage-xs.yml

@ -1,8 +1,23 @@
version: "3" version: "3"
# If you don't use Lightning Network, use opt-save-store-xxs instead
# This save about 3 months of block, your lightning node won't be able to see channel created 3 months since the time you start it.
services: services:
bitcoind: bitcoind:
environment: environment:
# If you don't use Lightning Network, use opt-save-store-xxs instead BITCOIN_EXTRA_ARGS: prune=25000
# This save about 3 months of block, your lightning node won't be able to see channel created 3 months since the time you start it. bgoldd:
environment:
BITCOIN_EXTRA_ARGS: prune=25000
feathercoind:
environment:
BITCOIN_EXTRA_ARGS: prune=25000
groestlcoind:
environment:
BITCOIN_EXTRA_ARGS: prune=25000
litecoind:
environment:
BITCOIN_EXTRA_ARGS: prune=25000
viacoind:
environment:
BITCOIN_EXTRA_ARGS: prune=25000 BITCOIN_EXTRA_ARGS: prune=25000

19
docker-compose-generator/docker-fragments/opt-save-storage-xxs.yml

@ -1,8 +1,23 @@
version: "3" version: "3"
# If you don't use Lightning Network, you want this
# This save about 2 weeks worth of block
services: services:
bitcoind: bitcoind:
environment: environment:
# If you don't use Lightning Network, you want this BITCOIN_EXTRA_ARGS: prune=5000
# This save about 2 weeks worth of block bgoldd:
environment:
BITCOIN_EXTRA_ARGS: prune=5000
feathercoind:
environment:
BITCOIN_EXTRA_ARGS: prune=5000
groestlcoind:
environment:
BITCOIN_EXTRA_ARGS: prune=5000
litecoind:
environment:
BITCOIN_EXTRA_ARGS: prune=5000
viacoind:
environment:
BITCOIN_EXTRA_ARGS: prune=5000 BITCOIN_EXTRA_ARGS: prune=5000

19
docker-compose-generator/docker-fragments/opt-save-storage.yml

@ -1,8 +1,23 @@
version: "3" version: "3"
# If you don't use Lightning Network, use opt-save-store-xxs instead
# This save about 1 years of block, your lightning node won't be able to see channel created 1 year since the time you start it.
services: services:
bitcoind: bitcoind:
environment: environment:
# If you don't use Lightning Network, use opt-save-store-xxs instead BITCOIN_EXTRA_ARGS: prune=100000
# This save about 1 years of block, your lightning node won't be able to see channel created 1 year since the time you start it. bgoldd:
environment:
BITCOIN_EXTRA_ARGS: prune=100000
feathercoind:
environment:
BITCOIN_EXTRA_ARGS: prune=100000
groestlcoind:
environment:
BITCOIN_EXTRA_ARGS: prune=100000
litecoind:
environment:
BITCOIN_EXTRA_ARGS: prune=100000
viacoind:
environment:
BITCOIN_EXTRA_ARGS: prune=100000 BITCOIN_EXTRA_ARGS: prune=100000
Loading…
Cancel
Save