oneuptime/certs-issue.sh
Simon Larsen f948a32669
fix paths
2022-12-16 20:20:44 +05:30

14 lines
557 B
Bash

# This script generates or renews certs for this server.
export $(grep -v '^#' config.env | xargs)
npm run prerun
docker compose stop nginx
sudo snap install core
sudo snap refresh core
sudo apt-get remove certbot
sudo snap install --classic certbot
sudo ln -s /snap/bin/certbot /usr/bin/certbot
sudo certbot certonly --standalone
sudo certbot renew --dry-run
sudo cp /etc/letsencrypt/live/$DOMAIN/fullchain.pem $(pwd)/Certs/ServerCerts/Cert.crt
sudo cp /etc/letsencrypt/live/$DOMAIN/privkey.pem $(pwd)/Certs/ServerCerts/Key.key
docker compose start nginx