add global config support
This commit is contained in:
parent
cd1e1a42f3
commit
34d553a890
23 changed files with 1682 additions and 343 deletions
|
|
@ -8,7 +8,6 @@ import (
|
|||
|
||||
type Config struct {
|
||||
Server ServerConfig
|
||||
Tmpl TmplConfig
|
||||
DB DatabaseConfig `toml:"database"`
|
||||
}
|
||||
|
||||
|
|
@ -26,14 +25,6 @@ type ServerConfig struct {
|
|||
CaddyDir string `toml:"caddyDir"`
|
||||
}
|
||||
|
||||
/*
|
||||
[tmpl]
|
||||
path = "./tmpl"
|
||||
*/
|
||||
type TmplConfig struct {
|
||||
Path string `toml:"path"`
|
||||
}
|
||||
|
||||
/*
|
||||
[database]
|
||||
filepath = "sqlite.db"
|
||||
|
|
@ -100,9 +91,6 @@ func DefaultConfig() *Config {
|
|||
Debug: false,
|
||||
CaddyDir: "./",
|
||||
},
|
||||
Tmpl: TmplConfig{
|
||||
Path: "./tmpl",
|
||||
},
|
||||
DB: DatabaseConfig{
|
||||
Filepath: "caddydash.db",
|
||||
},
|
||||
|
|
|
|||
|
|
@ -4,8 +4,5 @@ port = 8080
|
|||
debug = false
|
||||
caddyDir = "./"
|
||||
|
||||
[tmpl]
|
||||
path = "/data/github/WJQSERVER/caddydash/tmpl"
|
||||
|
||||
[database]
|
||||
filepath = "test.db"
|
||||
Loading…
Add table
Add a link
Reference in a new issue