From nobody Thu Sep 29 15:02:06 2022 X-Original-To: dev-commits-ports-main@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 4Mdc5q0wlHz4d2YD; Thu, 29 Sep 2022 15:02:07 +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 4Mdc5q0PLdz3tSB; Thu, 29 Sep 2022 15:02:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1664463727; 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=pk0YWkmM9wZrhiGDr0MX88OvorMETmBdMemCuSoAp+A=; b=AAvOHqdvnYhqiLTzy65J4Xrh4cP8Irs7Qney4L7XzSrdEqObsRJZbILiWBH/3aIcrLZPRi /9M/aa9A+lzwRGt/lCajVfgVz2s7hDneWsVDQEzJO188Rb70zPp6uNrBdHyLxD1zWAAh4N HTlyU9tjyZjHnHVAvtyZgE44l2ZQbL1wKwznXHxRXZPPUX5ASO5+QgsZRGdYrJ95Q5SI+p rt0kCwJ/SaY5oganlnQlEXkGgczZcRX+p34GaNZfVrBHqunsk+heOv0dhebpAS6Z7x3fv1 sQKABADtvcWP73gjaWBkCsALLHmDsitsrEOChVEQtVFqu261cpNqn/1HYPMGcw== 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 4Mdc5p6Y3YzrWy; Thu, 29 Sep 2022 15:02:06 +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 28TF26cl076985; Thu, 29 Sep 2022 15:02:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 28TF26lO076984; Thu, 29 Sep 2022 15:02:06 GMT (envelope-from git) Date: Thu, 29 Sep 2022 15:02:06 GMT Message-Id: <202209291502.28TF26lO076984@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: 91e5f354f579 - main - www/caddy: Allow setting the path to the caddy binary List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-main@freebsd.org X-BeenThere: dev-commits-ports-main@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: 91e5f354f57911097e3548501f959ab09d829804 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1664463727; 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=pk0YWkmM9wZrhiGDr0MX88OvorMETmBdMemCuSoAp+A=; b=CQMupvg3WxL8kiCB7w0LxsQ4on9IUM/fLjYSrR9csMtdfPyh10kErG6DwgIH0X7AMBwc4q spgB/haDdGqUVgnrQMqXnWDHRlIaz0U0SS/uHDOZcWKeqJUinbYms65HnjUS65eTIBUOP0 bPgqN1E/lM9oa/ZR6q4yfnSx+OlVD8XWkunZ/NA2oFjuZdQEEP03cP3gHqnRGjVqmfsmxU RSObEA0oKjHMtFlXnDGMKLqDW64f9N6VBOHMj/SCCU0xbteBLbUS3sIiVfAAf4hYj1L1FA pjIxnHXMT1upBLO9n8em35M2uhY/PLMmDqnTyUkK4Srg6GYrakcCwMGPS3c3uQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1664463727; a=rsa-sha256; cv=none; b=vlNSZr7W3zNNFMz/f3aN/Wj5ZysrvEoTYUAFdxyfSQB3YQreaKamEhieI+Mcl+jWgfpzOG mwPEcuLc2Ne57sbOspKunbuXrpTrJ8aDfdW0RQyOrxVb+984uwcofEcYkjHZMwy07wu5JV QOD7mlYbBo4JM/uruU7hmt/wNRZiBtDhtPZwck1OFC2zbbPSZFOM59TUVE0QSh5APDc7Bz uRCCwvCrhqEO+Pvb0LDQa+6fOe2+h3uLeKKvIlhruWYYTyfzV330ZhOAreTQUkBVSXLF5Z IZuu9O17/IadhsbYhwRIlZAnYXsI6K7jujgJjAR1yAY09UKZKTRCkoRIV7ovYA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by adamw: URL: https://cgit.FreeBSD.org/ports/commit/?id=91e5f354f57911097e3548501f959ab09d829804 commit 91e5f354f57911097e3548501f959ab09d829804 Author: Adam Weinberger AuthorDate: 2022-09-29 15:00:43 +0000 Commit: Adam Weinberger CommitDate: 2022-09-29 15:02:02 +0000 www/caddy: Allow setting the path to the caddy binary This will make the rc(8) script more usable for users who build caddy with xcaddy (www/xcaddy). --- www/caddy/Makefile | 2 +- www/caddy/files/caddy.in | 19 ++++++++++--------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/www/caddy/Makefile b/www/caddy/Makefile index 58338dfa1f1d..14629b7b0cbf 100644 --- a/www/caddy/Makefile +++ b/www/caddy/Makefile @@ -1,7 +1,7 @@ PORTNAME= caddy DISTVERSIONPREFIX= v DISTVERSION= 2.6.1 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= www DIST_SUBDIR= caddy diff --git a/www/caddy/files/caddy.in b/www/caddy/files/caddy.in index 300a0ff23575..45c6b83dafb8 100644 --- a/www/caddy/files/caddy.in +++ b/www/caddy/files/caddy.in @@ -8,6 +8,7 @@ # /etc/rc.conf.local # Optional settings: +# caddy_command (string): Full path to the caddy binary # caddy_config (string): Full path to caddy config file # (%%ETCDIR%%/Caddyfile) # caddy_adapter (string): Config adapter type (caddyfile) @@ -38,7 +39,8 @@ load_rc_config $name # Defaults : ${caddy_enable:=NO} : ${caddy_adapter:=caddyfile} -: ${caddy_config:=%%ETCDIR%%/Caddyfile} +: ${caddy_config:="%%ETCDIR%%/Caddyfile"} +: ${caddy_command:="%%PREFIX%%/bin/${name}"} : ${caddy_directory:=/var/db/caddy} : ${caddy_extra_flags:=""} : ${caddy_logdir:="/var/log/${name}"} @@ -51,11 +53,10 @@ load_rc_config $name : ${XDG_DATA_HOME:="${caddy_directory}/data"} export XDG_CONFIG_HOME XDG_DATA_HOME -command="%%PREFIX%%/bin/${name}" caddy_flags="--config ${caddy_config} --adapter ${caddy_adapter}" pidfile="/var/run/${name}/${name}.pid" -required_files="${caddy_config} ${command}" +required_files="${caddy_config} ${caddy_command}" start_precmd="caddy_precmd" start_cmd="caddy_start" @@ -63,12 +64,12 @@ stop_precmd="caddy_prestop" # Extra Commands extra_commands="configtest reload" -configtest_cmd="caddy_command validate ${caddy_flags}" -reload_cmd="caddy_command reload ${caddy_flags}" +configtest_cmd="caddy_execute validate ${caddy_flags}" +reload_cmd="caddy_execute reload ${caddy_flags}" -caddy_command() +caddy_execute() { - /usr/bin/su -m "${caddy_user}" -c "${command} $*" + /usr/bin/su -m "${caddy_user}" -c "${caddy_command} $*" } caddy_precmd() @@ -90,7 +91,7 @@ caddy_precmd() caddy_start() { echo -n "Starting caddy... " - /usr/bin/su -m ${caddy_user} -c "${command} start ${caddy_flags} \ + /usr/bin/su -m ${caddy_user} -c "${caddy_command} start ${caddy_flags} \ ${caddy_extra_flags} --pidfile ${pidfile}" >> ${caddy_logfile} 2>&1 if [ $? -eq 0 ] && ps -ax -o pid | grep -q "$(cat ${pidfile})"; then echo "done" @@ -107,7 +108,7 @@ caddy_prestop() echo -n "Stopping caddy... " - result="$(caddy_command stop 2>&1)" + result="$(caddy_execute stop 2>&1)" if [ ${?} -eq 0 ]; then echo "done" exit 0