Compare commits
No commits in common. "5dc7194a626e2f226d3e40499b74c8cb80c19463" and "2992f34092275f8fdecf4aa9cec41ac702eb2684" have entirely different histories.
5dc7194a62
...
2992f34092
@ -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
|
||||||
|
@ -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
|
||||||
|
@ -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).
|
||||||
|
@ -239,16 +239,13 @@ 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
|
||||||
for DATA in blocks chainstate; do
|
for DATA in blocks chainstate; do
|
||||||
if ! lxc storage volume list ss-base | grep -q "$CHAIN-$DATA"; then
|
if ! lxc storage volume list ss-base | grep -q "$CHAIN-$DATA"; then
|
||||||
lxc storage volume create ss-base "$CHAIN-$DATA" --type=filesystem
|
lxc storage volume create ss-base "$CHAIN-$DATA" --type=filesystem
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
done
|
done
|
||||||
|
|
||||||
else
|
|
||||||
echo "WARNING! The host '$FQDN' appears to have Sovereign Stack worksloads already provisioned. Proceed with care."
|
|
||||||
fi
|
|
||||||
|
@ -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,43 +27,39 @@ if ! lxc info | grep -q "project: default"; then
|
|||||||
lxc project delete "$CURRENT_PROJECT"
|
lxc project delete "$CURRENT_PROJECT"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if lxc profile show default | grep -q "root:"; then
|
||||||
if [ "$PURGE_LXD" = true ]; then
|
|
||||||
|
|
||||||
if lxc profile show default | grep -q "root:"; then
|
|
||||||
lxc profile device remove default root
|
lxc profile device remove default root
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if lxc profile show default| grep -q "eth0:"; then
|
if lxc profile show default| grep -q "eth0:"; then
|
||||||
lxc profile device remove default eth0
|
lxc profile device remove default eth0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if lxc network list --format csv | grep -q lxdbr0; then
|
if lxc network list --format csv | grep -q lxdbr0; then
|
||||||
lxc network delete lxdbr0
|
lxc network delete lxdbr0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if lxc network list --format csv | grep -q lxdbr1; then
|
if lxc network list --format csv | grep -q lxdbr1; then
|
||||||
lxc network delete lxdbr1
|
lxc network delete lxdbr1
|
||||||
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
|
||||||
for DATA in blocks chainstate; do
|
for DATA in blocks chainstate; do
|
||||||
if lxc storage volume list ss-base | grep -q "$CHAIN-$DATA"; then
|
if lxc storage volume list ss-base | grep -q "$CHAIN-$DATA"; then
|
||||||
lxc storage volume delete ss-base "$CHAIN-$DATA"
|
lxc storage volume delete ss-base "$CHAIN-$DATA"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
done
|
done
|
||||||
|
|
||||||
if lxc storage list --format csv | grep -q ss-base; then
|
if lxc storage list --format csv | grep -q ss-base; then
|
||||||
lxc storage delete ss-base
|
lxc storage delete ss-base
|
||||||
fi
|
fi
|
||||||
|
|
||||||
CURRENT_REMOTE="$(lxc remote get-default)"
|
CURRENT_REMOTE="$(lxc remote get-default)"
|
||||||
if ! lxc remote get-default | grep -q "local"; then
|
if ! lxc remote get-default | grep -q "local"; then
|
||||||
lxc remote switch local
|
lxc remote switch local
|
||||||
lxc remote remove "$CURRENT_REMOTE"
|
lxc remote remove "$CURRENT_REMOTE"
|
||||||
|
|
||||||
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
|
35
install.sh
35
install.sh
@ -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.
|
||||||
|
12
uninstall.sh
12
uninstall.sh
@ -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
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user