Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update setup scripts for marquee to work on Debian 10 #129

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions debian/common/00-upgrade
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ apt update -y
apt upgrade -y
apt autoremove -y

# TODO: this is redundant on Debian 10, remove when we have no Debian 9
echo "Etc/UTC" > /etc/timezone
dpkg-reconfigure -f noninteractive tzdata
2 changes: 1 addition & 1 deletion debian/common/04-ssh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash -e

apt install -y openssh-server
apt install -y openssh-server rsync

read -p "ssh password login will be disabled, press enter to continue"

Expand Down
3 changes: 3 additions & 0 deletions debian/common/scripts/certbot
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/bin/bash -e

# This setup is used on Debian 9
# TODO: remove when we no longer have any Debian 9 VMs

# enable backports to get a newer certbot
sed -i 's/# \(deb.*stretch-backports.*\)/\1/' /etc/apt/sources.list
apt update
Expand Down
25 changes: 25 additions & 0 deletions debian/common/scripts/certbot-dns
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash -e

# This setup is used on Debian 10

DIGITALOCEAN_INI=/etc/letsencrypt/digitalocean.ini

token=""
while [ -z "$token" ]; do
read -p "DigitalOcean access token: " token
done

echo "dns_digitalocean_token = $token" > "$DIGITALOCEAN_INI"
chmod 0600 "$DIGITALOCEAN_INI"

apt install certbot python3-certbot-dns-digitalocean

DOMAINS_FILE="$1"

# https://stackoverflow.com/a/8714446
DOMAIN_ARG="$(cat "$DOMAINS_FILE" | awk -vORS=, '{ print }' | sed 's/,$//')"
certbot certonly --agree-tos --dns-digitalocean --dns-digitalocean-credentials "$DIGITALOCEAN_INI" -m [email protected] -d "$DOMAIN_ARG"

# https://www.dzombak.com/blog/2018/01/Deploying-Let-s-Encrypt-with-Nginx-on-Ubuntu-16-04.html
mkdir -p /etc/letsencrypt/renewal-hooks/deploy
cp "$(dirname "$0")/certbot-renewal-hooks-deploy-nginx" /etc/letsencrypt/renewal-hooks/deploy/nginx
2 changes: 1 addition & 1 deletion debian/marquee/01-certbot
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash -e

../common/scripts/certbot DOMAINS
../common/scripts/certbot-dns DOMAINS