Rename to site.conf

This commit is contained in:
Derek Smith 2023-03-13 14:43:23 -04:00
commit a458394ad8
Signed by: farscapian
GPG Key ID: B443E530A14E1C90
10 changed files with 50 additions and 53 deletions

View File

@ -1,6 +1,6 @@
#!/bin/bash
set -e
set -ex
cd "$(dirname "$0")"
LATEST_GIT_COMMIT="$(cat ./.git/refs/heads/main)"
@ -234,16 +234,13 @@ for PROJECT_CHAIN in ${DEPLOYMENT_STRING//,/ }; do
ln -s "$PROJECT_PATH" "$REMOTE_PATH/projects/$PROJECT_NAME"
fi
# check to see if the enf file exists. exist if not.
PROJECT_DEFINITION_PATH="$PROJECT_PATH/project.conf"
if [ ! -f "$PROJECT_DEFINITION_PATH" ]; then
# check to see if the enf file exists. exist if not.
PROJECT_DEFINITION_PATH="$PROJECT_PATH/project_definition"
if [ ! -f "$PROJECT_DEFINITION_PATH" ]; then
# stub out a project.conf
cat >"$PROJECT_DEFINITION_PATH" <<EOL
# see https://www.sovereign-stack.org/ss-deploy for more info.
PRIMARY_DOMAIN=
# OTHER_SITES_LIST="domain1.tld,domain2.tld,domain3.tld"
# stub out a project_definition
cat >"$PROJECT_DEFINITION_PATH" <<EOL
#!/bin/bash
WWW_SERVER_MAC_ADDRESS=
# WWW_SERVER_CPU_COUNT="6"
@ -255,9 +252,9 @@ BTCPAYSERVER_MAC_ADDRESS=
EOL
chmod 0744 "$PROJECT_DEFINITION_PATH"
echo "INFO: we stubbed a new 'project.conf' for you at '$PROJECT_DEFINITION_PATH'. Go update it!"
echo "INFO: Learn more at https://www.sovereign-stack.org/ss-deploy/"
chmod 0744 "$PROJECT_DEFINITION_PATH"
echo "INFO: we stubbed a new project_defition for you at '$PROJECT_DEFINITION_PATH'. Go update it!"
echo "INFO: Learn more at https://www.sovereign-stack.org/ss-deploy/"
exit 1
fi
@ -265,21 +262,21 @@ EOL
# source project defition.
source "$PROJECT_DEFINITION_PATH"
if [ -z "$PRIMARY_DOMAIN" ]; then
echo "ERROR: The PRIMARY_DOMAIN is not specified. Check your 'project.conf'."
exit 1
fi
if [ -z "$PRIMARY_DOMAIN" ]; then
echo "ERROR: The PRIMARY_DOMAIN is not specified. Check your project_definition."
exit 1
fi
if [ -z "$WWW_SERVER_MAC_ADDRESS" ]; then
echo "ERROR: the WWW_SERVER_MAC_ADDRESS is not specified. Check your 'project.conf'."
exit 1
fi
if [ -z "$WWW_SERVER_MAC_ADDRESS" ]; then
echo "ERROR: the WWW_SERVER_MAC_ADDRESS is not specified. Check your project_definition."
exit 1
fi
if [ -z "$BTCPAYSERVER_MAC_ADDRESS" ]; then
echo "ERROR: the BTCPAYSERVER_MAC_ADDRESS is not specified. Check your 'project.conf'."
exit 1
fi
if [ -z "$BTCPAYSERVER_MAC_ADDRESS" ]; then
echo "ERROR: the BTCPAYSERVER_MAC_ADDRESS is not specified. Check your project_definition."
exit 1
fi
# the DOMAIN_LIST is a complete list of all our domains. We often iterate over this list.
DOMAIN_LIST="${PRIMARY_DOMAIN}"
@ -318,14 +315,14 @@ EOL
export SITE_PATH="$SITES_PATH/$DOMAIN_NAME"
source "$SITE_PATH/site.conf"
source ./domain_env.sh
source "$SITE_PATH/site.conf"
source ./domain_env.sh
# VALIDATE THE INPUT from the ENVFILE
if [ -z "$DOMAIN_NAME" ]; then
echo "ERROR: DOMAIN_NAME not specified in your site.conf."
exit 1
fi
# VALIDATE THE INPUT from the ENVFILE
if [ -z "$DOMAIN_NAME" ]; then
echo "ERROR: DOMAIN_NAME not specified in your site.conf."
exit 1
fi
# create the lxc project as specified by PROJECT_NAME
if ! lxc project list | grep -q "$PROJECT_NAME"; then

View File

@ -12,7 +12,7 @@ for DOMAIN_NAME in ${DOMAIN_LIST//,/ }; do
# source the site path so we know what features it has.
source ../../../defaults.sh
source "$SITE_PATH/site_definition"
source "$SITE_PATH/site.conf"
source ../domain_env.sh
# with the lxd side, we are trying to expose ALL OUR services from one IP address, which terminates

View File

@ -19,52 +19,52 @@ for DOMAIN_NAME in ${DOMAIN_LIST//,/ }; do
# source the site path so we know what features it has.
source ../../../defaults.sh
source "$SITE_PATH/site_definition"
source "$SITE_PATH/site.conf"
source ../domain_env.sh
### Let's check to ensure all the requiredsettings are set.
if [ "$DEPLOY_GHOST" = true ]; then
if [ -z "$GHOST_MYSQL_PASSWORD" ]; then
echo "ERROR: Ensure GHOST_MYSQL_PASSWORD is configured in your site_definition."
echo "ERROR: Ensure GHOST_MYSQL_PASSWORD is configured in your site.conf."
exit 1
fi
if [ -z "$GHOST_MYSQL_ROOT_PASSWORD" ]; then
echo "ERROR: Ensure GHOST_MYSQL_ROOT_PASSWORD is configured in your site_definition."
echo "ERROR: Ensure GHOST_MYSQL_ROOT_PASSWORD is configured in your site.conf."
exit 1
fi
fi
if [ "$DEPLOY_GITEA" = true ]; then
if [ -z "$GITEA_MYSQL_PASSWORD" ]; then
echo "ERROR: Ensure GITEA_MYSQL_PASSWORD is configured in your site_definition."
echo "ERROR: Ensure GITEA_MYSQL_PASSWORD is configured in your site.conf."
exit 1
fi
if [ -z "$GITEA_MYSQL_ROOT_PASSWORD" ]; then
echo "ERROR: Ensure GITEA_MYSQL_ROOT_PASSWORD is configured in your site_definition."
echo "ERROR: Ensure GITEA_MYSQL_ROOT_PASSWORD is configured in your site.conf."
exit 1
fi
fi
if [ "$DEPLOY_NEXTCLOUD" = true ]; then
if [ -z "$NEXTCLOUD_MYSQL_ROOT_PASSWORD" ]; then
echo "ERROR: Ensure NEXTCLOUD_MYSQL_ROOT_PASSWORD is configured in your site_definition."
echo "ERROR: Ensure NEXTCLOUD_MYSQL_ROOT_PASSWORD is configured in your site.conf."
exit 1
fi
if [ -z "$NEXTCLOUD_MYSQL_PASSWORD" ]; then
echo "ERROR: Ensure NEXTCLOUD_MYSQL_PASSWORD is configured in your site_definition."
echo "ERROR: Ensure NEXTCLOUD_MYSQL_PASSWORD is configured in your site.conf."
exit 1
fi
fi
if [ -z "$DUPLICITY_BACKUP_PASSPHRASE" ]; then
echo "ERROR: Ensure DUPLICITY_BACKUP_PASSPHRASE is configured in your site_definition."
echo "ERROR: Ensure DUPLICITY_BACKUP_PASSPHRASE is configured in your site.conf."
exit 1
fi
if [ -z "$DOMAIN_NAME" ]; then
echo "ERROR: Ensure DOMAIN_NAME is configured in your site_definition."
echo "ERROR: Ensure DOMAIN_NAME is configured in your site.conf."
exit 1
fi
@ -110,7 +110,7 @@ if [ "$RESTART_FRONT_END" = true ]; then
# source the site path so we know what features it has.
source ../../../defaults.sh
source "$SITE_PATH/site_definition"
source "$SITE_PATH/site.conf"
source ../domain_env.sh
# these variable are used by both backup/restore scripts.

View File

@ -10,7 +10,7 @@ for DOMAIN_NAME in ${DOMAIN_LIST//,/ }; do
# source the site path so we know what features it has.
source ../../../defaults.sh
source "$SITE_PATH/site_definition"
source "$SITE_PATH/site.conf"
source ../domain_env.sh
### Stop all services.

View File

@ -9,10 +9,10 @@ for DOMAIN_NAME in ${DOMAIN_LIST//,/ }; do
# source the site path so we know what features it has.
source ../../../../defaults.sh
source "$SITE_PATH/site_definition"
source "$SITE_PATH/site.conf"
source ../../domain_env.sh
# for each language specified in the site_definition, we spawn a separate ghost container
# for each language specified in the site.conf, we spawn a separate ghost container
# at https://www.domain.com/$LANGUAGE_CODE
for LANGUAGE_CODE in ${SITE_LANGUAGE_CODES//,/ }; do

View File

@ -9,7 +9,7 @@ for DOMAIN_NAME in ${DOMAIN_LIST//,/ }; do
# source the site path so we know what features it has.
source ../../../../defaults.sh
source "$SITE_PATH/site_definition"
source "$SITE_PATH/site.conf"
source ../../domain_env.sh
if [ "$DEPLOY_GITEA" = true ]; then

View File

@ -9,7 +9,7 @@ for DOMAIN_NAME in ${DOMAIN_LIST//,/ }; do
# source the site path so we know what features it has.
source ../../../../defaults.sh
source "$SITE_PATH/site_definition"
source "$SITE_PATH/site.conf"
source ../../domain_env.sh
# ensure remote directories exist

View File

@ -19,7 +19,7 @@ for DOMAIN_NAME in ${DOMAIN_LIST//,/ }; do
# source the site path so we know what features it has.
source ../../../../defaults.sh
source "$SITE_PATH/site_definition"
source "$SITE_PATH/site.conf"
source ../../domain_env.sh
if [ $iteration = 0 ]; then

View File

@ -24,7 +24,7 @@ EOL
# source the site path so we know what features it has.
source ../../../../defaults.sh
source "$SITE_PATH/site_definition"
source "$SITE_PATH/site.conf"
source ../../domain_env.sh
@ -97,10 +97,10 @@ EOL
# source the site path so we know what features it has.
source ../../../../defaults.sh
source "$SITE_PATH/site_definition"
source "$SITE_PATH/site.conf"
source ../../domain_env.sh
# for each language specified in the site_definition, we spawn a separate ghost container
# for each language specified in the site.conf, we spawn a separate ghost container
# at https://www.domain.com/$LANGUAGE_CODE
for LANGUAGE_CODE in ${SITE_LANGUAGE_CODES//,/ }; do
cat >> "$DOCKER_YAML_PATH" <<EOL

View File

@ -11,7 +11,7 @@ for DOMAIN_NAME in ${DOMAIN_LIST//,/ }; do
# source the site path so we know what features it has.
source ../../../../defaults.sh
source "$SITE_PATH/site_definition"
source "$SITE_PATH/site.conf"
source ../../domain_env.sh
if [ -n "$NOSTR_ACCOUNT_PUBKEY" ]; then