1
1

Compare commits

...

4 Commits

Author SHA1 Message Date
5dd4de442d
Fix mac address defaults. 2023-12-17 16:51:21 -05:00
7abf79e0a7
Spawn lnplay from image if exists. 2023-12-17 16:50:41 -05:00
56916a7d33
Nitpicks 2023-12-17 16:50:24 -05:00
c4183a0b63
Install urlencode in ss-mgmt. 2023-12-17 16:49:54 -05:00
4 changed files with 25 additions and 30 deletions

View File

@ -63,8 +63,6 @@ if ! incus list --format csv | grep -q "$INCUS_VM_NAME"; then
incus storage volume set ss-base "$DOCKER_VOLUME_NAME" size="${DOCKER_DISK_SIZE_GB}GB"
fi
SSDATA_VOLUME_NAME="$VIRTUAL_MACHINE-ss-data"
if ! incus storage volume list ss-base | grep -q "$SSDATA_VOLUME_NAME"; then
incus storage volume create ss-base "$SSDATA_VOLUME_NAME" --type=filesystem
@ -82,9 +80,11 @@ if ! incus list --format csv | grep -q "$INCUS_VM_NAME"; then
bash -c "./stub_profile.sh --vm=$VIRTUAL_MACHINE --incus-hostname=$INCUS_VM_NAME --ss-volume-name=$SSDATA_VOLUME_NAME --backup-volume-name=$BACKUP_VOLUME_NAME"
# now let's create a new VM to work with.
#incus init -q --profile="$INCUS_VM_NAME" "$BASE_IMAGE_VM_NAME" "$INCUS_VM_NAME" --vm
incus init "$DOCKER_BASE_IMAGE_NAME" "$INCUS_VM_NAME" --vm --profile="$INCUS_VM_NAME"
if ! incus image list -q --format csv | grep -q "$INCUS_VM_NAME"; then
incus init -q "$DOCKER_BASE_IMAGE_NAME" "$INCUS_VM_NAME" --vm --profile="$INCUS_VM_NAME"
elif [ "$VIRTUAL_MACHINE" = lnplayserver ]; then
incus init -q "$INCUS_VM_NAME" "$INCUS_VM_NAME" --vm --profile="$INCUS_VM_NAME"
fi
# let's PIN the HW address for now so we don't exhaust IP
# and so we can set DNS internally.
@ -106,7 +106,7 @@ if ! incus list --format csv | grep -q "$INCUS_VM_NAME"; then
# fi
incus start "$INCUS_VM_NAME"
sleep 10
sleep 15
bash -c "./wait_for_ip.sh --incus-name=$INCUS_VM_NAME"

View File

@ -17,6 +17,10 @@ SKIP_WWW_SERVER=false
SKIP_LNPLAY_SERVER=false
BACKUP_WWW_APPS=true
WWW_SERVER_MAC_ADDRESS=
BTCPAY_SERVER_MAC_ADDRESS=
LNPLAY_SERVER_MAC_ADDRESS=
# grab any modifications from the command line.
for i in "$@"; do
case $i in
@ -43,19 +47,6 @@ for i in "$@"; do
esac
done
SERVERS=
if [ "$SKIP_BTCPAY_SERVER" = false ]; then
SERVERS="btcpayserver"
fi
if [ "$SKIP_WWW_SERVER" = false ]; then
SERVERS="www $SERVERS"
fi
if [ "$SKIP_LNPLAY_SERVER" = false ]; then
SERVERS="lnplayserver $SERVERS"
fi
. ./deployment_defaults.sh
. ./remote_env.sh
@ -71,6 +62,20 @@ source ./project/domain_env.sh
source ./domain_list.sh
SERVERS=
if [ "$SKIP_BTCPAY_SERVER" = false ] && [ -n "$WWW_SERVER_MAC_ADDRESS" ]; then
SERVERS="btcpayserver"
fi
if [ "$SKIP_WWW_SERVER" = false ] && [ -n "$BTCPAY_SERVER_MAC_ADDRESS" ]; then
SERVERS="www $SERVERS"
fi
if [ "$SKIP_LNPLAY_SERVER" = false ] && [ -n "$LNPLAY_SERVER_MAC_ADDRESS" ]; then
SERVERS="lnplayserver $SERVERS"
fi
for VIRTUAL_MACHINE in $SERVERS; do
INCUS_VM_NAME="$VIRTUAL_MACHINE-${PRIMARY_DOMAIN//./-}"
@ -78,14 +83,6 @@ for VIRTUAL_MACHINE in $SERVERS; do
if incus list | grep -q "$INCUS_VM_NAME"; then
bash -c "./stop.sh --server=$VIRTUAL_MACHINE"
# if [ "$VIRTUAL_MACHINE" = www ] && [ "$BACKUP_WWW_APPS" = true ]; then
# APP_LIST="letsencrypt ghost nextcloud gitea nostr"
# echo "INFO: Backing up WWW apps."
# for APP in $APP_LIST; do
# bash -c "$(pwd)/project/www/backup_www.sh --app=$APP"
# done
# fi
incus stop "$INCUS_VM_NAME"
incus delete "$INCUS_VM_NAME"

View File

@ -309,8 +309,6 @@ if [ -n "$LNPLAY_SERVER_MAC_ADDRESS" ] || [ "$SKIP_LNPLAY_SERVER" = false ]; the
VMS_TO_PROVISION="$VMS_TO_PROVISION lnplayserver"
fi
for VIRTUAL_MACHINE in $VMS_TO_PROVISION; do
export VIRTUAL_MACHINE="$VIRTUAL_MACHINE"

View File

@ -17,7 +17,7 @@ fi
# TODO REVIEW mgmt software requirements
sudo apt-get update
sudo apt-get install -y wait-for-it dnsutils rsync sshfs apt-transport-https docker-ce-cli libcanberra-gtk-module nano git
sudo apt-get install -y wait-for-it dnsutils rsync sshfs apt-transport-https docker-ce-cli libcanberra-gtk-module nano git gridsite-clients
sudo bash -c "$HOME/sovereign-stack/install_incus.sh"