Skip to content

Instantly share code, notes, and snippets.

@basoro
Forked from lichti/letsencrypt-proxmox.md
Created June 2, 2020 22:44
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save basoro/8d9c6f61f4fc932f106758508020a53e to your computer and use it in GitHub Desktop.
Save basoro/8d9c6f61f4fc932f106758508020a53e to your computer and use it in GitHub Desktop.
Proxmox with letsencrypt ssl
git clone https://github.com/certbot/certbot /opt/letsencrypt
ln -s /opt/letsencrypt/certbot-auto /usr/bin/certbot
certbot certonly --expand --agree-tos --text --non-interactive \
  --standalone \
  --email meu-email@gmail.com \
  -d xxx.com.br
cat << EOF > /root/letsencrypt.sh
#!/bin/bash
certbot renew --no-self-upgrade 
mv /etc/pve/local/pve-ssl.pem /root/
mv /etc/pve/local/pve-ssl.key /root/
mv /etc/pve/pve-root-ca.pem /root/
cp /etc/letsencrypt/live/pve01.lichti.com.br/fullchain.pem /etc/pve/local/pve-ssl.pem  
cp /etc/letsencrypt/live/pve01.lichti.com.br/privkey.pem /etc/pve/local/pve-ssl.key  
cp /etc/letsencrypt/live/pve01.lichti.com.br/chain.pem /etc/pve/pve-root-ca.pem  
service pveproxy restart  
service pvedaemon restart  
EOF
chmod +x /root/letsencrypt.sh
echo '@daily /root/letsencrypt.sh' > /etc/cron.d/letsencrypt
/root/letsencrypt.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment