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

Added usage of --challenge-alias, possibility of different DNA modes per domain #82

Open
wants to merge 10 commits into
base: dns-01-challenge
Choose a base branch
from

Conversation

hutmitfrosch
Copy link

@hutmitfrosch hutmitfrosch commented Jun 15, 2024

Since I needed to use acme.sh's --challenge-alias, I forked and wrote it in.
So I wanna participate also here and give my changes back to you, if you are interessted :-)

Allows for something like:

LETSENCRYPT_HOST=foo.domain.example,bar.other-domain.example
VIRTUAL_HOST=foo.domain.example,bar.other-domain.example
LETSENCRYPT_DNS_CHALLENGE_ALIAS=foo.validation-domain.example,bar.other-validation-domain.example
LETSENCRYPT_DNS_MODE=dns_inwx,dns_dynv6
LETSENCRYPT_DNS_MODE_SETTINGS=export INWX_User="my_user" INWX_Password="----" INWX_Shared_Secret="........." DYNV6_TOKEN="????"
  • If only one DNS Mode is given, it is used for all domains in the cert.
  • If only one challenge alias is given, it is used for all domains in the cert.
  • Mode config simply takes all exports for all used APIs.

Can be mixed with un-aliased auth - use "no" instead of alias domain at the according place(s) in the challange alias list like:

LETSENCRYPT_HOST=foo.domain.example,bar.other-domain.example,test.third-domain.example
VIRTUAL_HOST=foo.domain.example,bar.other-domain.example,test.third-domain.example
LETSENCRYPT_DNS_CHALLENGE_ALIAS=foo.validation-domain.example,no,test.some-validation-domain.example
LETSENCRYPT_DNS_MODE=dns_inwx,dns_dynv6,dns_inwx
LETSENCRYPT_DNS_MODE_SETTINGS=export INWX_User="my_user" INWX_Password="----" INWX_Shared_Secret="........." DYNV6_TOKEN="????"

I even tried implementing --domain-alias, but acme.sh's docu sadly is a little bit ambiguous how to mix this with the other two modes, does not support "no" for that parameter and hence filtering for that placeholder was difficult - so I removed those trials again.

I tested for both modes, single cert per domain and SAN.
For single cert per domain, the bullet points above are regarded by filtering out "no" and also applying only one given mode and / or alias for all created certs (see sources).

I am sorry for having no idea how to implement tests fitting your existing ones, so I have to leave that part to someone else.
Might be good to test the whole thing more intensively, seems to fit my use case / needs, so at some point I stoped looking for other edge-cases.

If I find some other bugs, I can do a new pull request, If you like.

pini-gh and others added 10 commits June 7, 2024 00:13
Environment variables:
- LETSENCRYPT_DNS_MODE=<dns_provider_backend>
- LETSENCRYPT_DNS_MODE_SETTINGS=export VAR1=value VAR2=...
  (configuration variables for the DNS provider backend)

And don't fiddle with nginx-proxy acme-challenge conf This is to the
nginx-proxy container to handle that (this commit expects nginx-proxy
from the https-passthrough+acme_challenge branch of pini-gh's fork).
* Configurable LETSENCRYPT_HOST variable name
* Configurable nginx-proxy & docker-gen labels

Combined with my nginx-proxy fork HTTPS passthrough feature this allow for
easy testing configuration setup, very usefull when one has only one server
to work with.

In swarm mode we can't give names to the containers. We have to use
labels then.  And these labels have to be configurable if we want to be
able to chain several nginx-proxy instances.

Also wait for nginx-proxy and docker-gen containers instead of erroring out.
This is useful in swarm environment where the 'depends_on' compose option
isn't available.
Only the LETSENCRYPT_HOST variable is subject to renaming.
This allow checking both HTTP and HTTPS.
This way standalone certificates can be requested from their container's
environment without using /app/letsencrypt_user_data.
…ssibilities due to ambiguity of acme.sh docu regarding combination of --domain-alias with --chalange-alias
@hutmitfrosch hutmitfrosch changed the title Added usage of --dns-alias, possibility of different DNA modes per domain Added usage of --challenge-alias, possibility of different DNA modes per domain Jun 15, 2024
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