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

@ -105,7 +105,7 @@ func StopCaddy() touka.HandlerFunc {
return
}
client := c.GetHTTPC()
rb := client.NewRequestBuilder("POST", "http://127.0.0.1:2019/stop")
rb := client.NewRequestBuilder("POST", "http://localhost:2019/stop")
resp, err := rb.Execute()
if err != nil {
c.JSON(500, map[string]string{"error": err.Error()})
@ -139,7 +139,7 @@ func RestartCaddy(cfg *config.Config) touka.HandlerFunc {
// StopCaddy
client := c.GetHTTPC()
rb := client.NewRequestBuilder("POST", "http://127.0.0.1:2019/stop")
rb := client.NewRequestBuilder("POST", "http://localhost:2019/stop")
resp, err := rb.Execute()
if err != nil {
c.JSON(500, map[string]string{"error": err.Error()})