Skip to content

Commit

Permalink
add cmd/coredns
Browse files Browse the repository at this point in the history
  • Loading branch information
jwhited committed May 26, 2020
1 parent f409283 commit 4f2477b
Show file tree
Hide file tree
Showing 3 changed files with 90 additions and 2 deletions.
25 changes: 25 additions & 0 deletions cmd/coredns/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package main

import (
_ "github.com/coredns/coredns/core/plugin"
_ "github.com/jwhited/wgsd"

"github.com/coredns/coredns/core/dnsserver"
"github.com/coredns/coredns/coremain"
)

func init() {
// plugin ordering matters, insert wgsd with other "authoritative" plugins.
for i, name := range dnsserver.Directives {
if name == "file" {
dnsserver.Directives = append(dnsserver.Directives[:i],
append([]string{"wgsd"}, dnsserver.Directives[i:]...)...)
return
}
}
panic("file plugin not found in dnsserver.Directives")
}

func main() {
coremain.Run()
}
1 change: 0 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,5 @@ require (
github.com/caddyserver/caddy v1.0.5
github.com/coredns/coredns v1.6.9
github.com/miekg/dns v1.1.29
github.com/prometheus/common v0.9.1
golang.zx2c4.com/wireguard/wgctrl v0.0.0-20200511024508-91d9787b944f
)
Loading

0 comments on commit 4f2477b

Please sign in to comment.