mirror of
https://github.com/MarekWojt/gertdns.git
synced 2025-12-15 12:59:53 +01:00
Compare commits
2 Commits
80c2a5717b
...
91709e65bd
| Author | SHA1 | Date | |
|---|---|---|---|
| 91709e65bd | |||
| 0e5a3d7361 |
@@ -57,7 +57,7 @@ Default: `auth.toml`
|
||||
### --data-path
|
||||
Will define where stored data is put (i.e. IP addresses for subdomains). All records will be saved here every second if they have been changed and when the application gets shut down.
|
||||
Type: `string`
|
||||
Default: `./`
|
||||
Default: `.`
|
||||
|
||||
## Routes
|
||||
### `/`
|
||||
|
||||
@@ -89,7 +89,10 @@ func loadFile(ty string, currentDomain *domain) {
|
||||
f, err := os.Open(filePath)
|
||||
if err != nil {
|
||||
color.Warnf("Could not load file for domain %s: %s\n", currentDomain.Root, err)
|
||||
} else {
|
||||
return
|
||||
}
|
||||
defer f.Close()
|
||||
|
||||
log.Printf("Reading file: %s", filePath)
|
||||
scanner := bufio.NewScanner(f)
|
||||
|
||||
@@ -110,8 +113,6 @@ func loadFile(ty string, currentDomain *domain) {
|
||||
}
|
||||
}
|
||||
color.Infof("Read file: %s\n", filePath)
|
||||
}
|
||||
f.Close()
|
||||
}
|
||||
|
||||
func Init(dataPath string) {
|
||||
|
||||
2
main.go
2
main.go
@@ -17,7 +17,7 @@ import (
|
||||
var (
|
||||
configFile = flag.String("config-file", "conf.toml", "Path to configuration file")
|
||||
authFile = flag.String("auth-file", "auth.toml", "Path to authentication file")
|
||||
dataPath = flag.String("data-path", "./", "Where to save data")
|
||||
dataPath = flag.String("data-path", ".", "Where to save data")
|
||||
enableDebugMode = flag.Bool("enable-debug-mode", false, "Enables debug mode, will output a list of all registered records on the index page of the HTTP server")
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user