1
1
Fork 1

Updates Undo

This commit is contained in:
Derek Smith 2023-11-30 16:34:44 -05:00
parent 3004a167c8
commit 7512cbfd90
Signed by: farscapian
GPG Key ID: B443E530A14E1C90
6 changed files with 23 additions and 38 deletions

View File

@ -54,3 +54,4 @@ export WWW_SERVER_MEMORY_MB="4096"
export LNPLAY_SERVER_CPU_COUNT="4"
export LNPLAY_SERVER_MEMORY_MB="4096"
export DOCKER_IMAGE_CACHE_FQDN="registry-1.docker.io"

@ -1 +1 @@
Subproject commit 52239974d4c339c34e553e2aff6678456194682c
Subproject commit 0f9f564b82862982d2726c8e8b016274e53e30aa

View File

@ -10,10 +10,7 @@ if [ "$PROJECT_NAME" = default ]; then
exit 1
fi
BITCOIN_CHAIN=$(echo "$PROJECT_NAME" | cut -d'-' -f2)
export PROJECT_PATH="$PROJECTS_PATH/$PROJECT_NAME"
export BITCOIN_CHAIN="$BITCOIN_CHAIN"
PROJECT_DEFINITION_PATH="$PROJECT_PATH/project.conf"

View File

@ -1,6 +1,6 @@
#!/bin/bash
set -e
set -exu
cd "$(dirname "$0")"
# This script is meant to be executed on the management machine.
@ -139,9 +139,10 @@ fi
# install dependencies.
ssh -t "ubuntu@$FQDN" 'sudo apt update && sudo apt upgrade -y && sudo apt install htop dnsutils nano -y'
scp ../install_incus.sh "ubuntu@$FQDN:$REMOTE_DATA_PATH/install_incus.sh"
ssh -t "ubuntu@$FQDN" "sudo chmod +x $REMOTE_DATA_PATH/install_incus.sh"
ssh -t "ubuntu@$FQDN" "sudo bash -c $REMOTE_DATA_PATH/install_incus.sh"
REMOTE_SCRIPT_PATH="$REMOTE_HOME/install_incus.sh"
scp ../install_incus.sh "ubuntu@$FQDN:$REMOTE_SCRIPT_PATH"
ssh -t "ubuntu@$FQDN" "chmod +x $REMOTE_SCRIPT_PATH"
ssh -t "ubuntu@$FQDN" "sudo bash -c $REMOTE_SCRIPT_PATH"
# install OVN for the project-specific bridge networks
ssh -t "ubuntu@$FQDN" "sudo apt-get install -y ovn-host ovn-central && sudo ovs-vsctl set open_vswitch . external_ids:ovn-remote=unix:/var/run/ovn/ovnsb_db.sock external_ids:ovn-encap-type=geneve external_ids:ovn-encap-ip=127.0.0.1"
@ -193,23 +194,16 @@ profiles:
pool: ss-base
type: disk
name: default
cluster:
server_name: ${REMOTE_NAME}
enabled: true
member_config: []
cluster_address: ""
cluster_certificate: ""
server_address: ""
cluster_password: ""
cluster_certificate_path: ""
cluster_token: ""
EOF
# ensure the incus service is available over the network, then add a incus remote, then switch the active remote to it.
if wait-for-it -t 20 "$FQDN:8443"; then
# before we add the remote, we need a trust token from the incus server
INCUS_CERT_TRUST_TOKEN=$(ssh ubuntu@"$FQDN" incus config trust add ss-mgmt | tail -n 1)
# now create a remote on your local incus client and switch to it.
# the software will now target the new remote.
incus remote add "$REMOTE_NAME" "$FQDN" --auth-type=tls --accept-certificate
incus remote add "$REMOTE_NAME" "$FQDN" --auth-type=tls --accept-certificate --token="$INCUS_CERT_TRUST_TOKEN"
incus remote switch "$REMOTE_NAME"
echo "INFO: A new remote named '$REMOTE_NAME' has been created. Your incus client has been switched to it."

View File

@ -3,6 +3,17 @@
set -eu
CURRENT_REMOTE="$(incus remote get-default)"
DEPLOYMENT_STRING=
SS_ROOT_PATH="$HOME/ss"
REMOTES_PATH="$SS_ROOT_PATH/remotes"
PROJECTS_PATH="$SS_ROOT_PATH/projects"
SITES_PATH="$SS_ROOT_PATH/sites"
INCUS_CONFIG_PATH="$SS_ROOT_PATH/incus"
SS_CACHE_PATH="$SS_ROOT_PATH/cache"
if echo "$CURRENT_REMOTE" | grep -q "production"; then
echo "WARNING: You are running a migration procedure on a production system."
@ -40,24 +51,6 @@ fi
source "$REMOTE_DEFINITION"
# let's provision the projects if specified in the remote.conf file.
# we assume projects are created EXTERNALLY to sovereign-stack when DEPLOYMENT_STRING is null.
if [ -n "$DEPLOYMENT_STRING" ]; then
# ensure our projects are provisioned according to DEPLOYMENT_STRING
for PROJECT_CHAIN in ${DEPLOYMENT_STRING//,/ }; do
NO_PARENS="${PROJECT_CHAIN:1:${#PROJECT_CHAIN}-2}"
PROJECT_PREFIX=$(echo "$NO_PARENS" | cut -d'|' -f1)
BITCOIN_CHAIN=$(echo "$NO_PARENS" | cut -d'|' -f2)
PROJECT_NAME="$PROJECT_PREFIX-$BITCOIN_CHAIN"
# create the incus project as specified by PROJECT_NAME
if ! incus project list | grep -q "$PROJECT_NAME"; then
incus project create "$PROJECT_NAME"
incus project set "$PROJECT_NAME" features.networks=true features.images=false features.storage.volumes=true
incus project switch "$PROJECT_NAME"
fi
done
fi
# default values are already at regtest mode.
if [ "$BITCOIN_CHAIN" = testnet ]; then

View File

@ -20,7 +20,7 @@ for i in "$@"; do
esac
done
source ../defaults.sh
source ../defaults.env
./down.sh