mirror of
https://github.com/joohoi/acme-dns.git
synced 2025-07-13 17:27:51 +07:00
Deps update (#289)
* Dependency version bumps and according fixes & touchups * Change to async to avoid interactive dialogs * Move the Let's Encrypt environment selection to proper place
This commit is contained in:
@ -1,6 +1,9 @@
|
||||
package main
|
||||
|
||||
import "github.com/go-acme/lego/challenge/dns01"
|
||||
import (
|
||||
"context"
|
||||
"github.com/mholt/acmez/acme"
|
||||
)
|
||||
|
||||
// ChallengeProvider implements go-acme/lego Provider interface which is used for ACME DNS challenge handling
|
||||
type ChallengeProvider struct {
|
||||
@ -13,18 +16,22 @@ func NewChallengeProvider(servers []*DNSServer) ChallengeProvider {
|
||||
}
|
||||
|
||||
// Present is used for making the ACME DNS challenge token available for DNS
|
||||
func (c *ChallengeProvider) Present(_, _, keyAuth string) error {
|
||||
_, token := dns01.GetRecord("whatever", keyAuth)
|
||||
func (c *ChallengeProvider) Present(ctx context.Context, challenge acme.Challenge) error {
|
||||
for _, s := range c.servers {
|
||||
s.PersonalKeyAuth = token
|
||||
s.PersonalKeyAuth = challenge.DNS01KeyAuthorization()
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// CleanUp is called after the run to remove the ACME DNS challenge tokens from DNS records
|
||||
func (c *ChallengeProvider) CleanUp(_, _, _ string) error {
|
||||
func (c *ChallengeProvider) CleanUp(ctx context.Context, _ acme.Challenge) error {
|
||||
for _, s := range c.servers {
|
||||
s.PersonalKeyAuth = ""
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// Wait is a dummy function as we are just going to be ready to answer the challenge from the get-go
|
||||
func (c *ChallengeProvider) Wait(_ context.Context, _ acme.Challenge) error {
|
||||
return nil
|
||||
}
|
Reference in New Issue
Block a user