Documentation
¶
Overview ¶
Package acmedns is SynCloud's own ACME challenge server (acme-dns style): a small authoritative DNS server that answers the TXT records of DNS-01 challenges for one zone, so a domain at any registrar can renew wildcard certificates with a single CNAME and no DNS provider.
It is not a general name server. It answers TXT, plus the zone's SOA and NS, for names under its challenge zone, and refuses everything else.
Index ¶
- Constants
- Variables
- func ValidConfig(c Config) error
- type Config
- type Server
- func (s *Server) Addr() string
- func (s *Server) Close()
- func (s *Server) Config() Config
- func (s *Server) Configure(ctx context.Context, c Config) error
- func (s *Server) Delete(ctx context.Context, id string) error
- func (s *Server) Enabled() bool
- func (s *Server) Load(ctx context.Context) error
- func (s *Server) Put(ctx context.Context, name, value string) (string, error)
- func (s *Server) Status(ctx context.Context) Status
- func (s *Server) Zone() string
- type Status
Constants ¶
const DefaultListen = ":53"
DefaultListen is where the server listens (UDP and TCP).
const SettingKey = "acme_dns"
SettingKey holds the configuration (JSON) in the settings table.
Variables ¶
var ErrOff = errors.New("the challenge server is not set up")
ErrOff means the server has no zone.
Functions ¶
func ValidConfig ¶
ValidConfig checks a configuration (an empty zone switches the server off).
Types ¶
type Config ¶
type Config struct {
Zone string `json:"zone"` // acme.example.com ("" = off)
NS string `json:"ns"` // acme-ns.example.com: an A record to IP, named by the zone's NS record
IP string `json:"ip"` // the controller's public address
}
Config is what the person sets: the zone the server answers for, the name server host that points at it, and its public address.
type Server ¶
type Server struct {
// Listen is the address for UDP and TCP; empty means DefaultListen.
Listen string
// contains filtered or unexported fields
}
Server is the challenge server.
func (*Server) Configure ¶
Configure saves a configuration and (re)starts or stops the listeners. A listen failure does not fail the call: it is shown in the status.
func (*Server) Enabled ¶
Enabled reports whether a zone is configured (the server may still have failed to listen: Status says so).
func (*Server) Put ¶
Put stores a TXT value to answer at a name inside the zone and returns what to hand to Delete.