1
1

changes from tabconf

This commit is contained in:
Derek Smith 2023-09-05 22:01:57 -04:00
parent 334b138770
commit eaa4f0abb1
Signed by: farscapian
GPG Key ID: B443E530A14E1C90
14 changed files with 67 additions and 66 deletions

View File

@ -57,8 +57,8 @@ if ! lxc list --format csv | grep -q "$LXD_VM_NAME"; then
DOCKER_DISK_SIZE_GB="$BTCPAYSERVER_DOCKER_DISK_SIZE_GB" DOCKER_DISK_SIZE_GB="$BTCPAYSERVER_DOCKER_DISK_SIZE_GB"
fi fi
if [ "$VIRTUAL_MACHINE" = clamsserver ]; then if [ "$VIRTUAL_MACHINE" = lnplayserver ]; then
if [ "$SKIP_CLAMSSERVER" = true ]; then if [ "$SKIP_LNPLAY_SERVER" = true ]; then
exit 0 exit 0
fi fi

View File

@ -32,13 +32,13 @@ export BTCPAYSERVER_SSDATA_DISK_SIZE_GB=20
export BTCPAYSERVER_BACKUP_DISK_SIZE_GB=20 export BTCPAYSERVER_BACKUP_DISK_SIZE_GB=20
export BTCPAYSERVER_DOCKER_DISK_SIZE_GB=30 export BTCPAYSERVER_DOCKER_DISK_SIZE_GB=30
export CLAMSSERVER_SSDATA_DISK_SIZE_GB=20 export LNPLAY_SERVER_SSDATA_DISK_SIZE_GB=20
export CLAMSSERVER_BACKUP_DISK_SIZE_GB=20 export LNPLAY_SERVER_BACKUP_DISK_SIZE_GB=20
export CLAMSSERVER_DOCKER_DISK_SIZE_GB=100 export LNPLAY_SSERVER_DOCKER_DISK_SIZE_GB=100
export WWW_HOSTNAME="www" export WWW_HOSTNAME="www"
export BTCPAY_SERVER_HOSTNAME="btcpayserver" export BTCPAY_SERVER_HOSTNAME="btcpayserver"
export CLAMS_SERVER_HOSTNAME="clamsserver" export LNPLAY_SERVER_HOSTNAME="lnplayserver"
export BTCPAY_HOSTNAME_IN_CERT="btcpay" export BTCPAY_HOSTNAME_IN_CERT="btcpay"
export NEXTCLOUD_HOSTNAME="nextcloud" export NEXTCLOUD_HOSTNAME="nextcloud"
export GITEA_HOSTNAME="git" export GITEA_HOSTNAME="git"
@ -51,6 +51,6 @@ export BTCPAY_SERVER_CPU_COUNT="4"
export BTCPAY_SERVER_MEMORY_MB="4096" export BTCPAY_SERVER_MEMORY_MB="4096"
export WWW_SERVER_CPU_COUNT="4" export WWW_SERVER_CPU_COUNT="4"
export WWW_SERVER_MEMORY_MB="4096" export WWW_SERVER_MEMORY_MB="4096"
export CLAMS_SERVER_CPU_COUNT="4" export LNPLAY_SERVER_CPU_COUNT="4"
export CLAMS_SERVER_MEMORY_MB="4096" export LNPLAY_SERVER_MEMORY_MB="4096"
export DOCKER_IMAGE_CACHE_FQDN="registry-1.docker.io" export DOCKER_IMAGE_CACHE_FQDN="registry-1.docker.io"

View File

@ -13,4 +13,4 @@ export OTHER_SITES_LIST="$OTHER_SITES_LIST"
export PRIMARY_WWW_FQDN="$WWW_HOSTNAME.$DOMAIN_NAME" export PRIMARY_WWW_FQDN="$WWW_HOSTNAME.$DOMAIN_NAME"
export BTCPAY_SERVER_FQDN="$BTCPAY_SERVER_HOSTNAME.$DOMAIN_NAME" export BTCPAY_SERVER_FQDN="$BTCPAY_SERVER_HOSTNAME.$DOMAIN_NAME"
export CLAMS_SERVER_FQDN="$CLAMS_SERVER_HOSTNAME.$DOMAIN_NAME" export LNPLAY_SERVER_FQDN="$LNPLAY_SERVER_HOSTNAME.$DOMAIN_NAME"

View File

@ -14,7 +14,7 @@ KEEP_DOCKER_VOLUME=true
OTHER_SITES_LIST= OTHER_SITES_LIST=
SKIP_BTCPAYSERVER=false SKIP_BTCPAYSERVER=false
SKIP_WWW=false SKIP_WWW=false
SKIP_CLAMSSERVER=false SKIP_LNPLAY_SERVER=false
BACKUP_WWW_APPS=true BACKUP_WWW_APPS=true
# grab any modifications from the command line. # grab any modifications from the command line.
@ -32,8 +32,8 @@ for i in "$@"; do
SKIP_WWW=true SKIP_WWW=true
shift shift
;; ;;
--skip-clamsserver) --skip-lnplayserver)
SKIP_CLAMSSERVER=true SKIP_LNPLAY_SERVER=true
shift shift
;; ;;
*) *)
@ -52,8 +52,8 @@ if [ "$SKIP_WWW" = false ]; then
SERVERS="www $SERVERS" SERVERS="www $SERVERS"
fi fi
if [ "$SKIP_CLAMSSERVER" = false ]; then if [ "$SKIP_LNPLAY_SERVER" = false ]; then
SERVERS="clamsserver $SERVERS" SERVERS="lnplayserver $SERVERS"
fi fi
. ./deployment_defaults.sh . ./deployment_defaults.sh
@ -103,7 +103,7 @@ for VIRTUAL_MACHINE in $SERVERS; do
VM_ID=w VM_ID=w
if [ "$VIRTUAL_MACHINE" = btcpayserver ]; then if [ "$VIRTUAL_MACHINE" = btcpayserver ]; then
VM_ID="b" VM_ID="b"
elif [ "$VIRTUAL_MACHINE" = clamsserver ]; then elif [ "$VIRTUAL_MACHINE" = lnplayserver ]; then
VM_ID="c" VM_ID="c"
fi fi

@ -1 +1 @@
Subproject commit 9eceb40dba3946011723321d059614c9d9acf8fe Subproject commit 7dbfb2e4a7d6c0fec4227520bad2d2e67f1dbec1

View File

@ -50,6 +50,6 @@ export BTCPAYSERVER_SSDATA_DISK_SIZE_GB="$BTCPAYSERVER_SSDATA_DISK_SIZE_GB"
export BTCPAYSERVER_BACKUP_DISK_SIZE_GB="$BTCPAYSERVER_BACKUP_DISK_SIZE_GB" export BTCPAYSERVER_BACKUP_DISK_SIZE_GB="$BTCPAYSERVER_BACKUP_DISK_SIZE_GB"
export BTCPAYSERVER_DOCKER_DISK_SIZE_GB="$BTCPAYSERVER_DOCKER_DISK_SIZE_GB" export BTCPAYSERVER_DOCKER_DISK_SIZE_GB="$BTCPAYSERVER_DOCKER_DISK_SIZE_GB"
export CLAMSSERVER_SSDATA_DISK_SIZE_GB="$CLAMSSERVER_SSDATA_DISK_SIZE_GB" export LNPLAY_SERVER_SSDATA_DISK_SIZE_GB="$LNPLAY_SERVER_SSDATA_DISK_SIZE_GB"
export CLAMSSERVER_BACKUP_DISK_SIZE_GB="$CLAMSSERVER_BACKUP_DISK_SIZE_GB" export LNPLAY_SERVER_BACKUP_DISK_SIZE_GB="$LNPLAY_SERVER_BACKUP_DISK_SIZE_GB"
export CLAMSSERVER_DOCKER_DISK_SIZE_GB="$CLAMSSERVER_DOCKER_DISK_SIZE_GB" export LNPLAY_SSERVER_DOCKER_DISK_SIZE_GB="$LNPLAY_SSERVER_DOCKER_DISK_SIZE_GB"

View File

@ -13,8 +13,8 @@ DISK_TO_USE=
# override the remote name. # override the remote name.
REMOTE_NAME="${1:-}" REMOTE_NAME="${1:-}"
if [ -z "$REMOTE_NAME" ]; then if [ -z "$REMOTE_NAME" ]; then
echo "ERROR: The remote name was not provided. Syntax is: 'ss-remote REMOTE_NAME SSH_HOST_FQDN'" echo "ERROR: The remote name was not provided. Syntax is: 'ss-remote <remote_name> <remote01.domain.tld>'"
echo " for example: 'ss-remote dev host01.domain.tld" echo " for example: 'ss-remote development clusterhost00.domain.tld"
exit 1 exit 1
fi fi
@ -148,7 +148,7 @@ fi
# install dependencies. # install dependencies.
ssh -t "ubuntu@$FQDN" 'sudo apt update && sudo apt upgrade -y && sudo apt install htop dnsutils nano -y' ssh -t "ubuntu@$FQDN" 'sudo apt update && sudo apt upgrade -y && sudo apt install htop dnsutils nano -y'
if ! ssh "ubuntu@$FQDN" snap list | grep -q lxd; then if ! ssh "ubuntu@$FQDN" snap list | grep -q lxd; then
ssh -t "ubuntu@$FQDN" 'sudo snap install lxd --channel=5.16/stable' ssh -t "ubuntu@$FQDN" 'sudo snap install lxd --channel=5.17/stable'
sleep 5 sleep 5
fi fi

View File

@ -65,9 +65,9 @@ for PROJECT_CHAIN in ${DEPLOYMENT_STRING//,/ }; do
BTCPAYSERVER_BACKUP_DISK_SIZE_GB=30 BTCPAYSERVER_BACKUP_DISK_SIZE_GB=30
BTCPAYSERVER_DOCKER_DISK_SIZE_GB=100 BTCPAYSERVER_DOCKER_DISK_SIZE_GB=100
CLAMSSERVER_SSDATA_DISK_SIZE_GB=20 LNPLAY_SERVER_SSDATA_DISK_SIZE_GB=20
CLAMSSERVER_BACKUP_DISK_SIZE_GB=20 LNPLAY_SERVER_BACKUP_DISK_SIZE_GB=20
CLAMSSERVER_DOCKER_DISK_SIZE_GB=20 LNPLAY_SSERVER_DOCKER_DISK_SIZE_GB=20
elif [ "$BITCOIN_CHAIN" = mainnet ]; then elif [ "$BITCOIN_CHAIN" = mainnet ]; then
@ -79,9 +79,9 @@ for PROJECT_CHAIN in ${DEPLOYMENT_STRING//,/ }; do
BTCPAYSERVER_BACKUP_DISK_SIZE_GB=30 BTCPAYSERVER_BACKUP_DISK_SIZE_GB=30
BTCPAYSERVER_DOCKER_DISK_SIZE_GB=500 BTCPAYSERVER_DOCKER_DISK_SIZE_GB=500
CLAMSSERVER_SSDATA_DISK_SIZE_GB=20 LNPLAY_SERVER_SSDATA_DISK_SIZE_GB=20
CLAMSSERVER_BACKUP_DISK_SIZE_GB=20 LNPLAY_SERVER_BACKUP_DISK_SIZE_GB=20
CLAMSSERVER_DOCKER_DISK_SIZE_GB=400 LNPLAY_SSERVER_DOCKER_DISK_SIZE_GB=400
fi fi

View File

@ -61,6 +61,6 @@ if [ "$SERVER_TO_STOP" = btcpayserver ]; then
fi fi
fi fi
if [ "$SERVER_TO_STOP" = clamsserver ]; then if [ "$SERVER_TO_STOP" = lnplayserver ]; then
DOCKER_HOST="ssh://ubuntu@$CLAMS_SERVER_FQDN" ./project/clams-server/down.sh DOCKER_HOST="ssh://ubuntu@$LNPLAY_SERVER_FQDN" ./project/lnplay/down.sh
fi fi

View File

@ -73,10 +73,10 @@ if [ "$VIRTUAL_MACHINE" = btcpayserver ]; then
EOF EOF
elif [ "$VIRTUAL_MACHINE" = clamsserver ]; then elif [ "$VIRTUAL_MACHINE" = lnplayserver ]; then
cat >> "$YAML_PATH" <<EOF cat >> "$YAML_PATH" <<EOF
limits.cpu: "${CLAMS_SERVER_CPU_COUNT}" limits.cpu: "${LNPLAY_SERVER_CPU_COUNT}"
limits.memory: "${CLAMS_SERVER_MEMORY_MB}MB" limits.memory: "${LNPLAY_SERVER_MEMORY_MB}MB"
EOF EOF
@ -301,7 +301,6 @@ EOF
fi fi
# let's create a profile for the BCM TYPE-1 VMs. This is per VM.
if [ "$VIRTUAL_MACHINE" = base ]; then if [ "$VIRTUAL_MACHINE" = base ]; then
if ! lxc profile list --format csv --project default | grep -q "$LXD_HOSTNAME"; then if ! lxc profile list --format csv --project default | grep -q "$LXD_HOSTNAME"; then
lxc profile create "$LXD_HOSTNAME" --project default lxc profile create "$LXD_HOSTNAME" --project default

View File

@ -44,7 +44,7 @@ BACKUP_CERTS=true
BACKUP_BTCPAY=true BACKUP_BTCPAY=true
SKIP_BTCPAYSERVER=false SKIP_BTCPAYSERVER=false
SKIP_WWW=false SKIP_WWW=false
SKIP_CLAMSSERVER=false SKIP_LNPLAY_SERVER=false
BACKUP_BTCPAY_ARCHIVE_PATH= BACKUP_BTCPAY_ARCHIVE_PATH=
RESTORE_BTCPAY=false RESTORE_BTCPAY=false
UPDATE_BTCPAY=false UPDATE_BTCPAY=false
@ -53,7 +53,7 @@ USER_SAYS_YES=false
WWW_SERVER_MAC_ADDRESS= WWW_SERVER_MAC_ADDRESS=
BTCPAY_SERVER_MAC_ADDRESS= BTCPAY_SERVER_MAC_ADDRESS=
CLAMS_SERVER_MAC_ADDRESS= LNPLAY_SERVER_MAC_ADDRESS=
# grab any modifications from the command line. # grab any modifications from the command line.
for i in "$@"; do for i in "$@"; do
@ -78,8 +78,8 @@ for i in "$@"; do
SKIP_WWW=true SKIP_WWW=true
shift shift
;; ;;
--skip-clamsserver) --skip-lnplayserver)
SKIP_CLAMSSERVER=true SKIP_LNPLAY_SERVER=true
shift shift
;; ;;
--backup-btcpayserver) --backup-btcpayserver)
@ -217,7 +217,7 @@ export PROJECT_NAME="$PROJECT_NAME"
export PROJECT_PATH="$PROJECTS_PATH/$PROJECT_NAME" export PROJECT_PATH="$PROJECTS_PATH/$PROJECT_NAME"
export SKIP_BTCPAYSERVER="$SKIP_BTCPAYSERVER" export SKIP_BTCPAYSERVER="$SKIP_BTCPAYSERVER"
export SKIP_WWW="$SKIP_WWW" export SKIP_WWW="$SKIP_WWW"
export SKIP_CLAMSSERVER="$SKIP_CLAMSSERVER" export SKIP_LNPLAY_SERVER="$SKIP_LNPLAY_SERVER"
mkdir -p "$PROJECT_PATH" "$REMOTE_PATH/projects" mkdir -p "$PROJECT_PATH" "$REMOTE_PATH/projects"
@ -248,9 +248,9 @@ BTCPAY_SERVER_MAC_ADDRESS=
# BTCPAY_SERVER_CPU_COUNT="4" # BTCPAY_SERVER_CPU_COUNT="4"
# BTCPAY_SERVER_MEMORY_MB="4096" # BTCPAY_SERVER_MEMORY_MB="4096"
CLAMS_SERVER_MAC_ADDRESS= LNPLAY_SERVER_MAC_ADDRESS=
# CLAMS_SERVER_CPU_COUNT="4" # LNPLAY_SERVER_CPU_COUNT="4"
# CLAMS_SERVER_MEMORY_MB="4096" # LNPLAY_SERVER_MEMORY_MB="4096"
EOL EOL
@ -279,8 +279,8 @@ if [ -z "$BTCPAY_SERVER_MAC_ADDRESS" ]; then
fi fi
if [ -z "$CLAMS_SERVER_MAC_ADDRESS" ]; then if [ -z "$LNPLAY_SERVER_MAC_ADDRESS" ]; then
echo "WARNING: the CLAMS_SERVER_MAC_ADDRESS is not specified. Check your project.conf." echo "WARNING: the LNPLAY_SERVER_MAC_ADDRESS is not specified. Check your project.conf."
fi fi
source ./domain_list.sh source ./domain_list.sh
@ -308,13 +308,13 @@ if ! lxc image list --format csv | grep -q "$DOCKER_BASE_IMAGE_NAME"; then
fi fi
fi fi
for VIRTUAL_MACHINE in www btcpayserver clamsserver; do for VIRTUAL_MACHINE in www btcpayserver lnplayserver; do
if [ "$VIRTUAL_MACHINE" = btcpayserver ] && [ -z "$BTCPAY_SERVER_MAC_ADDRESS" ]; then if [ "$VIRTUAL_MACHINE" = btcpayserver ] && [ -z "$BTCPAY_SERVER_MAC_ADDRESS" ]; then
continue continue
fi fi
if [ "$VIRTUAL_MACHINE" = clamsserver ] && [ -z "$CLAMS_SERVER_MAC_ADDRESS" ]; then if [ "$VIRTUAL_MACHINE" = lnplayserver ] && [ -z "$LNPLAY_SERVER_MAC_ADDRESS" ]; then
continue continue
fi fi
@ -377,10 +377,10 @@ for VIRTUAL_MACHINE in www btcpayserver clamsserver; do
VPS_HOSTNAME="$BTCPAY_SERVER_HOSTNAME" VPS_HOSTNAME="$BTCPAY_SERVER_HOSTNAME"
MAC_ADDRESS_TO_PROVISION="$BTCPAY_SERVER_MAC_ADDRESS" MAC_ADDRESS_TO_PROVISION="$BTCPAY_SERVER_MAC_ADDRESS"
elif [ "$VIRTUAL_MACHINE" = clamsserver ] && [ -n "$CLAMS_SERVER_MAC_ADDRESS" ]; then elif [ "$VIRTUAL_MACHINE" = lnplayserver ] && [ -n "$LNPLAY_SERVER_MAC_ADDRESS" ]; then
FQDN="$CLAMS_SERVER_HOSTNAME.$DOMAIN_NAME" FQDN="$LNPLAY_SERVER_HOSTNAME.$DOMAIN_NAME"
VPS_HOSTNAME="$CLAMS_SERVER_HOSTNAME" VPS_HOSTNAME="$LNPLAY_SERVER_HOSTNAME"
MAC_ADDRESS_TO_PROVISION="$CLAMS_SERVER_MAC_ADDRESS" MAC_ADDRESS_TO_PROVISION="$LNPLAY_SERVER_MAC_ADDRESS"
elif [ "$VIRTUAL_MACHINE" = "$BASE_IMAGE_VM_NAME" ]; then elif [ "$VIRTUAL_MACHINE" = "$BASE_IMAGE_VM_NAME" ]; then
export FQDN="$BASE_IMAGE_VM_NAME" export FQDN="$BASE_IMAGE_VM_NAME"
@ -428,33 +428,33 @@ if [ "$SKIP_WWW" = false ]; then
fi fi
fi fi
# don't run clams stuff if user specifies --skip-btcpayserver # don't run lnplay stuff if user specifies --skip-lnplay
if [ "$SKIP_CLAMSSERVER" = false ]; then if [ "$SKIP_LNPLAY_SERVER" = false ]; then
# now let's run the www and btcpay-specific provisioning scripts. # now let's run the www and btcpay-specific provisioning scripts.
if [ -n "$CLAMS_SERVER_MAC_ADDRESS" ]; then if [ -n "$LNPLAY_SERVER_MAC_ADDRESS" ]; then
export DOCKER_HOST="ssh://ubuntu@$CLAMS_SERVER_FQDN" export DOCKER_HOST="ssh://ubuntu@$LNPLAY_SERVER_FQDN"
# set the active env to our CLAMS_FQDN # set the active env to our LNPLAY_SERVER_FQDN
cat >./project/clams-server/active_env.txt <<EOL cat >./project/lnplay/active_env.txt <<EOL
${CLAMS_SERVER_FQDN} ${LNPLAY_SERVER_FQDN}
EOL EOL
CLAMS_ENV_FILE=./project/clams-server/environments/"$CLAMS_SERVER_FQDN" LNPLAY_ENV_FILE=./project/lnplay/environments/"$LNPLAY_SERVER_FQDN"
# only stub out the file if it doesn't exist. otherwise we leave it be. # only stub out the file if it doesn't exist. otherwise we leave it be.
if [ ! -f "$CLAMS_ENV_FILE" ]; then if [ ! -f "$LNPLAY_ENV_FILE" ]; then
# and we have to set our environment file as well. # and we have to set our environment file as well.
cat > "$CLAMS_ENV_FILE" <<EOL cat > "$LNPLAY_ENV_FILE" <<EOL
DOCKER_HOST=ssh://ubuntu@${CLAMS_SERVER_FQDN} DOCKER_HOST=ssh://ubuntu@${LNPLAY_SERVER_FQDN}
DOMAIN_NAME=${PRIMARY_DOMAIN} DOMAIN_NAME=${PRIMARY_DOMAIN}
ENABLE_TLS=true ENABLE_TLS=true
BTC_CHAIN=${BITCOIN_CHAIN} BTC_CHAIN=${BITCOIN_CHAIN}
CLN_COUNT=200 CLN_COUNT=200
CHANNEL_SETUP=none CHANNEL_SETUP=none
CLAMS_SERVER_PATH=${SITES_PATH}/${PRIMARY_DOMAIN}/clamsserver LNPLAY_SERVER_PATH=${SITES_PATH}/${PRIMARY_DOMAIN}/lnplayserver
EOL EOL
fi fi
bash -c "./project/clams-server/up.sh -y" bash -c "./project/lnplay/up.sh -y"
fi fi
fi fi

View File

@ -46,4 +46,6 @@ done
# wait for cloud-init to complet before returning. # wait for cloud-init to complet before returning.
while lxc exec "$LXC_INSTANCE_NAME" -- [ ! -f /var/lib/cloud/instance/boot-finished ]; do while lxc exec "$LXC_INSTANCE_NAME" -- [ ! -f /var/lib/cloud/instance/boot-finished ]; do
sleep 1 sleep 1
done done
sleep 1

View File

@ -47,7 +47,7 @@ export DISK="$DISK"
# install lxd snap and initialize it # install lxd snap and initialize it
if ! snap list | grep -q lxd; then if ! snap list | grep -q lxd; then
sudo snap install lxd --channel=5.16/stable sudo snap install lxd --channel=5.17/stable
sleep 5 sleep 5
# run lxd init # run lxd init

View File

@ -35,7 +35,7 @@ sleep 10
# install snap # install snap
if ! snap list | grep -q lxd; then if ! snap list | grep -q lxd; then
sudo snap install htop sudo snap install htop
sudo snap install lxd --channel=5.16/stable sudo snap install lxd --channel=5.17/stable
sleep 6 sleep 6
# We just do an auto initialization. All we are using is the LXD client inside the management environment. # We just do an auto initialization. All we are using is the LXD client inside the management environment.