add global config support
This commit is contained in:
parent
cd1e1a42f3
commit
34d553a890
23 changed files with 1682 additions and 343 deletions
7
main.go
7
main.go
|
|
@ -33,7 +33,7 @@ func init() {
|
|||
parseFlags()
|
||||
loadConfig()
|
||||
loadDatabase(cfg.DB.Filepath)
|
||||
loadtmpltoDB(cfg.Tmpl.Path, cdb)
|
||||
loadtmpltoDB(cfg.Server.CaddyDir+"tmpl", cdb)
|
||||
loadAdminStatus(cdb)
|
||||
initSessionKey()
|
||||
}
|
||||
|
|
@ -89,6 +89,11 @@ func loadtmpltoDB(path string, cdb *db.ConfigDB) {
|
|||
fmt.Printf("Failed to load templates: %v\n", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
err = gen.SetGlobalConfig(cfg, cdb)
|
||||
if err != nil {
|
||||
fmt.Printf("Failed to set global config: %v\n", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
err = gen.Add80SiteConfig(cfg, cdb)
|
||||
if err != nil {
|
||||
fmt.Printf("Failed to add :80 site config: %v\n", err)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue