Compare commits

...

3 Commits

Author SHA1 Message Date
a458394ad8
Rename to site.conf 2023-03-13 14:43:23 -04:00
defe22876f
Update to site/project.conf 2023-03-13 14:38:27 -04:00
1cde881a27
Updated remote.conf 2023-03-13 14:00:36 -04:00
10 changed files with 50 additions and 53 deletions

View File

@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
set -e set -ex
cd "$(dirname "$0")" cd "$(dirname "$0")"
LATEST_GIT_COMMIT="$(cat ./.git/refs/heads/main)" 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" ln -s "$PROJECT_PATH" "$REMOTE_PATH/projects/$PROJECT_NAME"
fi fi
# check to see if the enf file exists. exist if not. # check to see if the enf file exists. exist if not.
PROJECT_DEFINITION_PATH="$PROJECT_PATH/project.conf" PROJECT_DEFINITION_PATH="$PROJECT_PATH/project_definition"
if [ ! -f "$PROJECT_DEFINITION_PATH" ]; then if [ ! -f "$PROJECT_DEFINITION_PATH" ]; then
# stub out a project.conf # stub out a project_definition
cat >"$PROJECT_DEFINITION_PATH" <<EOL cat >"$PROJECT_DEFINITION_PATH" <<EOL
# see https://www.sovereign-stack.org/ss-deploy for more info. #!/bin/bash
PRIMARY_DOMAIN=
# OTHER_SITES_LIST="domain1.tld,domain2.tld,domain3.tld"
WWW_SERVER_MAC_ADDRESS= WWW_SERVER_MAC_ADDRESS=
# WWW_SERVER_CPU_COUNT="6" # WWW_SERVER_CPU_COUNT="6"
@ -255,9 +252,9 @@ BTCPAYSERVER_MAC_ADDRESS=
EOL EOL
chmod 0744 "$PROJECT_DEFINITION_PATH" chmod 0744 "$PROJECT_DEFINITION_PATH"
echo "INFO: we stubbed a new 'project.conf' for you at '$PROJECT_DEFINITION_PATH'. Go update it!" 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/" echo "INFO: Learn more at https://www.sovereign-stack.org/ss-deploy/"
exit 1 exit 1
fi fi
@ -265,21 +262,21 @@ EOL
# source project defition. # source project defition.
source "$PROJECT_DEFINITION_PATH" source "$PROJECT_DEFINITION_PATH"
if [ -z "$PRIMARY_DOMAIN" ]; then if [ -z "$PRIMARY_DOMAIN" ]; then
echo "ERROR: The PRIMARY_DOMAIN is not specified. Check your 'project.conf'." echo "ERROR: The PRIMARY_DOMAIN is not specified. Check your project_definition."
exit 1 exit 1
fi fi
if [ -z "$WWW_SERVER_MAC_ADDRESS" ]; then if [ -z "$WWW_SERVER_MAC_ADDRESS" ]; then
echo "ERROR: the WWW_SERVER_MAC_ADDRESS is not specified. Check your 'project.conf'." echo "ERROR: the WWW_SERVER_MAC_ADDRESS is not specified. Check your project_definition."
exit 1 exit 1
fi fi
if [ -z "$BTCPAYSERVER_MAC_ADDRESS" ]; then if [ -z "$BTCPAYSERVER_MAC_ADDRESS" ]; then
echo "ERROR: the BTCPAYSERVER_MAC_ADDRESS is not specified. Check your 'project.conf'." echo "ERROR: the BTCPAYSERVER_MAC_ADDRESS is not specified. Check your project_definition."
exit 1 exit 1
fi fi
# the DOMAIN_LIST is a complete list of all our domains. We often iterate over this list. # the DOMAIN_LIST is a complete list of all our domains. We often iterate over this list.
DOMAIN_LIST="${PRIMARY_DOMAIN}" DOMAIN_LIST="${PRIMARY_DOMAIN}"
@ -318,14 +315,14 @@ EOL
export SITE_PATH="$SITES_PATH/$DOMAIN_NAME" export SITE_PATH="$SITES_PATH/$DOMAIN_NAME"
source "$SITE_PATH/site.conf" source "$SITE_PATH/site.conf"
source ./domain_env.sh source ./domain_env.sh
# VALIDATE THE INPUT from the ENVFILE # VALIDATE THE INPUT from the ENVFILE
if [ -z "$DOMAIN_NAME" ]; then if [ -z "$DOMAIN_NAME" ]; then
echo "ERROR: DOMAIN_NAME not specified in your site.conf." echo "ERROR: DOMAIN_NAME not specified in your site.conf."
exit 1 exit 1
fi fi
# create the lxc project as specified by PROJECT_NAME # create the lxc project as specified by PROJECT_NAME
if ! lxc project list | grep -q "$PROJECT_NAME"; then 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 the site path so we know what features it has.
source ../../../defaults.sh source ../../../defaults.sh
source "$SITE_PATH/site_definition" source "$SITE_PATH/site.conf"
source ../domain_env.sh source ../domain_env.sh
# with the lxd side, we are trying to expose ALL OUR services from one IP address, which terminates # 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 the site path so we know what features it has.
source ../../../defaults.sh source ../../../defaults.sh
source "$SITE_PATH/site_definition" source "$SITE_PATH/site.conf"
source ../domain_env.sh source ../domain_env.sh
### Let's check to ensure all the requiredsettings are set. ### Let's check to ensure all the requiredsettings are set.
if [ "$DEPLOY_GHOST" = true ]; then if [ "$DEPLOY_GHOST" = true ]; then
if [ -z "$GHOST_MYSQL_PASSWORD" ]; 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 exit 1
fi fi
if [ -z "$GHOST_MYSQL_ROOT_PASSWORD" ]; then 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 exit 1
fi fi
fi fi
if [ "$DEPLOY_GITEA" = true ]; then if [ "$DEPLOY_GITEA" = true ]; then
if [ -z "$GITEA_MYSQL_PASSWORD" ]; 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 exit 1
fi fi
if [ -z "$GITEA_MYSQL_ROOT_PASSWORD" ]; then 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 exit 1
fi fi
fi fi
if [ "$DEPLOY_NEXTCLOUD" = true ]; then if [ "$DEPLOY_NEXTCLOUD" = true ]; then
if [ -z "$NEXTCLOUD_MYSQL_ROOT_PASSWORD" ]; 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 exit 1
fi fi
if [ -z "$NEXTCLOUD_MYSQL_PASSWORD" ]; then 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 exit 1
fi fi
fi fi
if [ -z "$DUPLICITY_BACKUP_PASSPHRASE" ]; then 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 exit 1
fi fi
if [ -z "$DOMAIN_NAME" ]; then 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 exit 1
fi fi
@ -110,7 +110,7 @@ if [ "$RESTART_FRONT_END" = true ]; then
# source the site path so we know what features it has. # source the site path so we know what features it has.
source ../../../defaults.sh source ../../../defaults.sh
source "$SITE_PATH/site_definition" source "$SITE_PATH/site.conf"
source ../domain_env.sh source ../domain_env.sh
# these variable are used by both backup/restore scripts. # 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 the site path so we know what features it has.
source ../../../defaults.sh source ../../../defaults.sh
source "$SITE_PATH/site_definition" source "$SITE_PATH/site.conf"
source ../domain_env.sh source ../domain_env.sh
### Stop all services. ### 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 the site path so we know what features it has.
source ../../../../defaults.sh source ../../../../defaults.sh
source "$SITE_PATH/site_definition" source "$SITE_PATH/site.conf"
source ../../domain_env.sh 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 # at https://www.domain.com/$LANGUAGE_CODE
for LANGUAGE_CODE in ${SITE_LANGUAGE_CODES//,/ }; do 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 the site path so we know what features it has.
source ../../../../defaults.sh source ../../../../defaults.sh
source "$SITE_PATH/site_definition" source "$SITE_PATH/site.conf"
source ../../domain_env.sh source ../../domain_env.sh
if [ "$DEPLOY_GITEA" = true ]; then 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 the site path so we know what features it has.
source ../../../../defaults.sh source ../../../../defaults.sh
source "$SITE_PATH/site_definition" source "$SITE_PATH/site.conf"
source ../../domain_env.sh source ../../domain_env.sh
# ensure remote directories exist # 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 the site path so we know what features it has.
source ../../../../defaults.sh source ../../../../defaults.sh
source "$SITE_PATH/site_definition" source "$SITE_PATH/site.conf"
source ../../domain_env.sh source ../../domain_env.sh
if [ $iteration = 0 ]; then if [ $iteration = 0 ]; then

View File

@ -24,7 +24,7 @@ EOL
# source the site path so we know what features it has. # source the site path so we know what features it has.
source ../../../../defaults.sh source ../../../../defaults.sh
source "$SITE_PATH/site_definition" source "$SITE_PATH/site.conf"
source ../../domain_env.sh source ../../domain_env.sh
@ -97,10 +97,10 @@ EOL
# source the site path so we know what features it has. # source the site path so we know what features it has.
source ../../../../defaults.sh source ../../../../defaults.sh
source "$SITE_PATH/site_definition" source "$SITE_PATH/site.conf"
source ../../domain_env.sh 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 # at https://www.domain.com/$LANGUAGE_CODE
for LANGUAGE_CODE in ${SITE_LANGUAGE_CODES//,/ }; do for LANGUAGE_CODE in ${SITE_LANGUAGE_CODES//,/ }; do
cat >> "$DOCKER_YAML_PATH" <<EOL 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 the site path so we know what features it has.
source ../../../../defaults.sh source ../../../../defaults.sh
source "$SITE_PATH/site_definition" source "$SITE_PATH/site.conf"
source ../../domain_env.sh source ../../domain_env.sh
if [ -n "$NOSTR_ACCOUNT_PUBKEY" ]; then if [ -n "$NOSTR_ACCOUNT_PUBKEY" ]; then