Stop requiring current working directory to be the location of AdGuardHome.

Fixes #381.
This commit is contained in:
Eugene Bujak
2018-10-17 20:43:26 +03:00
parent a1bc008190
commit a528ed9f94
2 changed files with 13 additions and 6 deletions

View File

@@ -195,8 +195,10 @@ func generateCoreDNSConfigText() (string, error) {
}
var configBytes bytes.Buffer
temporaryConfig := config.CoreDNS
temporaryConfig.FilterFile = filepath.Join(config.ourBinaryDir, config.CoreDNS.FilterFile)
// run the template
err = t.Execute(&configBytes, config.CoreDNS)
err = t.Execute(&configBytes, &temporaryConfig)
if err != nil {
log.Printf("Couldn't generate DNS config: %s", err)
return "", err