website icon indicating copy to clipboard operation
website copied to clipboard

macOS instructions cron command missing certbot

Open robske110 opened this issue 3 years ago • 2 comments

$(command -v certbot) is missing from the suggested command. (Was introduced in https://github.com/certbot/website/commit/b2682d62f7d1e1049ab2a6b094543d451594a6dd) Picture from https://certbot.eff.org/instructions?ws=apache&os=osx : image

If I run the site locally (clone this repository and run the docker compose setup), the command is displayed correctly. image

robske110 avatar Jan 10 '22 16:01 robske110

Thank you for reporting this.

The correct contents can be retrieved at https://web.archive.org/web/20211010104605/https://certbot.eff.org/lets-encrypt/osx-apache.

cc @zoracon, I think one for E&D

alexzorin avatar Jan 11 '22 10:01 alexzorin

@zoracon it looks like the website was updated with new instructions, but they are not quite right yet.

  1. The $(command -v certbot) part is necessary because the certbot binary is missing from root's PATH, if installed via Homebrew. It appears to have been dropped.
  2. python is not necessarily available in macOS. On my system, only python3 is available. Potentially, we will want to replace python with $(command -v python3).

So I think ultimately it might look something like:

echo "0 0,12 * * * root $(command -v python3) -c 'import random; import time; time.sleep(random.random() * 3600)' && sudo $(command -v certbot) renew -q" | sudo tee -a /etc/crontab > /dev/null

alexzorin avatar Apr 21 '22 11:04 alexzorin