From 1cbf44e25ebf34ea7a1896ec2dfb682cf5a945a9 Mon Sep 17 00:00:00 2001 From: Robert Landers Date: Tue, 23 Jul 2024 23:56:05 +0200 Subject: [PATCH] add admin option to php-server for easier debugging --- caddy/php-server.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/caddy/php-server.go b/caddy/php-server.go index a66c46adca..481f32791c 100644 --- a/caddy/php-server.go +++ b/caddy/php-server.go @@ -52,6 +52,7 @@ For more advanced use cases, see https://github.com/dunglas/frankenphp/blob/main cmd.Flags().BoolP("debug", "v", false, "Enable verbose debug logs") cmd.Flags().BoolP("mercure", "m", false, "Enable the built-in Mercure.rocks hub") cmd.Flags().BoolP("no-compress", "", false, "Disable Zstandard, Brotli and Gzip compression") + cmd.Flags().BoolP("admin", "", false, "Enable the admin API") cmd.RunE = caddycmd.WrapCommandFuncForCobra(cmdPHPServer) }, }) @@ -68,6 +69,7 @@ func cmdPHPServer(fs caddycmd.Flags) (int, error) { debug := fs.Bool("debug") compress := !fs.Bool("no-compress") mercure := fs.Bool("mercure") + admin := fs.Bool("admin") workers, err := fs.GetStringArray("worker") if err != nil { @@ -298,7 +300,7 @@ func cmdPHPServer(fs caddycmd.Flags) (int, error) { var false bool cfg := &caddy.Config{ Admin: &caddy.AdminConfig{ - Disabled: true, + Disabled: !admin, Config: &caddy.ConfigSettings{ Persist: &false, },