dns already taken

This commit is contained in:
saces 2026-02-16 23:29:45 +01:00
parent 65945b6e73
commit 5604c3232a
5 changed files with 10 additions and 10 deletions

View file

@ -122,7 +122,7 @@ To use this module for the ACME DNS challenge, [configure the ACME issuer in you
{ {
"module": "acme", "module": "acme",
"challenges": { "challenges": {
"dns": { "dns01": {
"provider": { "provider": {
"name": "internal" "name": "internal"
} }
@ -152,7 +152,7 @@ Both are optional.
```json ```json
{ {
"apps": { "apps": {
"dns": { "dns01": {
"address": "192.0.2.123:53", "address": "192.0.2.123:53",
"records": [ "records": [
"example.com.\t3600\tIN\tA\t192.0.2.123" "example.com.\t3600\tIN\tA\t192.0.2.123"

View file

@ -28,7 +28,7 @@ type App struct {
func (App) CaddyModule() caddy.ModuleInfo { func (App) CaddyModule() caddy.ModuleInfo {
return caddy.ModuleInfo{ return caddy.ModuleInfo{
ID: "dns", ID: "dns01",
New: func() caddy.Module { return &App{} }, New: func() caddy.Module { return &App{} },
} }
} }
@ -155,7 +155,7 @@ func (a *App) UnmarshalCaddyfile(d *caddyfile.Dispenser) error {
return nil return nil
} }
// parseApp configures the "dns" global option from Caddyfile. // parseApp configures the "dns01" global option from Caddyfile.
// Syntax: // Syntax:
// //
// dns [address] { // dns [address] {
@ -176,7 +176,7 @@ func parseApp(d *caddyfile.Dispenser, prev interface{}) (interface{}, error) {
// tell Caddyfile adapter that this is the JSON for an app // tell Caddyfile adapter that this is the JSON for an app
return httpcaddyfile.App{ return httpcaddyfile.App{
Name: "dns", Name: "dns01",
Value: caddyconfig.JSON(a, &warnings), Value: caddyconfig.JSON(a, &warnings),
}, nil }, nil
} }

View file

@ -27,11 +27,11 @@ func (Provider) CaddyModule() caddy.ModuleInfo {
// Provision sets up the module. Implements caddy.Provisioner. // Provision sets up the module. Implements caddy.Provisioner.
func (p *Provider) Provision(ctx caddy.Context) error { func (p *Provider) Provision(ctx caddy.Context) error {
p.logger = ctx.Logger() p.logger = ctx.Logger()
_, err := ctx.AppIfConfigured("dns") _, err := ctx.AppIfConfigured("dns01")
if err != nil { if err != nil {
p.logger.Warn("DNS app not yet configured") p.logger.Warn("DNS app not yet configured")
} }
app, err := ctx.App("dns") app, err := ctx.App("dns01")
if err != nil { if err != nil {
return err return err
} }

View file

@ -43,7 +43,7 @@ const dns_only_json string = `{
} }
}, },
"apps": { "apps": {
"dns": { "dns01": {
"address": "127.0.0.1:53535", "address": "127.0.0.1:53535",
"records": [ "records": [
"sub123.example.com.\t3600\tIN\tA\t127.0.0.1", "sub123.example.com.\t3600\tIN\tA\t127.0.0.1",
@ -79,7 +79,7 @@ const dns_but_empty_json string = `{
} }
}, },
"apps": { "apps": {
"dns": { "dns01": {
"address": "127.0.0.1:53535" "address": "127.0.0.1:53535"
} }
} }

View file

@ -21,7 +21,7 @@ func init() {
caddy.RegisterModule(App{}) caddy.RegisterModule(App{})
caddy.RegisterModule(Provider{}) caddy.RegisterModule(Provider{})
httpcaddyfile.RegisterGlobalOption("dns", parseApp) httpcaddyfile.RegisterGlobalOption("dns01", parseApp)
} }
func record_to_rr(zone string, record libdns.Record) (dns.RR, error) { func record_to_rr(zone string, record libdns.Record) (dns.RR, error) {