tizen.moe

tizen.moe

(続)Let's Encryptの証明書更新

blog.tizen.moe

いつの間にか切れていて↑のやり方でやろうとしたら

$ ./certbot-auto renew
Requesting to rerun ./certbot-auto with root privileges...
./certbot-auto has insecure permissions!                                                                                To learn how to fix them, visit https://community.letsencrypt.org/t/certbot-auto-deployment-best-practices/91979/       Error: couldn't get currently installed version for /opt/eff.org/certbot/venv/bin/letsencrypt:
Traceback (most recent call last):
  File "/opt/eff.org/certbot/venv/bin/letsencrypt", line 7, in <module>
    from certbot.main import main
  File "/opt/eff.org/certbot/venv/local/lib/python2.7/site-packages/certbot/main.py", line 6, in <module>
    import logging.handlers
  File "/usr/lib/python2.7/logging/__init__.py", line 26, in <module>
    import sys, os, time, cStringIO, traceback, warnings, weakref, collections
  File "/usr/lib/python2.7/weakref.py", line 14, in <module>
    from _weakref import (
ImportError: cannot import name _remove_dead_weakref

って怒られるようになった。
community.letsencrypt.org
ファイルのパスとpermittionをなんとかすれば良いのかなと思ったけど上手く行かなかったので試した方法

$ git clone https://github.com/letsencrypt/letsencrypt
$ cd letsencrypt
$ python ./setup.py install

Ubuntuは18.04になっているハズですが16.04から更新したものなので一部のライブラリが古かったらしくversion unmatchでエラーになった。

error: cryptography 2.1.4 is installed but cryptography>=2.3 is required by set(['PyOpenSSL'])

取りあえずエラーと言われたやつだけ更新しようとしたら、そもそもpipが古いと怒られる。。。

You are using pip version 18.1, however version 19.2.3 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

ので、pipも更新した。

$ sudo pip install --upgrade pip
$ sudo pip install --upgrade cryptography

で、再度setup.pyを実行してみたら一応ちゃんとインストールが進んだっぽい。ので、試しにcertbotを実行してみる。

$ sudo certbot renew

動くようにはなったけど環境が壊れた。。。

$ sudo apt install letsencrypt

結果的にUbuntuのaptで入れ直して作り直してゴチャゴチャして直した。疲れた、、、