From 5f420deb1809d19a529f76e45265749fbb8f1b74 Mon Sep 17 00:00:00 2001 From: Derek Smith Date: Tue, 10 May 2022 12:15:32 -0400 Subject: [PATCH] Improved install.sh speed. Signed-off-by: Derek Smith --- .gitignore | 19 +------------------ clear_lxd_stack.sh | 11 ----------- generate_certs.sh | 2 +- install.sh | 20 +++++++------------- publish_tag.sh | 14 -------------- 5 files changed, 9 insertions(+), 57 deletions(-) delete mode 100755 clear_lxd_stack.sh delete mode 100755 publish_tag.sh diff --git a/.gitignore b/.gitignore index d60097b..182bc15 100644 --- a/.gitignore +++ b/.gitignore @@ -1,20 +1,3 @@ -archive/* - - -# this gets generated locally then push to remote vps for execution. -temp_btcpay.sh - -nginx.conf - -# this file can be used by the USER to reset the LXD stack. It deletes a lxc machine VM (which you should update) -# then clears the lxd stack including profile, images, and storage pools -# then runs go.sh -reset.sh - -# you can create an env in this directory. The code will source it if the file exists. -# This is a good place to put your LXD info env - clear_lxd_stack.sh - -publish_tag.sh +publish_tag.sh \ No newline at end of file diff --git a/clear_lxd_stack.sh b/clear_lxd_stack.sh deleted file mode 100755 index ae50eb0..0000000 --- a/clear_lxd_stack.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -LXD_VM_NAME="www-sovereign-stack-org" - -lxc delete -f "$LXD_VM_NAME" - -lxc profile delete "$LXD_VM_NAME" - -lxc image delete "sovereign-stack-base" "ubuntu-21-04" - -#lxc storage delete default diff --git a/generate_certs.sh b/generate_certs.sh index a20e95e..d1ad1cd 100755 --- a/generate_certs.sh +++ b/generate_certs.sh @@ -14,7 +14,7 @@ if [ "$VPS_HOSTING_TARGET" = aws ]; then -p 443:443 \ -v /etc/letsencrypt:/etc/letsencrypt \ -v /var/lib/letsencrypt:/var/lib/letsencrypt certbot/certbot \ - certonly -v --noninteractive --agree-tos --key-type ecdsa --standalone --expand -d "$DOMAIN_NAME" -d "$FQDN" -d "$NEXTCLOUD_FQDN" -d "$MATRIX_FQDN" -d "$GITEA_FQDN" --email "$CERTIFICATE_EMAIL_ADDRESS" + certonly -v --noninteractive --agree-tos --key-type ecdsa --standalone --expand -d "$DOMAIN_NAME" -d "$FQDN" -d "$NEXTCLOUD_FQDN" -d "$GITEA_FQDN" --email "$CERTIFICATE_EMAIL_ADDRESS" # backup the certs to our SITE_PATH/certs.tar.gz so we have them handy (for local development) ssh "$FQDN" sudo tar -zcvf "$REMOTE_HOME/certs.tar.gz" -C /etc ./letsencrypt diff --git a/install.sh b/install.sh index c225639..481ccdb 100755 --- a/install.sh +++ b/install.sh @@ -1,8 +1,13 @@ #!/bin/bash +sudo apt-get remove docker docker-engine docker.io containerd runc + +curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg +echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null + sudo apt-get update -sudo apt-get install -y wait-for-it dnsutils rsync sshfs +sudo apt-get install -y wait-for-it dnsutils rsync sshfs apt-transport-https ca-certificates curl gnupg lsb-release docker-ce-cli python3-pip libusb-1.0-0-dev libudev-dev pinentry-curses if [ ! -f $(which lxd) ]; then sudo snap install lxd @@ -10,21 +15,10 @@ fi # let's ensure docker-machine is available. base="https://github.com/docker/machine/releases/download/v0.16.2" -curl -L "$base/docker-machine-$(uname -s)-$(uname -m)" >/tmp/docker-machine +curl -s -L "$base/docker-machine-$(uname -s)-$(uname -m)" >/tmp/docker-machine sudo mv /tmp/docker-machine /usr/local/bin/docker-machine chmod +x /usr/local/bin/docker-machine -# NOTE!!! DOCKER CLI MUST BE INSTALLED VIA instructions at https://docs.docker.com/engine/install/ubuntu/ DO NOT USE SNAP -sudo apt-get remove docker docker-engine docker.io containerd runc -sudo apt-get update -sudo apt-get install apt-transport-https ca-certificates curl gnupg lsb-release -curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg -echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null -sudo apt-get update -sudo apt-get install docker-ce-cli -y - -# install trezor requirements https://wiki.trezor.io/Apps:SSH_agent -sudo apt update && sudo apt install python3-pip libusb-1.0-0-dev libudev-dev pinentry-curses pip3 install trezor_agent sudo cp ./51-trezor.rules /etc/udev/rules.d/51-trezor.rules diff --git a/publish_tag.sh b/publish_tag.sh deleted file mode 100755 index c4ef1be..0000000 --- a/publish_tag.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash - -# this script will tag the repo then push it to origin -TAG_NAME=v0.0.18 -COMIT_MESSAGE="Creating commit on $(date)." -TAG_MESSAGE="Creating tag $TAG_NAME on $(date)." - -# create a git commit with staged changes. -git commit -m "$COMIT_MESSAGE" -s -git tag -a "$TAG_NAME" -m "$TAG_MESSAGE" -s - -# optional; push to remote -git push --all -git push --tags