add global config support

This commit is contained in:
wjqserver 2025-06-30 15:31:14 +08:00
parent cd1e1a42f3
commit 34d553a890
23 changed files with 1682 additions and 343 deletions

View file

@ -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",
},