From d75527f7eecc4e2fcdd18ab157412506717c8adb Mon Sep 17 00:00:00 2001 From: navanchauhan Date: Mon, 7 Nov 2022 23:36:11 -0700 Subject: add blog post --- docs/posts/2020-11-17-Lets-Encrypt-DuckDns.html | 30 ++++++++++++++++--------- 1 file changed, 20 insertions(+), 10 deletions(-) (limited to 'docs/posts/2020-11-17-Lets-Encrypt-DuckDns.html') diff --git a/docs/posts/2020-11-17-Lets-Encrypt-DuckDns.html b/docs/posts/2020-11-17-Lets-Encrypt-DuckDns.html index f8e7b6c..fdde2b8 100644 --- a/docs/posts/2020-11-17-Lets-Encrypt-DuckDns.html +++ b/docs/posts/2020-11-17-Lets-Encrypt-DuckDns.html @@ -47,13 +47,17 @@

Dependencies

-
sudo apt update && sudo apt install certbot -y
-
+
+
sudo apt update && sudo apt install certbot -y
+
+

Get the Certificate

-
sudo certbot certonly --manual --preferred-challenges dns-01 --email senpai@email.com -d mydomain.duckdns.org
-
+
+
sudo certbot certonly --manual --preferred-challenges dns-01 --email senpai@email.com -d mydomain.duckdns.org
+
+

After you accept that you are okay with you IP address being logged, it will prompt you with updating your dns record. You need to create a new TXT record in the DNS settings for your domain.

@@ -66,7 +70,8 @@

You can check if the TXT records have been updated by using the dig command:

-
dig navanspi.duckdns.org TXT
+
+
dig navanspi.duckdns.org TXT
 ; <<>> DiG 9.16.1-Ubuntu <<>> navanspi.duckdns.org TXT
 ;; global options: +cmd
 ;; Got answer:
@@ -85,7 +90,8 @@ navanspi.duckdns.org.    60    IN    TXT    ;; SERVER: 127.0.0.53#53(127.0.0.53)
 ;; WHEN: Tue Nov 17 15:23:15 IST 2020
 ;; MSG SIZE  rcvd: 105
-
+
+

DuckDNS almost instantly propagates the changes but for other domain hosts, it could take a while.

@@ -99,13 +105,17 @@ navanspi.duckdns.org. 60 IN TXT
gunicorn api:app -k uvicorn.workers.UvicornWorker -b 0.0.0.0:7589
-
+
+
gunicorn api:app -k uvicorn.workers.UvicornWorker -b 0.0.0.0:7589
+
+

To use the certificate with it, simply copy the cert.pem and privkey.pem to your working directory ( change the appropriate permissions ) and include them in the command

-
gunicorn api:app -k uvicorn.workers.UvicornWorker -b 0.0.0.0:7589 --certfile=cert.pem --keyfile=privkey.pem
-
+
+
gunicorn api:app -k uvicorn.workers.UvicornWorker -b 0.0.0.0:7589 --certfile=cert.pem --keyfile=privkey.pem
+
+

Caveats with copying the certificate: If you renew the certificate you will have to re-copy the files

-- cgit v1.2.3