2023-03-05 16:45:27 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -eu
|
2023-04-04 15:32:54 +00:00
|
|
|
|
2023-09-22 23:46:07 +00:00
|
|
|
PROJECT_NAME="$(incus info | grep "project:" | awk '{print $2}')"
|
2023-04-04 20:25:58 +00:00
|
|
|
export PROJECT_NAME="$PROJECT_NAME"
|
2023-04-04 15:32:54 +00:00
|
|
|
|
|
|
|
if [ "$PROJECT_NAME" = default ]; then
|
2023-09-22 23:46:07 +00:00
|
|
|
echo "ERROR: You are on the default project. Use 'incus project list' and 'incus project switch <project>'."
|
2023-04-04 15:32:54 +00:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
BITCOIN_CHAIN=$(echo "$PROJECT_NAME" | cut -d'-' -f2)
|
|
|
|
|
|
|
|
export PROJECT_PATH="$PROJECTS_PATH/$PROJECT_NAME"
|
|
|
|
export BITCOIN_CHAIN="$BITCOIN_CHAIN"
|
2023-03-05 16:45:27 +00:00
|
|
|
|
2023-03-13 17:40:47 +00:00
|
|
|
PROJECT_DEFINITION_PATH="$PROJECT_PATH/project.conf"
|
2023-03-05 16:45:27 +00:00
|
|
|
|
|
|
|
if [ ! -f "$PROJECT_DEFINITION_PATH" ]; then
|
2023-03-13 17:40:47 +00:00
|
|
|
echo "ERROR: 'project.conf' not found $PROJECT_DEFINITION_PATH not found."
|
2023-03-05 16:45:27 +00:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
source "$PROJECT_DEFINITION_PATH"
|
2023-03-13 17:54:29 +00:00
|
|
|
|
2023-04-07 14:41:18 +00:00
|
|
|
|
2023-03-13 17:54:29 +00:00
|
|
|
export PRIMARY_SITE_DEFINITION_PATH="$SITES_PATH/$PRIMARY_DOMAIN/site.conf"
|
2023-03-11 16:12:19 +00:00
|
|
|
|
2023-03-05 16:45:27 +00:00
|
|
|
if [ -z "$PRIMARY_DOMAIN" ]; then
|
2023-03-11 03:40:50 +00:00
|
|
|
echo "ERROR: The PRIMARY_DOMAIN is not specified. Check your remote definition at '$PRIMARY_SITE_DEFINITION_PATH'."
|
2023-03-05 16:45:27 +00:00
|
|
|
exit 1
|
|
|
|
fi
|
2023-03-11 16:12:19 +00:00
|
|
|
|
2023-03-30 15:10:42 +00:00
|
|
|
SHASUM_OF_PRIMARY_DOMAIN="$(echo -n "$PRIMARY_DOMAIN" | sha256sum | awk '{print $1;}' )"
|
|
|
|
export PRIMARY_DOMAIN_IDENTIFIER="${SHASUM_OF_PRIMARY_DOMAIN: -6}"
|
2023-04-04 15:31:24 +00:00
|
|
|
|
|
|
|
export WWW_SSDATA_DISK_SIZE_GB="$WWW_SSDATA_DISK_SIZE_GB"
|
|
|
|
export WWW_BACKUP_DISK_SIZE_GB="$WWW_BACKUP_DISK_SIZE_GB"
|
|
|
|
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"
|
2023-08-11 13:46:08 +00:00
|
|
|
|
2023-09-06 02:01:57 +00:00
|
|
|
export LNPLAY_SERVER_SSDATA_DISK_SIZE_GB="$LNPLAY_SERVER_SSDATA_DISK_SIZE_GB"
|
|
|
|
export LNPLAY_SERVER_BACKUP_DISK_SIZE_GB="$LNPLAY_SERVER_BACKUP_DISK_SIZE_GB"
|
|
|
|
export LNPLAY_SSERVER_DOCKER_DISK_SIZE_GB="$LNPLAY_SSERVER_DOCKER_DISK_SIZE_GB"
|