add env init

This commit is contained in:
wjqserver 2025-06-20 19:08:03 +08:00
parent 8736847912
commit 9ec789f4bb
4 changed files with 259 additions and 3 deletions

View file

@ -36,8 +36,8 @@ func RunCaddy(cfg *config.Config) error {
return nil
}
ctx, cancel := context.WithCancel(context.Background())
caddyPath := cfg.Server.CaddyDir + "caddy"
cmd := exec.CommandContext(ctx, caddyPath, "run", "--config", "Caddyfile")
cmd := exec.CommandContext(ctx, "./caddy", "run", "--config", "Caddyfile")
cmd.Dir = cfg.Server.CaddyDir
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
caddyRunning.SetRunning(true)