-
Notifications
You must be signed in to change notification settings - Fork 11
/
main.btcpay.yaml
58 lines (58 loc) · 2.38 KB
/
main.btcpay.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
imports:
- path: vm.jinja
resources:
- name: deploy-btcpay-vm-with-btcpay-server
type: vm.jinja
properties:
############ EDIT PROPERTY START HERE ##############
region: asia-northeast1
zone: asia-northeast1-b
vmtype: custom-1-7680-ext
linuxType: ubuntu-1604-lts
diskSizeGb: 500
startup-script: |
#!/bin/bash
### mandatory settings ###
BTCPAY_HOST=btcpaytest.mycompany.net
NBITCOIN_NETWORK=testnet
BTCPAYGEN_CRYPTO1=btc
BTCPAYGEN_LIGHTNING=lnd
### optional settings (No need to set unless required) ###
LETSENCRYPT_EMAIL=
LIGHTNING_ALIAS=
BTCPAYGEN_CRYPTO2=
CUSTOM_SSH_KEY=
### default settings(basically no need to change) ###
BTCPAY_DOCKER_REPO=https://github.com/btcpayserver/btcpayserver-docker
BTCPAY_DOCKER_REPO_BRANCH=master
BTCPAYGEN_REVERSEPROXY=nginx
ACME_CA_URI:=https://acme-staging.api.letsencrypt.org/directory
#prune mode with 100Gb blockchain (1 year long blochchain)
BTCPAYGEN_ADDITIONAL_FRAGMENTS="opt-save-storage"
############ EDIT PROPERTY END HERE ##############
### Script below
if ! [ -x "$(command -v git)" ]; then
apt-get update 2>error
apt-get install -y git 2>error
fi
# Setup SSH access via private key
ssh-keygen -t rsa -f /root/.ssh/id_rsa_btcpay -q -P ""
echo "# Key used by BTCPay Server" >> /root/.ssh/authorized_keys
cat /root/.ssh/id_rsa_btcpay.pub >> /root/.ssh/authorized_keys
if [[ "$CUSTOM_SSH_KEY" ]]; then
echo "" >> /root/.ssh/authorized_keys
echo "# User key" >> /root/.ssh/authorized_keys
echo "$CUSTOM_SSH_KEY" >> /root/.ssh/authorized_keys
echo "Custom SSH Key added to /root/.ssh/authorized_keys"
fi
sed -i -e '/^PasswordAuthentication / s/ .*/ no/' /etc/ssh/sshd_config
userdel -r -f temp
# Configure BTCPAY to have access to SSH
BTCPAY_HOST_SSHKEYFILE=/root/.ssh/id_rsa_btcpay
# Clone btcpayserver-docker
git clone $BTCPAY_DOCKER_REPO
cd btcpayserver-docker
git checkout $BTCPAY_DOCKER_REPO_BRANCH
. ./btcpay-setup.sh -i
[ -x "$(command -v /etc/init.d/sshd)" ] && nohup /etc/init.d/sshd restart &
[ -x "$(command -v /etc/init.d/ssh)" ] && nohup /etc/init.d/ssh restart &