Fix #579
1. Added --workdir command-line argument that lets configure the working dir. 2. Made "dnsforward" use this workdir parameter when saving/reading querylog. 3. Reworked "dnsforward" -- moved http handlers out of there to control.go
This commit is contained in:
@@ -28,7 +28,7 @@ type logSettings struct {
|
||||
// field ordering is important -- yaml fields will mirror ordering from here
|
||||
type configuration struct {
|
||||
ourConfigFilename string // Config filename (can be overridden via the command line arguments)
|
||||
ourBinaryDir string // Location of our directory, used to protect against CWD being somewhere else
|
||||
ourWorkingDir string // Location of our directory, used to protect against CWD being somewhere else
|
||||
firstRun bool // if set to true, don't run any services except HTTP web inteface, and serve only first-run html
|
||||
|
||||
BindHost string `yaml:"bind_host"`
|
||||
@@ -92,7 +92,7 @@ var config = configuration{
|
||||
func (c *configuration) getConfigFilename() string {
|
||||
configFile := config.ourConfigFilename
|
||||
if !filepath.IsAbs(configFile) {
|
||||
configFile = filepath.Join(config.ourBinaryDir, config.ourConfigFilename)
|
||||
configFile = filepath.Join(config.ourWorkingDir, config.ourConfigFilename)
|
||||
}
|
||||
return configFile
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user