Skip to content

Instantly share code, notes, and snippets.

@meijerwynand
Last active April 9, 2021 20:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save meijerwynand/d2627fd2d45299ac70330f957de2d545 to your computer and use it in GitHub Desktop.
Save meijerwynand/d2627fd2d45299ac70330f957de2d545 to your computer and use it in GitHub Desktop.
Installing letsenctrypt wildcard on termux with autorenew

sources

Some sources that helped

install venv for pip and update pip

Basic pip venv setup and updating it

python3 -m venv ~/venv/certbot
cd ~/venv/certbot
source bin/activate
pip install --upgrade pip

install rust

Needed this for the crypto part used by letsencrypt/certbot

(certbot) $ pkg install rustc-dev

install certbot from pip

This takes a while to complete

(certbot) $ pip install certbot

create custom dirs in venv location

Where letsencrypt saves to

(certbot) $ mkdir -p data/{config,work,logs}

create a wildcard cert for domain using certbot

(certbot) $ certbot certonly --manual --preferred-challenges=dns --email email-address@somedomain.tld --server https://acme-v02.api.letsencrypt.org/directory --agree-tos --config-dir data/config/ --work-dir data/work/ --logs-dir data/logs/ -d *.somedomain.tld 

make dns changes

  • add TXT based on output of certbot

add crontab

Here is what I ended up with

$ crontab -l
5 0,12 * * * source ~/venv/certbot/bin/activate && cd ~/venv/certbot && certbot renew --config-dir data/config/ --work-dir data/work/ --logs-dir data/logs/

Done

This is my first attempt, will see if the cron runs and all work as planned.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment