Commit 2eac0389 authored by Miek Gieben's avatar Miek Gieben

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
parent da5d7bea
...@@ -20,9 +20,10 @@ import ( ...@@ -20,9 +20,10 @@ import (
func init() { func init() {
caddy.TrapSignals() caddy.TrapSignals()
caddy.DefaultConfigFile = "Corefile"
setVersion() 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.StringVar(&cpu, "cpu", "100%", "CPU cap")
flag.BoolVar(&plugins, "plugins", false, "List installed plugins") flag.BoolVar(&plugins, "plugins", false, "List installed plugins")
flag.StringVar(&logfile, "log", "", "Process log file") flag.StringVar(&logfile, "log", "", "Process log file")
...@@ -76,14 +77,14 @@ func Run() { ...@@ -76,14 +77,14 @@ func Run() {
mustLogFatal(err) mustLogFatal(err)
} }
// Get Caddyfile input // Get Corefile input
caddyfile, err := caddy.LoadCaddyfile(serverType) corefile, err := caddy.LoadCaddyfile(serverType)
if err != nil { if err != nil {
mustLogFatal(err) mustLogFatal(err)
} }
// Start your engines // Start your engines
instance, err := caddy.Start(caddyfile) instance, err := caddy.Start(corefile)
if err != nil { if err != nil {
mustLogFatal(err) mustLogFatal(err)
} }
...@@ -126,7 +127,7 @@ func confLoader(serverType string) (caddy.Input, error) { ...@@ -126,7 +127,7 @@ func confLoader(serverType string) (caddy.Input, error) {
}, nil }, 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) { func defaultLoader(serverType string) (caddy.Input, error) {
contents, err := ioutil.ReadFile(caddy.DefaultConfigFile) contents, err := ioutil.ReadFile(caddy.DefaultConfigFile)
if err != nil { if err != nil {
......
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