Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 11 Mar 2023 18:50:07 +0000
From:      bugzilla-noreply@freebsd.org
To:        ports-bugs@FreeBSD.org
Subject:   [Bug 270120] www/caddy: support JSON config files
Message-ID:  <bug-270120-7788@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D270120

            Bug ID: 270120
           Summary: www/caddy: support JSON config files
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: Individual Port(s)
          Assignee: adamw@FreeBSD.org
          Reporter: pawel.krawczyk@hush.com
             Flags: maintainer-feedback?(adamw@FreeBSD.org)
          Assignee: adamw@FreeBSD.org

Caddy v2 native configuration format is plain JSON, which is not supported =
by
the current logic in /usr/local/etc/rc.d/caddy which always sets the --adap=
ter
flag. With this patch, when caddy_adapter=3D"json", Caddy will start with t=
he
config file path but without --adapter, which will imply the JSON format:

diff --git a/www/caddy/files/caddy.in b/www/caddy/files/caddy.in
index 85251ab1c..4314db8d1 100644
--- a/www/caddy/files/caddy.in
+++ b/www/caddy/files/caddy.in
@@ -54,7 +54,11 @@ load_rc_config $name
 export XDG_CONFIG_HOME XDG_DATA_HOME

 command=3D"${caddy_command}"
-caddy_flags=3D"--config ${caddy_config} --adapter ${caddy_adapter}"
+if [ "${caddy_adapter}" =3D "json" ]; then
+        caddy_flags=3D"--config ${caddy_config}"
+else
+        caddy_flags=3D"--config ${caddy_config} --adapter ${caddy_adapter}=
"=20=20
+fi
 pidfile=3D"/var/run/${name}/${name}.pid"

 required_files=3D"${caddy_config} ${caddy_command}"

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-270120-7788>