Browse Source

Merge branch 'master' into dcg-latest

feature/auto_ssh
nicolas.dorier 6 years ago
parent
commit
b4b417ec09
  1. 10
      .circleci/config.yml
  2. 1
      README.md
  3. 73
      btcpay-setup.sh
  4. 4
      docker-compose-generator/docker-compose-generator.sln
  5. 2
      docker-compose-generator/docker-fragments/bitcoin.yml
  6. 2
      docker-compose-generator/docker-fragments/btcpayserver.yml
  7. 43
      docker-compose-generator/docker-fragments/dogecoin.yml
  8. 2
      docker-compose-generator/docker-fragments/nbxplorer.yml
  9. 4
      docker-compose-generator/docker-fragments/nginx.yml
  10. 34
      docker-compose-generator/docker-fragments/opt-save-memory.yml
  11. 0
      docker-compose-generator/linuxamd64.Dockerfile
  12. 0
      docker-compose-generator/linuxarm32v7.Dockerfile
  13. 5
      docker-compose-generator/src/CryptoDefinition.cs
  14. 1
      dogecoin-cli.ps1
  15. 3
      dogecoin-cli.sh

10
.circleci/config.yml

@ -11,10 +11,10 @@ jobs:
command: |
cd docker-compose-generator
sudo docker login --username=$DOCKERHUB_USER --password=$DOCKERHUB_PASS
sudo docker build --pull -t $DOCKERHUB_REPO:latest-amd64 -f Dockerfile.linuxamd64 .
sudo docker build --pull -t $DOCKERHUB_REPO:latest-amd64 -f linuxamd64.Dockerfile .
sudo docker push $DOCKERHUB_REPO:latest-amd64
publish_docker_linuxarm:
publish_docker_linuxarm32v7:
machine:
docker_layer_caching: true
steps:
@ -25,7 +25,7 @@ jobs:
#
cd docker-compose-generator
sudo docker login --username=$DOCKERHUB_USER --password=$DOCKERHUB_PASS
sudo docker build --pull -t $DOCKERHUB_REPO:latest-arm32v7 -f Dockerfile.linuxarm32v7 .
sudo docker build --pull -t $DOCKERHUB_REPO:latest-arm32v7 -f linuxarm32v7.Dockerfile .
sudo docker push $DOCKERHUB_REPO:latest-arm32v7
publish_docker_multiarch:
@ -54,14 +54,14 @@ workflows:
filters:
branches:
only: dcg-latest
- publish_docker_linuxarm:
- publish_docker_linuxarm32v7:
filters:
branches:
only: dcg-latest
- publish_docker_multiarch:
requires:
- publish_docker_linuxamd64
- publish_docker_linuxarm
- publish_docker_linuxarm32v7
filters:
branches:
only: dcg-latest

1
README.md

@ -155,6 +155,7 @@ Available `BTCPAYGEN_ADDITIONAL_FRAGMENTS` currently are:
* [opt-save-storage-xs](docker-compose-generator/docker-fragments/opt-save-storage-xs.yml) will keep around 3 months of blocks (prune BTC for 25 GB)
* [opt-save-storage-xxs](docker-compose-generator/docker-fragments/opt-save-storage-xxs.yml) will keep around 2 weeks of blocks (prune BTC for 5 GB) (lightning not supported)
* [opt-lnd-autopilot](docker-compose-generator/docker-fragments/opt-lnd-autopilot.yml) will activate auto pilot on LND. (5 channels, 60% of allocation)
* [opt-save-memory](docker-compose-generator/docker-fragments/opt-save-memory.yml) will decrease the default dbcache at the expense of longer synchronization time (Useful if your machine is less than 2GB)
You can also create your own [custom fragments](#how-can-i-customize-the-generated-docker-compose-file).

73
btcpay-setup.sh

@ -192,15 +192,8 @@ export BTCPAY_DOCKER_COMPOSE=\"$BTCPAY_DOCKER_COMPOSE\"
export BTCPAY_BASE_DIRECTORY=\"$BTCPAY_BASE_DIRECTORY\"
export BTCPAY_ENV_FILE=\"$BTCPAY_ENV_FILE\"
export BTCPAY_HOST_SSHKEYFILE=\"$BTCPAY_HOST_SSHKEYFILE\"
if cat \$BTCPAY_ENV_FILE &> /dev/null; then
export BTCPAY_HOST=\"\$(cat \$BTCPAY_ENV_FILE | sed -n 's/^BTCPAY_HOST=\(.*\)$/\1/p')\"
export BTCPAY_IMAGE=\"\$(cat \$BTCPAY_ENV_FILE | sed -n 's/^BTCPAY_IMAGE=\(.*\)$/\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')\"
if cat \"\$BTCPAY_ENV_FILE\" &> /dev/null; then
export \$(grep -v '^#' \"\$BTCPAY_ENV_FILE\" | xargs)
fi
" > /etc/profile.d/btcpay-env.sh
chmod +x /etc/profile.d/btcpay-env.sh
@ -223,40 +216,47 @@ echo -e "BTCPay Server docker-compose parameters saved in $BTCPAY_ENV_FILE\n"
. /etc/profile.d/btcpay-env.sh
if ! [ -x "$(command -v docker)" ] || ! [ -x "$(command -v docker-compose)" ]; then
apt-get update 2>error
apt-get install -y \
curl \
apt-transport-https \
ca-certificates \
software-properties-common \
2>error
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -
if [ $(lsb_release -cs) == "bionic" ]; then
# Bionic not in the repo yet, see https://linuxconfig.org/how-to-install-docker-on-ubuntu-18-04-bionic-beaver
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu artful stable"
else
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
if ! [ -x "$(command -v curl)" ]; then
apt-get update 2>error
apt-get install -y \
curl \
apt-transport-https \
ca-certificates \
software-properties-common \
2>error
fi
if ! [ -x "$(command -v docker)" ]; then
echo "Trying to install docker..."
curl -fsSL https://get.docker.com -o get-docker.sh
chmod +x get-docker.sh
sh get-docker.sh
rm get-docker.sh
fi
if ! [ -x "$(command -v docker-compose)" ]; then
if [[ "$(uname -m)" == "x86_64" ]]; then
DOCKER_COMPOSE_DOWNLOAD="https://github.com/docker/compose/releases/download/1.17.1/docker-compose-$(uname -s)-$(uname -m)"
echo "Trying to install docker-compose by downloading on $DOCKER_COMPOSE_DOWNLOAD ($(uname -m))"
curl -L "$DOCKER_COMPOSE_DOWNLOAD" -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
else
echo "Trying to install docker-compose by using the docker-compose-builder ($(uname -m))"
! [ -d "dist" ] && mkdir dist
docker run --rm -ti -v "$(pwd)/dist:/dist" btcpayserver/docker-compose-builder:1.22.0
mv dist/docker-compose /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
rm -rf "dist"
fi
fi
apt-get update 2>error
fi
if ! [ -x "$(command -v docker)" ]; then
if apt-get install -y docker-ce ; then
echo "Docker installed"
else
echo "Failed to install docker"
return
fi
else
echo -e "docker is already installed\n"
echo "Failed to install docker"
return
fi
# Install docker-compose
if ! [ -x "$(command -v docker-compose)" ]; then
curl -L https://github.com/docker/compose/releases/download/1.17.1/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
else
echo -e "docker-compose is already installed\n"
echo "Failed to install docker-compose"
return
fi
# Generate the docker compose in BTCPAY_DOCKER_COMPOSE
@ -292,6 +292,7 @@ ExecReload=/bin/bash -c '. /etc/profile.d/btcpay-env.sh && cd \"\$(dirname \$BTC
WantedBy=multi-user.target" > /etc/systemd/system/btcpayserver.service
echo -e "BTCPay Server systemd configured in /etc/systemd/system/btcpayserver.service\n"
echo "BTCPay Server starting... this can take 5 to 10 minutes..."
systemctl daemon-reload
systemctl enable btcpayserver
systemctl start btcpayserver

4
docker-compose-generator/docker-compose-generator.sln

@ -8,8 +8,8 @@ EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Misc", "Misc", "{8C1C711D-DEF1-474C-A9F6-AAE142412528}"
ProjectSection(SolutionItems) = preProject
..\.circleci\config.yml = ..\.circleci\config.yml
Dockerfile.linuxamd64 = Dockerfile.linuxamd64
Dockerfile.linuxarm32v7 = Dockerfile.linuxarm32v7
linuxamd64.Dockerfile = linuxamd64.Dockerfile
linuxarm32v7.Dockerfile = linuxarm32v7.Dockerfile
EndProjectSection
EndProject
Global

2
docker-compose-generator/docker-fragments/bitcoin.yml

@ -4,7 +4,7 @@ services:
bitcoind:
restart: unless-stopped
container_name: btcpayserver_bitcoind
image: nicolasdorier/docker-bitcoin:0.17.0
image: btcpayserver/bitcoin:0.17.0
environment:
BITCOIN_NETWORK: ${NBITCOIN_NETWORK:-regtest}
BITCOIN_EXTRA_ARGS: |

2
docker-compose-generator/docker-fragments/btcpayserver.yml

@ -4,7 +4,7 @@ services:
btcpayserver:
restart: unless-stopped
image: ${BTCPAY_IMAGE:-nicolasdorier/btcpayserver:1.0.3.16}
image: ${BTCPAY_IMAGE:-btcpayserver/btcpayserver:1.0.3.17}
expose:
- "49392"
environment:

43
docker-compose-generator/docker-fragments/dogecoin.yml

@ -0,0 +1,43 @@
version: "3"
services:
dogecoind:
restart: unless-stopped
container_name: btcpayserver_dogecoind
image: rockstardev/dogecoin:1.10.0
environment:
DOGECOIN_EXTRA_ARGS: |
rpcuser=ceiwHEbqWI83
rpcpassword=DwubwWsoo3
${NBITCOIN_NETWORK:-regtest}=1
server=1
rpcport=22555
port=22556
whitelist=0.0.0.0/0
# Reducing memory usage of dogecoind. Don't try running this container without at least 2 GB of memory
# https://www.reddit.com/r/dogecoin/comments/5wynqe/reducing_memory_usage_of_dogecoind/
dbcache=50
ports:
- "22555:22555"
expose:
- "22555" # RPC
- "22556" # P2P
volumes:
- "dogecoin_datadir:/data"
nbxplorer:
environment:
NBXPLORER_CHAINS: "doge"
NBXPLORER_VIARPCURL: http://dogecoind:22555/
NBXPLORER_VIANODEENDPOINT: dogecoind:22556
NBXPLORER_DOGERPCUSER: ceiwHEbqWI83
NBXPLORER_DOGERPCPASSWORD: DwubwWsoo3
links:
- dogecoind
volumes:
- "dogecoin_datadir:/root/.dogecoin"
btcpayserver:
environment:
BTCPAY_CHAINS: "doge"
BTCPAY_DOGEEXPLORERURL: http://nbxplorer:32838/
volumes:
dogecoin_datadir:

2
docker-compose-generator/docker-fragments/nbxplorer.yml

@ -4,7 +4,7 @@ services:
nbxplorer:
restart: unless-stopped
image: nicolasdorier/nbxplorer:1.1.0.18
image: nicolasdorier/nbxplorer:2.0.0.1
expose:
- "32838"
environment:

4
docker-compose-generator/docker-fragments/nginx.yml

@ -18,7 +18,7 @@ services:
nginx-gen:
restart: unless-stopped
image: jwilder/docker-gen
image: btcpayserver/docker-gen:0.7.4
container_name: nginx-gen
volumes:
- "/var/run/docker.sock:/tmp/docker.sock:ro"
@ -33,7 +33,7 @@ services:
letsencrypt-nginx-proxy-companion:
restart: unless-stopped
image: jrcs/letsencrypt-nginx-proxy-companion
image: btcpayserver/letsencrypt-nginx-proxy-companion:1.10.0
container_name: letsencrypt-nginx-proxy-companion
volumes:
- "/var/run/docker.sock:/var/run/docker.sock:ro"

34
docker-compose-generator/docker-fragments/opt-save-memory.yml

@ -0,0 +1,34 @@
version: "3"
# If your machine has less than 1GB of memory, use this
services:
bitcoind:
environment:
BITCOIN_EXTRA_ARGS: |
dbcache=150
maxmempool=100
bgoldd:
environment:
BITCOIN_EXTRA_ARGS: |
dbcache=150
maxmempool=100
feathercoind:
environment:
BITCOIN_EXTRA_ARGS: |
dbcache=150
maxmempool=100
groestlcoind:
environment:
BITCOIN_EXTRA_ARGS: |
dbcache=150
maxmempool=100
litecoind:
environment:
BITCOIN_EXTRA_ARGS: |
dbcache=150
maxmempool=100
viacoind:
environment:
BITCOIN_EXTRA_ARGS: |
dbcache=150
maxmempool=100

0
docker-compose-generator/Dockerfile.linuxamd64 → docker-compose-generator/linuxamd64.Dockerfile

0
docker-compose-generator/Dockerfile.linuxarm32v7 → docker-compose-generator/linuxarm32v7.Dockerfile

5
docker-compose-generator/src/CryptoDefinition.cs

@ -65,6 +65,11 @@ namespace DockerGenerator
{
Crypto = "via",
CryptoFragment = "viacoin"
},
new CryptoDefinition()
{
Crypto = "doge",
CryptoFragment = "dogecoin"
}
};
}

1
dogecoin-cli.ps1

@ -0,0 +1 @@
docker exec -ti btcpayserver_dogecoind dogecoin-cli -datadir="/data" $args

3
dogecoin-cli.sh

@ -0,0 +1,3 @@
#!/bin/bash
docker exec -ti btcpayserver_dogecoind dogecoin-cli -datadir="/data" "$@"
Loading…
Cancel
Save