Skip to content
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

[WIP] Added DNS-01 challange support #257

Closed
wants to merge 4 commits into from
Closed

Conversation

pushrbx
Copy link

@pushrbx pushrbx commented May 8, 2022

I'm a very rookie with bash, so this PR can't be really called production ready.
For now it works by passing in the environment variables required for each supported DNS provider.

Known issues:

  • Credentials leaking into bash history, because you have to use dokku config:set <app> DOKKU_LETSENCRYPT_LEGO_ENV_VARS="MY_SECRET=214;MY_OTHER_SECRET=sdfdsf" to make the dns challange work.
  • If you set DOKKU_LETSENCRYPT_CHALLANGE_MODE to dns but if you don't set DOKKU_LETSENCRYPT_DNS_PROVIDER the script won't notify you that you are doing something wrong.
  • Untested wildcard support. (Add wildcard support via DNS-01 challenge #189)

More info about env vars here; https://go-acme.github.io/lego/dns/
Added new env vars for the plugin's configuration:

  • DOKKU_LETSENCRYPT_LEGO_ENV_VARS
  • DOKKU_LETSENCRYPT_DNS_PROVIDER
  • DOKKU_LETSENCRYPT_CHALLANGE_MODE
Variable Default Description
DOKKU_LETSENCRYPT_CHALLANGE_MODE http The challange mode you'd like to use. Valid values are http and dns.
DOKKU_LETSENCRYPT_DNS_PROVIDER (none) You must set this to a dns provider code from the lego docs if DOKKU_LETSENCRYPT_CHALLANGE_MODE is dns.
DOKKU_LETSENCRYPT_LEGO_ENV_VARS (none) Additional environment variables for lego CLI.

I'm opening this here in hope that the community will pitch in some ideas for solving the issues described above. 😸

@josegonzalez
Copy link
Member

This is great work!

One thing I'd like to get away from is using new environment variables for plugin config. It clutters actual app environment variables. Would you be willing to make an MR to first migrate away from environment variables and into using the properties system? Here is an example MR doing so for the old registry plugin: https://github.com/dokku/dokku-registry/pull/8/files

@pushrbx
Copy link
Author

pushrbx commented May 12, 2022

No problem, will do.

@josegonzalez
Copy link
Member

I can't pull this in now due to a few merge conflicts (both new and old) but I am working on this functionality now. Thanks for the initial contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants