2024-08-28 16:11:24 -04:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# TODO: Handle "$1".
|
|
|
|
|
2024-10-08 16:53:57 -04:00
|
|
|
set -eu
|
2024-08-28 16:11:24 -04:00
|
|
|
|
|
|
|
#DEBHELPER#
|
|
|
|
|
|
|
|
# `certbot` *must* be installed by this package.
|
2024-10-08 16:53:57 -04:00
|
|
|
if [ "$(hostname)" = shione ]; then
|
|
|
|
certbot \
|
|
|
|
--agree-tos \
|
|
|
|
--email renken+letsencrypt@shione.net \
|
|
|
|
-d shione.net \
|
|
|
|
-d www.shione.net \
|
|
|
|
-d git.shione.net
|
|
|
|
else
|
|
|
|
out=/etc/letsencrypt/live/shione.net
|
|
|
|
|
|
|
|
mkdir -p -- "$out"
|
|
|
|
openssl genrsa \
|
|
|
|
>"$out"/privkey.pem
|
|
|
|
openssl req \
|
|
|
|
-new \
|
|
|
|
-x509 \
|
|
|
|
-key /etc/letsencrypt/live/shione.net/privkey.pem \
|
|
|
|
-subj '/CN=shione.net/O=shione.net./C=FR' \
|
|
|
|
>/etc/letsencrypt/live/shione.net/fullchain.pem
|
|
|
|
fi
|
2024-08-28 16:11:24 -04:00
|
|
|
|
|
|
|
# Apply new nginx configuration.
|
|
|
|
deb-systemd-invoke restart nginx
|