From nobody Sat Mar 11 19:59:48 2023 X-Original-To: dev-commits-ports-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PYv051dkwz3y20q; Sat, 11 Mar 2023 19:59:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PYv0517dKz41NG; Sat, 11 Mar 2023 19:59:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678564789; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AKaNeIS+Bc1/o6iQRw2xDA0BxvIPVLuU10+No2RYyD4=; b=BFx00AcuHlhed2jkrAsI7NZjUUHcSA4KNIoKEe35BtmwUsE5W4zqsZnUc5kaFSHxbGMQtU 5Pd2VbcOaEYGF0DvggMGHTDWKPQK91gXzWgPQJBMJKmYKZ22wKp2nkriVYmmu2p9ZmEI+P +GZ7VTxrfFu5BEa0ZB8njSbs5MKVx5p5xBJmT5wWkOtTEXvsQpaPAY+/gqPvxANw0ROS/O BvciEppQh9awZbKPnZPbzvy99Ts1fgTFgXdWAYzPaGz7m6DLbnAKVhUOtRzvaimhTDuxsx ful3pp1ruGv4NriJkd1fUYKwcjV/kTvcUP1xVz2E5ksd//w2v/VRfPGFdssyag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678564789; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AKaNeIS+Bc1/o6iQRw2xDA0BxvIPVLuU10+No2RYyD4=; b=ghX7Y+raE0HUFokltoorKUk/bhAE5NBizCMS2AE3YJOyZKJnj78wJDI0jlXvFVnSXyIAuE Z1t1j7zj1Q65cbDuJzN6fOvAqCc2m9zqxy0SF2SIoN6/j+I35uTJJeZ7OLZp4lBOqCJGKe ZEpocjs4Q5u0m4XLm+mdcatba9QNQ/T3Xu/sl4ZVE6vpZen97VuNLt2MPm4jyIU3nQKoLf NGFoT4Ldl0PnPZko5RWXIC0ZpnDq7iTDPoCsVWmy3JaDscnUA+pMK3KTJx6iQiFEGgfO6P fvrk8+5ibuyEvPKKBP5VPYPHdQ7DLXZu4QxfctkpSDn+JWSRUB2Vf270Sg6bGA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678564789; a=rsa-sha256; cv=none; b=UZXYbvOr9uDvz+RV5K1Gibl0UvNynK4nz1ZHkxDMQwbHzGrRzhFFWgvLCGYTdH0MMR/r6S ERnSNqLyMDmUOaiPAL2jHpM+EqbEwYU91wbWhGq1HDRW//zBft8WYKMpJ84BBDReccIVjR ppaAd+hrsL0jMAhIxrbo1fVJlaE5VPVKzCqM6kTHS5xTlyKVvWs3yWijwJOMtQdR6y7Y94 FrxCVC8aBA3R+j7++tMAs5MApLm7MWoV5lT+Vg+ysXYKsPIDwcboUIg5X3kw3ZXMR18Eyy oFuSpDdfYSpNkXLF4jcRwjkwe96QPWIg39pnKX1YFro4sHQOie1eXyOah3d2dQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PYv0508lxzjXn; Sat, 11 Mar 2023 19:59:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32BJxmkT001923; Sat, 11 Mar 2023 19:59:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32BJxm1c001922; Sat, 11 Mar 2023 19:59:48 GMT (envelope-from git) Date: Sat, 11 Mar 2023 19:59:48 GMT Message-Id: <202303111959.32BJxm1c001922@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Adam Weinberger Subject: git: b45468408f73 - main - www/caddy{,-custom}: Fix startup with JSON configuration List-Id: Commit messages for all branches of the ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-all@freebsd.org X-BeenThere: dev-commits-ports-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: adamw X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b45468408f73857aa7a0f4e62ee852baebb52bfa Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by adamw: URL: https://cgit.FreeBSD.org/ports/commit/?id=b45468408f73857aa7a0f4e62ee852baebb52bfa commit b45468408f73857aa7a0f4e62ee852baebb52bfa Author: Pawel Krawczyk AuthorDate: 2023-03-11 19:57:30 +0000 Commit: Adam Weinberger CommitDate: 2023-03-11 19:59:20 +0000 www/caddy{,-custom}: Fix startup with JSON configuration Caddy supports a wide number of configuration file formats, including its built-in "Caddyfile" format, and the "native" format is JSON. When anything other than the native JSON format is used, caddy needs to be passed the --adapter [formatname] flag (though it automatically handles the case where the config filename is Caddyfile). However, as JSON is the native format, there is no "json" adapter. The added patch drops the --adapter flag when caddy_adapter is "json". PR: 270120 --- www/caddy-custom/Makefile | 2 +- www/caddy-custom/files/caddy.in | 8 +++++++- www/caddy/Makefile | 2 +- www/caddy/files/caddy.in | 8 +++++++- 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/www/caddy-custom/Makefile b/www/caddy-custom/Makefile index c027f598f375..667dc06d78ed 100644 --- a/www/caddy-custom/Makefile +++ b/www/caddy-custom/Makefile @@ -4,7 +4,7 @@ PORTNAME= caddy-custom PORTVERSION= ${CADDY_VERSION}.${XCADDY_VERSION} -PORTREVISION= 5 +PORTREVISION= 6 CATEGORIES= www DISTFILES= # none diff --git a/www/caddy-custom/files/caddy.in b/www/caddy-custom/files/caddy.in index 1fc835401889..7ce2aea7e21b 100644 --- a/www/caddy-custom/files/caddy.in +++ b/www/caddy-custom/files/caddy.in @@ -54,7 +54,6 @@ load_rc_config $name export XDG_CONFIG_HOME XDG_DATA_HOME command="${caddy_command}" -caddy_flags="--config ${caddy_config} --adapter ${caddy_adapter}" pidfile="/var/run/${name}/${name}.pid" required_files="${caddy_config} ${caddy_command}" @@ -63,6 +62,13 @@ start_precmd="caddy_precmd" start_cmd="caddy_start" stop_precmd="caddy_prestop" +# JSON is the native format, so there is no "adapter" for it +if [ "${caddy_adapter}" = "json" ]; then + caddy_flags="--config ${caddy_config}" +else + caddy_flags="--config ${caddy_config} --adapter ${caddy_adapter}" +fi + # Extra Commands extra_commands="configtest reload" configtest_cmd="caddy_execute validate ${caddy_flags}" diff --git a/www/caddy/Makefile b/www/caddy/Makefile index de2eacb0418e..c119180be6b9 100644 --- a/www/caddy/Makefile +++ b/www/caddy/Makefile @@ -1,7 +1,7 @@ PORTNAME= caddy DISTVERSIONPREFIX= v DISTVERSION= 2.6.4 -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES= www DIST_SUBDIR= caddy diff --git a/www/caddy/files/caddy.in b/www/caddy/files/caddy.in index 85251ab1c02a..17724715ae5c 100644 --- a/www/caddy/files/caddy.in +++ b/www/caddy/files/caddy.in @@ -54,7 +54,6 @@ load_rc_config $name export XDG_CONFIG_HOME XDG_DATA_HOME command="${caddy_command}" -caddy_flags="--config ${caddy_config} --adapter ${caddy_adapter}" pidfile="/var/run/${name}/${name}.pid" required_files="${caddy_config} ${caddy_command}" @@ -63,6 +62,13 @@ start_precmd="caddy_precmd" start_cmd="caddy_start" stop_precmd="caddy_prestop" +# JSON is the native format, so there is no "adapter" for it +if [ "${caddy_adapter}" = "json" ]; then + caddy_flags="--config ${caddy_config}" +else + caddy_flags="--config ${caddy_config} --adapter ${caddy_adapter}" +fi + # Extra Commands extra_commands="configtest reload" configtest_cmd="caddy_execute validate ${caddy_flags}"