Commit 3cef6674 authored by Manuel Stocker's avatar Manuel Stocker Committed by Miek Gieben

plugin/dnssec: Add root support (#2195)

parent 6d2bc0a8
......@@ -2,6 +2,7 @@ package dnssec
import (
"fmt"
"path"
"strconv"
"strings"
......@@ -113,6 +114,7 @@ func dnssecParse(c *caddy.Controller) ([]string, []*DNSKEY, int, error) {
func keyParse(c *caddy.Controller) ([]*DNSKEY, error) {
keys := []*DNSKEY{}
config := dnsserver.GetConfig(c)
if !c.NextArg() {
return nil, c.ArgErr()
......@@ -133,6 +135,9 @@ func keyParse(c *caddy.Controller) ([]*DNSKEY, error) {
if strings.HasSuffix(k, ".private") {
base = k[:len(k)-8]
}
if !path.IsAbs(base) && config.Root != "" {
base = path.Join(config.Root, base)
}
k, err := ParseKeyFile(base+".key", base+".private")
if err != nil {
return nil, err
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment