From bb9789fd54066aa17db5231701fbcdd93057fad1 Mon Sep 17 00:00:00 2001 From: deflax Date: Sun, 31 Dec 2023 02:46:03 +0000 Subject: [PATCH] set certbot.env file --- .gitignore | 4 ++++ certbot.env.dist | 2 ++ renew-certificates.sh | 14 ++++++++++++++ 3 files changed, 20 insertions(+) create mode 100644 certbot.env.dist create mode 100755 renew-certificates.sh diff --git a/.gitignore b/.gitignore index 68bc17f..122818e 100644 --- a/.gitignore +++ b/.gitignore @@ -158,3 +158,7 @@ cython_debug/ # and can be added to the global gitignore or merged into this file. For a more nuclear # option (not recommended) you can uncomment the following to ignore the entire idea folder. #.idea/ + + +# tv +certbot.env diff --git a/certbot.env.dist b/certbot.env.dist new file mode 100644 index 0000000..11e6b2b --- /dev/null +++ b/certbot.env.dist @@ -0,0 +1,2 @@ +BASE_URL=example.com +EMAIL=info@example.com diff --git a/renew-certificates.sh b/renew-certificates.sh new file mode 100755 index 0000000..e0fcda3 --- /dev/null +++ b/renew-certificates.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +source certbot.env + +CB=`docker ps | grep certbot | cut -d ' ' -f 1` + +echo $BASE_URL +echo $EMAIL + +docker exec $CB certbot certonly --non-interactive --standalone --http-01-address 0.0.0.0 --email $EMAIL --agree-tos --keep --preferred-challenges http --cert-name stream.$BASE_URL \ + -d tv.$BASE_URL -d stream.$BASE_URL -d vod.$BASE_URL + +cat "./data/certbot/etc/live/stream.$BASE_URL/privkey.pem" "./data/certbot/etc/live/stream.$BASE_URL/fullchain.pem" > "./data/certificates/stream.$BASE_URL.pem" +docker kill -s USR2 television_haproxy_1