1
1

Compare commits

..

No commits in common. "5dc7194a626e2f226d3e40499b74c8cb80c19463" and "2992f34092275f8fdecf4aa9cec41ac702eb2684" have entirely different histories.

7 changed files with 53 additions and 97 deletions

View File

@ -106,7 +106,7 @@ export PRIMARY_DOMAIN=
# this is the git commit of the project/ sub git repo. # this is the git commit of the project/ sub git repo.
# used in the migration script to switch into past for backup # used in the migration script to switch into past for backup
# then back to present (TARGET_PROJECT_GIT_COMMIT) for restore. # then back to present (TARGET_PROJECT_GIT_COMMIT) for restore.
export TARGET_PROJECT_GIT_COMMIT=c2f3612beeb5a386545596fdc3e734b20048013d export TARGET_PROJECT_GIT_COMMIT=bc4ac89c19e20c86a8376563a0dfe5a314ea4b0c
# #
export TESTNET_BLOCK_HASH=00000000d8277ba1ca66b40b3e3476629e6f0f97c5b8cfaeabfe402e55db223a export TESTNET_BLOCK_HASH=00000000d8277ba1ca66b40b3e3476629e6f0f97c5b8cfaeabfe402e55db223a

View File

@ -10,7 +10,7 @@ if lxc remote get-default | grep -q "local"; then
exit 1 exit 1
fi fi
echo "WARNING: This will DESTROY any existing VMs! Use the --purge flag to delete ALL Sovereign Stack LXD resources." echo "WARNING: This will DESTROY any existing VMs!"
RESPONSE= RESPONSE=
read -r -p "Are you sure you want to continue (y/n): ": RESPONSE read -r -p "Are you sure you want to continue (y/n): ": RESPONSE

View File

@ -2,8 +2,7 @@
You are in the Sovereign Stack Management Environment (SSME). From here, you can issue several commands: You are in the Sovereign Stack Management Environment (SSME). From here, you can issue several commands:
ss-remote - Take a remote SSH endpoint under management of Sovereign Stack. ss-remote - Take a remote SSH endpoint under management of Sovereign Stack.
ss-deploy - Deploys Sovereign Stack instances to your currenty remote according to your ss-deploy - Creates a deployment to your active LXD remote.
various remote.conf, project.conf, and site.conf files.
ss-show - show the lxd resources associated with the current remote. ss-show - show the lxd resources associated with the current remote.
ss-update - brings an existing deployment up to the newest version of Sovereign Stack. ss-update - brings an existing deployment up to the newest version of Sovereign Stack.
ss-destroy - Destroys the active deployment (WARNING: destructive). ss-destroy - Destroys the active deployment (WARNING: destructive).

View File

@ -239,6 +239,7 @@ if ! lxc storage list --format csv | grep -q ss-base; then
# on top of the existing filesystem using a loop device, per LXD docs # on top of the existing filesystem using a loop device, per LXD docs
lxc storage create ss-base zfs lxc storage create ss-base zfs
fi fi
fi
# create the testnet/mainnet blocks/chainstate subvolumes. # create the testnet/mainnet blocks/chainstate subvolumes.
for CHAIN in mainnet testnet; do for CHAIN in mainnet testnet; do
@ -248,7 +249,3 @@ if ! lxc storage list --format csv | grep -q ss-base; then
fi fi
done done
done done
else
echo "WARNING! The host '$FQDN' appears to have Sovereign Stack worksloads already provisioned. Proceed with care."
fi

View File

@ -4,23 +4,6 @@
set -e set -e
cd "$(dirname "$0")" cd "$(dirname "$0")"
PURGE_LXD=false
# grab any modifications from the command line.
for i in "$@"; do
case $i in
--purge)
PURGE_LXD=true
shift
;;
*)
echo "Unexpected option: $1"
exit 1
;;
esac
done
source ../defaults.sh source ../defaults.sh
./destroy.sh ./destroy.sh
@ -44,9 +27,6 @@ if ! lxc info | grep -q "project: default"; then
lxc project delete "$CURRENT_PROJECT" lxc project delete "$CURRENT_PROJECT"
fi fi
if [ "$PURGE_LXD" = true ]; then
if lxc profile show default | grep -q "root:"; then if lxc profile show default | grep -q "root:"; then
lxc profile device remove default root lxc profile device remove default root
fi fi
@ -83,4 +63,3 @@ if [ "$PURGE_LXD" = true ]; then
echo "INFO: The remote '$CURRENT_REMOTE' has been removed! You are now controlling your local instance." echo "INFO: The remote '$CURRENT_REMOTE' has been removed! You are now controlling your local instance."
fi fi
fi

View File

@ -17,6 +17,9 @@ fi
# lxd resources. By default, we provision the disk under / as a loop device. Admin # lxd resources. By default, we provision the disk under / as a loop device. Admin
# can override with CLI modifications. # can override with CLI modifications.
DISK="rpool/lxd" DISK="rpool/lxd"
#DISK="/dev/sda1"
export DISK="$DISK" export DISK="$DISK"
# let's check to ensure the management machine is on the Baseline ubuntu # let's check to ensure the management machine is on the Baseline ubuntu
@ -93,44 +96,24 @@ if ! lxc list --format csv | grep -q ss-mgmt; then
lxc init "images:$BASE_LXC_IMAGE" ss-mgmt --vm -c limits.cpu=4 -c limits.memory=4GiB --profile=default lxc init "images:$BASE_LXC_IMAGE" ss-mgmt --vm -c limits.cpu=4 -c limits.memory=4GiB --profile=default
# mount the pre-verified sovereign stack git repo into the new vm # mount the pre-verified sovereign stack git repo into the new vm
lxc config device add ss-mgmt ss-code disk source="$(pwd)" path=/home/ubuntu/sovereign-stack lxc config device add ss-mgmt sscode disk source="$(pwd)" path=/home/ubuntu/sovereign-stack
# if the System Owner has a ~/.ss directory, then we'll mount it into the vm # if the System Owner has a ~/.ss directory, then we'll mount it into the vm
# this allows the data to persist across ss-mgmt vms; ie. install/uninstall # this allows the data to persist across ss-mgmt vms; ie. install/uninstall
if [ -d "$SS_ROOT_PATH" ]; then if [ -d "$SS_ROOT_PATH" ]; then
lxc config device add ss-mgmt ss-root disk source="$SS_ROOT_PATH" path=/home/ubuntu/.ss lxc config device add ss-mgmt ssroot disk source="$SS_ROOT_PATH" path=/home/ubuntu/.ss
fi fi
# if a ~/.bitcoin/testnet3/blocks direrectory exists, mount it in. # if a ~/.bitcoin/testnet3/blocks direrectory exists, mount it in.
BITCOIN_DIR="$HOME/.bitcoin" BITCOIN_TESTNET_BLOCKS_PATH="$HOME/.bitcoin/testnet3/blocks"
REMOTE_BITCOIN_CACHE_PATH="/home/ubuntu/.ss/cache/bitcoin"
BITCOIN_TESTNET_BLOCKS_PATH="$BITCOIN_DIR/testnet3/blocks"
if [ -d "$BITCOIN_TESTNET_BLOCKS_PATH" ]; then if [ -d "$BITCOIN_TESTNET_BLOCKS_PATH" ]; then
lxc config device add ss-mgmt ss-testnet-blocks disk source="$BITCOIN_TESTNET_BLOCKS_PATH" path=$REMOTE_BITCOIN_CACHE_PATH/testnet/blocks lxc config device add ss-mgmt ss-testnet-blocks disk source="$BITCOIN_TESTNET_BLOCKS_PATH" path=/home/ubuntu/.ss/cache/bitcoin/testnet/blocks
fi fi
# if a ~/.bitcoin/testnet3/blocks direrectory exists, mount it in. # if a ~/.bitcoin/testnet3/blocks direrectory exists, mount it in.
BITCOIN_TESTNET_CHAINSTATE_PATH="$BITCOIN_DIR/testnet3/chainstate" BITCOIN_TESTNET_CHAINSTATE_PATH="$HOME/.bitcoin/testnet3/chainstate"
if [ -d "$BITCOIN_TESTNET_CHAINSTATE_PATH" ]; then if [ -d "$BITCOIN_TESTNET_CHAINSTATE_PATH" ]; then
lxc config device add ss-mgmt ss-testnet-chainstate disk source="$BITCOIN_TESTNET_CHAINSTATE_PATH" path=$REMOTE_BITCOIN_CACHE_PATH/testnet/chainstate lxc config device add ss-mgmt ss-testnet-chainstate disk source="$BITCOIN_TESTNET_CHAINSTATE_PATH" path=/home/ubuntu/.ss/cache/bitcoin/testnet/chainstate
fi
# if a ~/.bitcoin/blocks dir exists, mount it in.
BITCOIN_MAINNET_BLOCKS_PATH="$BITCOIN_DIR/blocks"
if [ -d "$BITCOIN_MAINNET_BLOCKS_PATH" ]; then
lxc config device add ss-mgmt ss-mainnet-blocks disk source="$BITCOIN_MAINNET_BLOCKS_PATH" path=$REMOTE_BITCOIN_CACHE_PATH/mainnet/blocks
else
echo "WARNING: the blocks directory was not found for mainnet. It will NOT be mounted into ss-mgmt."
exit 1
fi
# if a ~/.bitcoin/testnet3/blocks direrectory exists, mount it in.
BITCOIN_MAINNET_CHAINSTATE_PATH="$BITCOIN_DIR/chainstate"
if [ -d "$BITCOIN_MAINNET_CHAINSTATE_PATH" ]; then
lxc config device add ss-mgmt ss-mainnet-chainstate disk source="$BITCOIN_MAINNET_CHAINSTATE_PATH" path=$REMOTE_BITCOIN_CACHE_PATH/mainnet/chainstate
else
echo "WARNING: the chainstate directory was not found for mainnet. It will NOT be mounted into ss-mgmt."
exit 1
fi fi
# mount the ssh directory in there. # mount the ssh directory in there.

View File

@ -32,15 +32,13 @@ if lxc list --format csv | grep -q "ss-mgmt"; then
lxc stop ss-mgmt lxc stop ss-mgmt
fi fi
if lxc config device list ss-mgmt -q | grep -q "ss-code"; then lxc config device remove ss-mgmt sscode
lxc config device remove ss-mgmt ss-code
if [ -d "$SS_ROOT_PATH" ]; then
lxc config device remove ss-mgmt ssroot
fi fi
if lxc config device list ss-mgmt -q | grep -q "ss-root"; then if [ -d "$HOME/.ssh" ]; then
lxc config device remove ss-mgmt ss-root
fi
if lxc config device list ss-mgmt -q | grep -q "ss-ssh"; then
lxc config device remove ss-mgmt ss-ssh lxc config device remove ss-mgmt ss-ssh
fi fi