From nobody Wed Jan 17 11:49:30 2024 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 4TFPLM0ST0z57fyj; Wed, 17 Jan 2024 11:49:31 +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 4TFPLL71BZz4jw7; Wed, 17 Jan 2024 11:49:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705492171; 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=5QqUg8Whhnb0NmUNkfP1tzJJUPDM+XTUD9rNpvRRWqQ=; b=NHof5EN6aAXV/9z3BgzwqykPMsA8cbLee6s4B4VpruP4dwClyalVq30aFE9JjV+ykfe4Ru wZS37LfaR26lkDwNJbkuPxEf0eTydVw2z5OQzAsSXZ18yee6t+6Z7xyZz7Fy6mXHZaOFTu gSwsDPdgXyt/Kw27FubJmzG0szBclZ/I2KnYfFP+H6SU9GgHy6e37Ljp5/0zGr4XVmyZ0b 72cnt15uKmhSLlYmGZbm9NjakXotmEiGm1JuKssXELuIWzQOlPeNGRTPJP8+NEdzUfVG2a XR2mAv02UVZ9PBHXUNDOJB2h/WhKC7cxHNrMLBEXw4fcO9YZWXktg6chqlUiHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705492171; 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=5QqUg8Whhnb0NmUNkfP1tzJJUPDM+XTUD9rNpvRRWqQ=; b=ccwfoCSQFME//C6027eCuXinlmQzihby9xu28EaOrljhBi1YdvztGcaISHA0o4wR223maw SbVey67v3+Yoz80kesZu2105lmiMO3GX5Gnur4e9ccQcsYLYrHhAis9cbxIwRX+/6DcXlA 5aqB74Ipht4pxK8lfGhebR6BBabg2jLqtH+eA9bLHxYJyFAWZcpihNrcFW5nsr7eb8gLJc 6I+mKsYJOZBolZXrXwUDA8w6vvi8Bs9375Wz/nz2uFmLK6RETbSqRkbGs/PCXj7SdVfnJG Si4xya/ougBFF3MaWo73MOXC1hebG/UYBbB+dQHcRnMUHVQq79qDpV+TcdH4mw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705492171; a=rsa-sha256; cv=none; b=NuO6rNSju7kU5zUgC3lDqnEbdFz3xDvEwE/hab3Sg6oA99cw8xXjU2953BHiOQNCkJpghp 0V81QWDrt4BlvpCTrZWuvOHx5+WcMYv2rpapRCDXI/1LDgiGjgWukSja1YNcgW/iY6yjg2 woUn0ISiDfI+8Z6dNVf9ii37AfvuI8mEnA4tZNja2AXiHi8M271WSbzsObLIdbzD5yI8+3 AYe1NaPT7gy9udEZtZh0wfKJVQs1ZwMz9MYQX+pDLgtVg6ny5M2x4OY2Q8ThV3ZUQAZ1eO Z9iHsY/kQOXODKeTqJLixS5MB2mHctPVEtbNTLPxA34KKryhnTWbLph+9sz6Rw== 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 4TFPLL61pZzMq3; Wed, 17 Jan 2024 11:49:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40HBnU5S090901; Wed, 17 Jan 2024 11:49:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40HBnUwp090898; Wed, 17 Jan 2024 11:49:30 GMT (envelope-from git) Date: Wed, 17 Jan 2024 11:49:30 GMT Message-Id: <202401171149.40HBnUwp090898@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: 2d925f150358 - main - www/caddy{,-custom}: Fix start/stop with admin API disabled 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: 2d925f150358bf061d4fec9bb8caa009e0a56442 Auto-Submitted: auto-generated The branch main has been updated by adamw: URL: https://cgit.FreeBSD.org/ports/commit/?id=2d925f150358bf061d4fec9bb8caa009e0a56442 commit 2d925f150358bf061d4fec9bb8caa009e0a56442 Author: Adam Weinberger AuthorDate: 2024-01-17 11:41:24 +0000 Commit: Adam Weinberger CommitDate: 2024-01-17 11:49:24 +0000 www/caddy{,-custom}: Fix start/stop with admin API disabled Caddy largely relies on the admin API for state control, like start/stop/reload. However, the admin API endpoints are inherently a security risk. Although the admin API is enabled by default, many users may choose to disable it. However, the rc(8) script then needs an alternative approach to controlling the daemon. We already sortof supported signal-based control, but it didn't always work, because there are multiple error messages that indicate that the admin API is disabled (and none of them actually say that in a clear way). This commit fixes start and stop with the admin API disabled. The reload command (and reloadssl) still require the admin API to be enabled and will fail if the admin API is disabled. PR: 255106 Submitted by: scf --- www/caddy-custom/Makefile | 2 +- www/caddy-custom/files/caddy.in | 4 +++- www/caddy/Makefile | 1 + www/caddy/files/caddy.in | 4 +++- 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/www/caddy-custom/Makefile b/www/caddy-custom/Makefile index 9b12d33b97af..19ddef881324 100644 --- a/www/caddy-custom/Makefile +++ b/www/caddy-custom/Makefile @@ -4,7 +4,7 @@ PORTNAME= caddy-custom PORTVERSION= ${CADDY_VERSION}.${XCADDY_VERSION} -PORTREVISION= 11 +PORTREVISION= 12 CATEGORIES= www DISTFILES= # none diff --git a/www/caddy-custom/files/caddy.in b/www/caddy-custom/files/caddy.in index ac1098bcd130..fc1f74e1de55 100644 --- a/www/caddy-custom/files/caddy.in +++ b/www/caddy-custom/files/caddy.in @@ -150,7 +150,9 @@ caddy_prestop() echo "done" exit 0 else - if echo "${result}" | grep -q "connection refused"; then + if echo "${result}" | grep -q -e "connection refused" \ + -e "connect: no such file or directory"; then + echo "admin interface unavailable; using pidfile" return 0 else diff --git a/www/caddy/Makefile b/www/caddy/Makefile index 6d9545d465bd..b6bf4f6044db 100644 --- a/www/caddy/Makefile +++ b/www/caddy/Makefile @@ -1,6 +1,7 @@ PORTNAME= caddy DISTVERSIONPREFIX= v DISTVERSION= 2.7.6 +PORTREVISION= 1 CATEGORIES= www DIST_SUBDIR= caddy diff --git a/www/caddy/files/caddy.in b/www/caddy/files/caddy.in index 37babe7889d3..34b0157f1d00 100644 --- a/www/caddy/files/caddy.in +++ b/www/caddy/files/caddy.in @@ -150,7 +150,9 @@ caddy_prestop() echo "done" exit 0 else - if echo "${result}" | grep -q "connection refused"; then + if echo "${result}" | grep -q -e "connection refused" \ + -e "connect: no such file or directory"; then + echo "admin interface unavailable; using pidfile" return 0 else