Skip to content

Feature: add DISCOURSE_ACME_DNS_MODE #951

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions samples/standalone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,12 @@ env:
## If you added the Lets Encrypt template, uncomment below to get a free SSL certificate
#LETSENCRYPT_ACCOUNT_EMAIL: [email protected]

## To use DNS verification with letsencrypt uncomment below and add the relevant environment variables from: https://github.com/acmesh-official/acme.sh/wiki/dnsapi
# (cloudflare example)
#DISCOURSE_ACME_DNS_MODE: dns_cf
#CF_Key: 763eac4f1bcebd8b5c95e9fc50d010b4
#CF_Email: [email protected]

## The http or https CDN address for this Discourse instance (configured to pull)
## see https://meta.discourse.org/t/14857 for details
#DISCOURSE_CDN_URL: https://discourse-cdn.example.com
Expand Down
6 changes: 6 additions & 0 deletions samples/web_only.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,12 @@ env:
## If you added the Lets Encrypt template, uncomment below to get a free SSL certificate
#LETSENCRYPT_ACCOUNT_EMAIL: [email protected]

## To use DNS verification with letsencrypt uncomment below and add the relevant environment variables from: https://github.com/acmesh-official/acme.sh/wiki/dnsapi
# (cloudflare example)
#DISCOURSE_ACME_DNS_MODE: dns_cf
#CF_Key: 763eac4f1bcebd8b5c95e9fc50d010b4
#CF_Email: [email protected]

## TODO: configure connectivity to the databases
DISCOURSE_DB_SOCKET: ''
#DISCOURSE_DB_USERNAME: discourse
Expand Down
6 changes: 5 additions & 1 deletion templates/web.letsencrypt.ssl.template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,11 @@ hooks:
/usr/sbin/nginx -c /etc/nginx/letsencrypt.conf

issue_cert() {
LE_WORKING_DIR="${LETSENCRYPT_DIR}" $$ENV_LETSENCRYPT_DIR/acme.sh --issue $2 -d $$ENV_DISCOURSE_HOSTNAME --keylength $1 -w /var/www/discourse/public
if [ -z $DISCOURSE_ACME_DNS_MODE ]; then
LE_WORKING_DIR="${LETSENCRYPT_DIR}" $$ENV_LETSENCRYPT_DIR/acme.sh --issue $2 -d $$ENV_DISCOURSE_HOSTNAME --keylength $1 -w /var/www/discourse/public
else
LE_WORKING_DIR="${LETSENCRYPT_DIR}" $$ENV_LETSENCRYPT_DIR/acme.sh --dns ${DISCOURSE_ACME_DNS_MODE} --issue $2 -d $$ENV_DISCOURSE_HOSTNAME --keylength $1 -w /var/www/discourse/public
fi
}

cert_exists() {
Expand Down