1
1

Add clams-server in lieu of existing integration.

This commit is contained in:
Derek Smith 2023-08-11 09:46:08 -04:00
parent 0b38d6d635
commit d8903eb5bc
Signed by: farscapian
GPG Key ID: B443E530A14E1C90
6 changed files with 66 additions and 20 deletions

3
.gitmodules vendored Normal file
View File

@ -0,0 +1,3 @@
[submodule "deployment/project/clams-server"]
path = deployment/project/clams-server
url = https://github.com/farscapian/roygbiv-stack

View File

@ -49,6 +49,13 @@ if ! lxc list --format csv | grep -q "$LXD_VM_NAME"; then
DOCKER_DISK_SIZE_GB="$BTCPAYSERVER_DOCKER_DISK_SIZE_GB"
fi
if [ "$VIRTUAL_MACHINE" = clamsserver ]; then
VM_ID="c"
BACKUP_DISK_SIZE_GB="$BTCPAYSERVER_BACKUP_DISK_SIZE_GB"
SSDATA_DISK_SIZE_GB="$BTCPAYSERVER_SSDATA_DISK_SIZE_GB"
DOCKER_DISK_SIZE_GB="$BTCPAYSERVER_DOCKER_DISK_SIZE_GB"
fi
DOCKER_VOLUME_NAME="$PRIMARY_DOMAIN_IDENTIFIER-$VM_ID""d"
if ! lxc storage volume list ss-base | grep -q "$DOCKER_VOLUME_NAME"; then
lxc storage volume create ss-base "$DOCKER_VOLUME_NAME" --type=block

View File

@ -32,13 +32,16 @@ export BTCPAYSERVER_SSDATA_DISK_SIZE_GB=20
export BTCPAYSERVER_BACKUP_DISK_SIZE_GB=20
export BTCPAYSERVER_DOCKER_DISK_SIZE_GB=30
export CLAMSSERVER_SSDATA_DISK_SIZE_GB=20
export CLAMSSERVER_BACKUP_DISK_SIZE_GB=20
export CLAMSSERVER_DOCKER_DISK_SIZE_GB=100
export WWW_HOSTNAME="www"
export BTCPAY_HOSTNAME="btcpayserver"
export CLAMS_SERVER_HOSTNAME="clamsserver"
export BTCPAY_HOSTNAME_IN_CERT="btcpay"
export NEXTCLOUD_HOSTNAME="nextcloud"
export GITEA_HOSTNAME="git"
export NOSTR_HOSTNAME="relay"
export CLAMS_HOSTNAME="clams"
export REGISTRY_URL="https://index.docker.io/v1"
@ -47,4 +50,6 @@ export BTCPAY_SERVER_CPU_COUNT="4"
export BTCPAY_SERVER_MEMORY_MB="4096"
export WWW_SERVER_CPU_COUNT="4"
export WWW_SERVER_MEMORY_MB="4096"
export CLAMS_SERVER_CPU_COUNT="4"
export CLAMS_SERVER_MEMORY_MB="4096"
export DOCKER_IMAGE_CACHE_FQDN="registry-1.docker.io"

View File

@ -49,3 +49,7 @@ export WWW_DOCKER_DISK_SIZE_GB="$WWW_DOCKER_DISK_SIZE_GB"
export BTCPAYSERVER_SSDATA_DISK_SIZE_GB="$BTCPAYSERVER_SSDATA_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 CLAMSSERVER_SSDATA_DISK_SIZE_GB="$CLAMSSERVER_SSDATA_DISK_SIZE_GB"
export CLAMSSERVER_BACKUP_DISK_SIZE_GB="$CLAMSSERVER_BACKUP_DISK_SIZE_GB"
export CLAMSSERVER_DOCKER_DISK_SIZE_GB="$CLAMSSERVER_DOCKER_DISK_SIZE_GB"

View File

@ -65,6 +65,10 @@ for PROJECT_CHAIN in ${DEPLOYMENT_STRING//,/ }; do
BTCPAYSERVER_BACKUP_DISK_SIZE_GB=30
BTCPAYSERVER_DOCKER_DISK_SIZE_GB=100
CLAMSSERVER_SSDATA_DISK_SIZE_GB=20
CLAMSSERVER_BACKUP_DISK_SIZE_GB=20
CLAMSSERVER_DOCKER_DISK_SIZE_GB=20
elif [ "$BITCOIN_CHAIN" = mainnet ]; then
WWW_SSDATA_DISK_SIZE_GB=40
@ -75,6 +79,10 @@ for PROJECT_CHAIN in ${DEPLOYMENT_STRING//,/ }; do
BTCPAYSERVER_BACKUP_DISK_SIZE_GB=30
BTCPAYSERVER_DOCKER_DISK_SIZE_GB=500
CLAMSSERVER_SSDATA_DISK_SIZE_GB=20
CLAMSSERVER_BACKUP_DISK_SIZE_GB=20
CLAMSSERVER_DOCKER_DISK_SIZE_GB=400
fi
export WWW_SSDATA_DISK_SIZE_GB="$WWW_SSDATA_DISK_SIZE_GB"

View File

@ -250,6 +250,11 @@ BTCPAYSERVER_MAC_ADDRESS=
# BTCPAY_SERVER_CPU_COUNT="4"
# BTCPAY_SERVER_MEMORY_MB="4096"
CLAMS_SERVER_MAC_ADDRESS=
# CLAMS_SERVER_CPU_COUNT="4"
# CLAMS_SERVER_MEMORY_MB="4096"
EOL
chmod 0744 "$PROJECT_DEFINITION_PATH"
@ -277,10 +282,9 @@ if [ -z "$BTCPAYSERVER_MAC_ADDRESS" ]; then
exit 1
fi
# the DOMAIN_LIST is a complete list of all our domains. We often iterate over this list.
DOMAIN_LIST="${PRIMARY_DOMAIN}"
if [ -n "$OTHER_SITES_LIST" ]; then
DOMAIN_LIST="${DOMAIN_LIST},${OTHER_SITES_LIST}"
if [ -z "$CLAMS_SERVER_MAC_ADDRESS" ]; then
echo "WARNING: the CLAMS_SERVER_MAC_ADDRESS is not specified. Check your project.conf."
fi
export DOMAIN_LIST="$DOMAIN_LIST"
@ -310,9 +314,10 @@ if ! lxc image list --format csv | grep -q "$DOCKER_BASE_IMAGE_NAME"; then
fi
fi
for VIRTUAL_MACHINE in www btcpayserver; do
for VIRTUAL_MACHINE in www btcpayserver clamsserver; do
if [ "$VIRTUAL_MACHINE" = btcpayserver ] && [ "$SKIP_BTCPAY" = true ]; then
if [ "$VIRTUAL_MACHINE" = clamsserver ] && [ -z "$CLAMS_SERVER_MAC_ADDRESS" ]; then
continue
fi
@ -375,10 +380,10 @@ for VIRTUAL_MACHINE in www btcpayserver; do
VPS_HOSTNAME="$WWW_HOSTNAME"
MAC_ADDRESS_TO_PROVISION="$WWW_SERVER_MAC_ADDRESS"
elif [ "$VIRTUAL_MACHINE" = btcpayserver ] || [ "$SKIP_BTCPAY" = true ]; then
FQDN="$BTCPAY_HOSTNAME.$DOMAIN_NAME"
VPS_HOSTNAME="$BTCPAY_HOSTNAME"
MAC_ADDRESS_TO_PROVISION="$BTCPAYSERVER_MAC_ADDRESS"
elif [ "$VIRTUAL_MACHINE" = clamsserver ] && [ -n "$CLAMS_SERVER_MAC_ADDRESS" ]; then
FQDN="$CLAMS_SERVER_HOSTNAME.$DOMAIN_NAME"
VPS_HOSTNAME="$CLAMS_SERVER_HOSTNAME"
MAC_ADDRESS_TO_PROVISION="$CLAMS_SERVER_MAC_ADDRESS"
elif [ "$VIRTUAL_MACHINE" = "$BASE_IMAGE_VM_NAME" ]; then
export FQDN="$BASE_IMAGE_VM_NAME"
@ -417,12 +422,26 @@ done
# now let's run the www and btcpay-specific provisioning scripts.
if [ "$SKIP_WWW" = false ]; then
./project/www/go.sh
if [ -n "$CLAMS_SERVER_MAC_ADDRESS" ]; then
export DOCKER_HOST="ssh://ubuntu@$CLAMS_SERVER_FQDN"
# enable docker swarm mode so we can support docker stacks.
if docker info | grep -q "Swarm: inactive"; then
docker swarm init
fi
export DOMAIN_NAME="$PRIMARY_DOMAIN"
export SITE_PATH="$SITES_PATH/$DOMAIN_NAME"
if [ "$SKIP_BTCPAY" = false ]; then
./project/btcpayserver/go.sh
# set the active env to our CLAMS_FQDN
cat >./project/clams-server/active_env.txt <<EOL
${CLAMS_SERVER_FQDN}
EOL
# and we have to set our environment file as well.
cat > ./project/clams-server/environments/"$CLAMS_SERVER_FQDN" <<EOL
DOCKER_HOST=ssh://ubuntu@$CLAMS_SERVER_FQDN
DOMAIN_NAME=${PRIMARY_DOMAIN}
ENABLE_TLS=true
CLN_COUNT=1
EOL
bash -c "./project/clams-server/up.sh -y"
fi