Skip to content

Instantly share code, notes, and snippets.

@otofune
Last active March 27, 2017 18:58
Show Gist options
  • Save otofune/cbbfd5043fceff7e66a301cb6f251f61 to your computer and use it in GitHub Desktop.
Save otofune/cbbfd5043fceff7e66a301cb6f251f61 to your computer and use it in GitHub Desktop.

これなに?

これね、Ubuntuでのapt install letsencryptしたcertbot (だと思う) で自動更新するやつ。nginxで常時httpリクエストでの.well-known/acme-challenge/usr/share/nginx/letsencryptに通してると出来る

おきかた

全部を /etc/systemd/network においておもむろに systemctl start renewal.timer する、ついでに systemctl enable renewal.timer

[Unit]
Description=let's encrypt renewal
[Service]
Type=oneshot
ExecStart=/usr/local/bin/certbot renew --webroot -w /usr/share/nginx/letsencrypt --post-hook "systemctl reload nginx" --force-renew
[Unit]
Description=renew let's encrypt certifications weekly
[Timer]
OnCalendar=weekly
Persistent=true
[Install]
WantedBy=timers.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment