TL;DR
マストドンのSSL証明書(Let's Encrypt)の有効期限を確認するには、root
で下記2コマンドを実行します。sample.com
は自分のドメインに変えてください。
DOMAIN=sample.com
openssl s_client -connect ${DOMAIN}:443 < /dev/null 2> /dev/null | openssl x509 -text | grep "Not "
上記を実行すると下記のような取得日、有効期限が返されてきます。
Not Before: Jul 22 14:45:00 2017 GMT
Not After : Oct 20 14:45:00 2017 GMT
手動更新
上記で有効期限の自動更新が不安な場合は手動更新してみてください。
/usr/local/certbot/certbot-auto renew --standalone --pre-hook 'systemctl stop nginx' --post-hook 'systemctl start nginx' --force-renew
Cronの自動更新設定
echo "$((${RANDOM}%60)) $((${RANDOM}%24)) * * $((${RANDOM}%7)) root /usr/local/certbot/certbot-auto renew --standalone --preferred-challenges tls-sni-01 --pre-hook 'systemctl stop nginx' --post-hook 'systemctl start nginx'" > /etc/cron.d/certbot-auto
参考文献
- 『スタートアップスクリプト「Mastodon」の更新のお知らせ・2017/7/10 12:00以前にスクリプトを使用して作成されたインスタンス向けの作業のお願い | さくらのクラウドニュース』
https://cloud-news.sakura.ad.jp/2017/07/10/mastodon-startupscript-update-4/