-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Creating Present/Cleanup methods providing just fqdn, value as arguments ? #720
Comments
@ldez any thoughts on this? I'm trying to figure out if there's a way to use lego if I only have the FQDN and Value (TXT record) parameters? |
I think this is a edge-case and that there are some design issues. I think that the |
@ldez thanks for your reply! The My question is how to make use of
Step 1-3 work great, step 4 is not possible yet with As As I see (and I'm sure I might be mising something), the logic for most (all?) DNS providers is exactly like is described in the wiki entry Writing a Challenge Solver:
As far as I can see all the DNS providers use the same logic:
It could be easy to make the I understand that it's definitely a design decision. I'm wondering if you'd be willing to consider this because it would make lego more valuable as package to be integrated in other projects. If not I'd be at least curious if you would have any suggestions on what would be a good (clean) approach to solve this using Go. |
@ldez practical what I'd suggest would be the following: Update the interfaces in
As Next to creating this interface it would be necessary to update This would mean that the providers in I'd be happy to submit a PR for that if you'd agree this would be a good way to offer this functionality. |
Those interfaces must not be changed because they are used in a lot of projects. |
@ldez the |
The new interface will be introduce breaking changes on exported methods. I don't see any way to do what you want without break the public contract of the lego API. could you explain why you use acme.sh instead of Lego, Traefik or Caddy? |
@ldez first, thanks for taking the time to give feedback - I'm trying to figure this out, but have much less experience in using good design patterns than most of you, so happy to understand more of how this would break exported methods. I've tried understanding from reading https://golang.org/ref/spec#Interface_types how this works, but can't see how a new interface breaks exported methods. Obviously I don't want to break the public contract of the lego API, which is why introducing a new interface would offer an extra option (e.g. a The design goal for acmeproxy is to be universally useable, independent of the client. Personally I'm using acme.sh because it's part of the (FreeBSD) pfSense router I'm using. For all other parts of my network I'm using Lego and Caddy. Of course I could try and change this, but there would be many more circumstances that might want to make use of |
Could this be a workable idea without breaking anything?
We can then try to cast a
/EDIT: we could even do without creating the
This would mean that we could rewrite DNS providers that want to offer an export CreateRecord / RemoveRecord functionality without changing much else. |
I need time to think about the best solution. |
Going through the different options it would be enough if there would be an exported method that accepts |
This is a low-friction change which has really profound consequences (in a good way). I'd use a feature like this to dynamically update DNS A/AAAA records if my machine changes IP addresses, before obtaining a certificate. |
@ldez any ideas if / how we can get this on the road? |
(To clarify, as an update to my previous comment, while I do still think this could be a low-friction change, I have since found workarounds for my use case and don't need to use it myself, anyway.) |
@mholt did you find a way to use lego with fqdn,value as input or did you find a different workaround altogether? |
@mdbraber Ha, sorry, I lost track of this issue... anyway, I have since written an alternate ACME library with a different API for DNS providers (and the DNS challenge altogether). |
@ldez So this has been stale for a couple of years now. Is there any clue on how we might move forward with generic record creation or is this simply out of scope for lego and acmeproxy will have to fall back to using RAW mode always? |
@Blackclaws If arbitrary/generic DNS record manipulation is what you need, then libdns might be what you're looking for. |
Hi,
I'm writing acme-proxy to relay dns challenges using the httpreq provider and integrating with lego DNS providers. It's easy to write a "RAW" method that calls the
Present()
andCleanup()
methods usingdomain
,token
andkeyAuth
arguments.I'd also like to write a version that integrates the "default" method that calls a method using just the
fqdn
andvalue
. But there isn't a constructor that I can call for lego DNS providers with just those two values (and logically it's impossible to reversevalue
to akeyAuth
as it's sha256.I'm wondering if anyone has a good suggestion to leverage the existing DNS providers. A complete "solution" would of course make a separate constructor with the
fqdn
andvalue
parameter that is called by the 'outer' constructor that uses thedomain
,token
andkeyAuth
parameters. That might solve the issue but probably this is considered overkill. OTOH having a constructor that can be called with justfqdn
andvalue
for DNS challenges might be useful for other uses cases too.I'm happy to rewrite the DNS providers if this would be interesting, but first would like to see if this would be the best way to go or other solutions might be better (or just not having a "default" mode for acme-proxy might be just best)
/cc @ldez
The text was updated successfully, but these errors were encountered: