add cert info and renewal api

This commit is contained in:
yusing
2025-02-15 21:50:34 +08:00
parent 7129e2cc9d
commit 16b046bd44
15 changed files with 201 additions and 47 deletions

View File

@@ -51,10 +51,6 @@ You may run "ls-config" to show or dump the current config.`
var Validate = config.Validate
func GetInstance() *Config {
return config.GetInstance().(*Config)
}
func newConfig() *Config {
return &Config{
value: config.DefaultConfig(),
@@ -75,7 +71,7 @@ func Load() (*Config, gperr.Error) {
}
func MatchDomains() []string {
return GetInstance().Value().MatchDomains
return config.GetInstance().Value().MatchDomains
}
func WatchChanges() {
@@ -123,7 +119,7 @@ func Reload() gperr.Error {
// cancel all current subtasks -> wait
// -> replace config -> start new subtasks
GetInstance().Task().Finish("config changed")
config.GetInstance().(*Config).Task().Finish("config changed")
newCfg.Start(StartAllServers)
config.SetInstance(newCfg)
return nil