Skip to content

Commit

Permalink
Deps update (#289)
Browse files Browse the repository at this point in the history
* Dependency version bumps and according fixes & touchups

* Change to async to avoid interactive dialogs

* Move the Let's Encrypt environment selection to proper place
  • Loading branch information
joohoi committed Jan 25, 2022
1 parent 68bb6ab commit a33c09a
Show file tree
Hide file tree
Showing 5 changed files with 390 additions and 148 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.13-alpine AS builder
FROM golang:alpine AS builder
LABEL maintainer="[email protected]"

RUN apk add --update gcc musl-dev git
Expand Down
17 changes: 12 additions & 5 deletions challengeprovider.go
Original file line number Diff line number Diff line change
@@ -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 {
Expand All @@ -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
}
45 changes: 23 additions & 22 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,38 +1,39 @@
module github.com/joohoi/acme-dns

go 1.13
go 1.16

require (
github.com/BurntSushi/toml v0.3.1
github.com/DATA-DOG/go-sqlmock v1.3.3
github.com/BurntSushi/toml v0.4.1
github.com/DATA-DOG/go-sqlmock v1.5.0
github.com/ajg/form v1.5.1 // indirect
github.com/cenkalti/backoff v2.2.1+incompatible // indirect
github.com/caddyserver/certmagic v0.15.2
github.com/erikstmartin/go-testdb v0.0.0-20160219214506-8d10e4a1bae5
github.com/fasthttp-contrib/websocket v0.0.0-20160511215533-1f3b11f56072 // indirect
github.com/gavv/httpexpect v2.0.0+incompatible
github.com/go-acme/lego v2.7.2+incompatible
github.com/go-acme/lego/v3 v3.1.0
github.com/google/uuid v1.1.1
github.com/gorilla/websocket v1.4.1 // indirect
github.com/go-acme/lego/v3 v3.9.0
github.com/google/uuid v1.3.0
github.com/gorilla/websocket v1.4.2 // indirect
github.com/imkira/go-interpol v1.1.0 // indirect
github.com/julienschmidt/httprouter v1.3.0
github.com/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88 // indirect
github.com/lib/pq v1.2.0
github.com/mattn/go-colorable v0.1.4 // indirect
github.com/mattn/go-sqlite3 v1.11.0
github.com/mholt/certmagic v0.8.1-0.20191019173955-6f9f0e6dd0e8
github.com/miekg/dns v1.1.22
github.com/lib/pq v1.10.4
github.com/mattn/go-colorable v0.1.12 // indirect
github.com/mattn/go-sqlite3 v1.14.10
github.com/mholt/acmez v1.0.1
github.com/miekg/dns v1.1.45
github.com/moul/http2curl v1.0.0 // indirect
github.com/rs/cors v1.7.0
github.com/sergi/go-diff v1.0.0 // indirect
github.com/sirupsen/logrus v1.4.2
github.com/valyala/fasthttp v1.5.0 // indirect
github.com/xeipuuv/gojsonschema v1.2.0 // indirect
github.com/rs/cors v1.8.2
github.com/sergi/go-diff v1.2.0 // indirect
github.com/sirupsen/logrus v1.8.1
github.com/valyala/fasthttp v1.31.0 // indirect
github.com/yalp/jsonpath v0.0.0-20180802001716-5cc68e5049a0 // indirect
github.com/yudai/gojsondiff v1.0.0 // indirect
github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82 // indirect
github.com/yudai/pp v2.0.1+incompatible // indirect
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550
golang.org/x/net v0.0.0-20191014212845-da9a3fd4c582 // indirect
golang.org/x/sys v0.0.0-20191010194322-b09406accb47 // indirect
go.uber.org/atomic v1.9.0 // indirect
go.uber.org/multierr v1.7.0 // indirect
go.uber.org/zap v1.20.0 // indirect
golang.org/x/crypto v0.0.0-20211215153901-e495a2d5b3d3
golang.org/x/net v0.0.0-20220107192237-5cfca573fb4d // indirect
golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e // indirect
golang.org/x/tools v0.1.8 // indirect
)
Loading

0 comments on commit a33c09a

Please sign in to comment.