aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Miek Gieben <miek@miek.nl> 2016-08-29 14:39:24 +0100
committerGravatar Miek Gieben <miek@miek.nl> 2016-08-29 14:39:24 +0100
commit2eac03896b43cfb42a092ec68ba73a6a41176f24 (patch)
tree7ae39342f9cd49654502404812db3ada6bebfbb7
parentda5d7bea4bcc637447b19fa3b064ddab1436945e (diff)
downloadcoredns-2eac03896b43cfb42a092ec68ba73a6a41176f24.tar.gz
coredns-2eac03896b43cfb42a092ec68ba73a6a41176f24.tar.zst
coredns-2eac03896b43cfb42a092ec68ba73a6a41176f24.zip
Use Corefile
Fix the code copied from Caddy to refer to Corefile and make 'coredns' with flags pickup a local Corefile. Also remove some references to Caddy in the docs and output of coredns. Fixes #235
-rw-r--r--coremain/run.go11
1 files changed, 6 insertions, 5 deletions
diff --git a/coremain/run.go b/coremain/run.go
index e33b6843f..16044131c 100644
--- a/coremain/run.go
+++ b/coremain/run.go
@@ -20,9 +20,10 @@ import (
func init() {
caddy.TrapSignals()
+ caddy.DefaultConfigFile = "Corefile"
setVersion()
- flag.StringVar(&conf, "conf", "", "Caddyfile to load (default \""+caddy.DefaultConfigFile+"\")")
+ flag.StringVar(&conf, "conf", "", "Corefile to load (default \""+caddy.DefaultConfigFile+"\")")
flag.StringVar(&cpu, "cpu", "100%", "CPU cap")
flag.BoolVar(&plugins, "plugins", false, "List installed plugins")
flag.StringVar(&logfile, "log", "", "Process log file")
@@ -76,14 +77,14 @@ func Run() {
mustLogFatal(err)
}
- // Get Caddyfile input
- caddyfile, err := caddy.LoadCaddyfile(serverType)
+ // Get Corefile input
+ corefile, err := caddy.LoadCaddyfile(serverType)
if err != nil {
mustLogFatal(err)
}
// Start your engines
- instance, err := caddy.Start(caddyfile)
+ instance, err := caddy.Start(corefile)
if err != nil {
mustLogFatal(err)
}
@@ -126,7 +127,7 @@ func confLoader(serverType string) (caddy.Input, error) {
}, nil
}
-// defaultLoader loads the Caddyfile from the current working directory.
+// defaultLoader loads the Corefile from the current working directory.
func defaultLoader(serverType string) (caddy.Input, error) {
contents, err := ioutil.ReadFile(caddy.DefaultConfigFile)
if err != nil {