Configure cerbot with app.yml?

AI-generated summary

The discussion revolves around configuring Certbot with Discourse’s app.yml file to achieve Let’s Encrypt SSL compatibility with Cloudflare. f1r4s is experiencing an error with their current SSL setup and wants to disable Cloudflare SSL to use Certbot instead. They provided a command to install the Certbot module with Cloudflare, but need help incorporating it into Discourse’s templates or app.yml file. pfaffman suggested modifying the Let’s Encrypt template to achieve this, while Falco argued that using Certbot with Discourse is unnecessary. f1r4s provided a possible solution by combining their Certbot command with the existing Let’s Encrypt certificate issuance code.

Hello,

My site is using Cloudflare, and everything is good, but i see in checking https checker there is

https 443: Error: A call to SSPI failed, see inner exception.

I’m looking to disable Cloudflare SSL and use certbot insted, but i need to install certbot module with cloudflare as below:

certbot certonly \
  --dns-cloudflare \
  --dns-cloudflare-credentials ~/.secrets/certbot/cloudflare.ini \
  -d example.com \
  -d www.example.com

Where i can put these cerbot commands in templates of discourse or in app.yml file ?

also there should be a file for cloudflare access and should be chmod 600

~/.secrets/certbot/cloudflare.ini

Please advice how can we achive this.

Thanks!

How did you install discourse? If you do a standard installation, you’ll get a certificate from let’s encrypt by default. It won’t work with cloudflare in front, however.

You might be able to look at the let’s encrypt template and modify it to do what you suggest.

Hi Jay,

Correct, i’m working on this, but unfortunately i don’t have much experiance in programming or bash script to achive this issue… but i didn’t find any module with cerbot with let’s encrypts to do this.. only this line maybe we add our code there

          # Try to issue the cert again if something goes wrong
          issue_cert "4096" "--force"
        fi

        LE_WORKING_DIR="${LETSENCRYPT_DIR}" $$ENV_LETSENCRYPT_DIR/acme.sh \
          --installcert \
          -d $$ENV_DISCOURSE_HOSTNAME \
          --fullchainpath /shared/ssl/$$ENV_DISCOURSE_HOSTNAME.cer \
          --keypath /shared/ssl/$$ENV_DISCOURSE_HOSTNAME.key \
          --reloadcmd "sv reload nginx"

with


certbot certonly \
  --dns-cloudflare \
  --dns-cloudflare-credentials ~/.secrets/certbot/cloudflare.ini \
  -d example.com \
  -d www.example.com

I hope who have experiance in coding can help us to include this code with let’s encrypt certificate ?

There is no reason to use certbot with Discourse. The standard install guide will automatically provision a let’s encrypt certificate.

The reason is to make Let’s Encrypt SSL compatbile with CloudFlare..