From nobody Sun Oct 08 12:25:22 2023 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 4S3LwL6MZFz4wWTj; Sun, 8 Oct 2023 12:25:22 +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 4S3LwL5v61z4PJJ; Sun, 8 Oct 2023 12:25:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1696767922; 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=6PCDn2uXSn9qortB+7lIwOeYfgZn0mz3q5hk9I07n10=; b=nv65glWGSlTthkXF1+HD+jEoWG6BTWtEP8crKs+FQZc3Had+qeynN2WgjLR7ukaZJe6uhb EYRAoiaL0QnhpKPB6ScY5NQyWzZSNZNrQK/Jk5bGPFSS4vy+ryX+BE5Zw6hS+EkbqJWG4H Kz8P8D/8AiJBA4v/jf7hE2Dm61TMPBs6DWosUetHG2JoGg/0KUe8SgQd+AyBfADR43mrbi tmMrpShUD0A6+ExJ6hURrW5Pi4XFcfdprvZzxdMcz8uS+8t8XMmc/126jsvCO/f/B7Kv0u oZtrNMIcMnArmT0kAFKis+dQUYT/uLvTHHy0Ub7zSjkzx66wQ32mw6sfPYhCGg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1696767922; a=rsa-sha256; cv=none; b=ul9lBIFuP1TrWUe36ddxPKEoa7FW6cEDTC7Q0p2EecyT2XFCznUSGnFu2PdNx+xdpBc25Y QI1jedT1a5uhFU8L9oKZ5UTn1QKFg0Y92TQjgh1YzikxE3z57WMf34yBRBrgJenPcPf9X+ rpPxBHQJJdn51KWhdwxBkhyz5pDv4+jiiHz/kWbw8izzhW74i0b+DirruL0J22S2ea4oPt D3cDBw3efnX8IBC68Z7D22lDUd77BsJ16JTjHRzpcLF+qT5dZWTefcg8pzf6VmcbP+2JRA K2DDBg61NGFjvEag8Vswa8bX8RJv9d2X4OwKURGRaigD9+sv/z+y2EW+bC/VUw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1696767922; 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=6PCDn2uXSn9qortB+7lIwOeYfgZn0mz3q5hk9I07n10=; b=GRvdqEo+uWNCOVeBr5Rc5LMj0p8RIZezDoe8ebWs530HR8JON7Wwc8kdLrz3zTp0hjSI14 /tFiJU3yiCIxOABsGTlBEtGBoBKazjhgM1263BOYazFVUR2k93fPIXVRHemI6fDszEavGJ R0vmVl/PPLdEqfA79VJ+Rtb0EoN/tCQYGIkJREY5mdwxwOz9E4ogS74id2tb9eQvI/n2GW IifrI2SVXsuxm4NHcukCEG4WWRss71g4kLrxo2woK+f8L2RL6lXNicYmjV9R2CL6OfAFso WqY4dhGOzgVL+NCGU3Vdwqt6yLu6jHqIMJiQ8455hMBStZYR/TW4cxIHRdn8LQ== 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 4S3LwL4xcvz1Bsb; Sun, 8 Oct 2023 12:25:22 +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 398CPMkk089926; Sun, 8 Oct 2023 12:25:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 398CPMDO089923; Sun, 8 Oct 2023 12:25:22 GMT (envelope-from git) Date: Sun, 8 Oct 2023 12:25:22 GMT Message-Id: <202310081225.398CPMDO089923@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Dan Langille Subject: git: 678db807ed62 - main - security/acme.sh: fix post-install script 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: dvl X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 678db807ed62622394f5ce17b7e492a300d10043 Auto-Submitted: auto-generated The branch main has been updated by dvl: URL: https://cgit.FreeBSD.org/ports/commit/?id=678db807ed62622394f5ce17b7e492a300d10043 commit 678db807ed62622394f5ce17b7e492a300d10043 Author: Dan Langille AuthorDate: 2023-10-08 12:22:15 +0000 Commit: Dan Langille CommitDate: 2023-10-08 12:25:19 +0000 security/acme.sh: fix post-install script The install script contained a syntax error which caused the log file to not be created. While here: * rename script from pkg-install to pkg-post-install * include another crontab example which provides additional contet to logging. PR: 274348 --- security/acme.sh/Makefile | 1 + security/acme.sh/files/acme-crontab.in | 24 +++++++++++++++++++++--- security/acme.sh/pkg-install | 11 ----------- security/acme.sh/pkg-post-install | 7 +++++++ 4 files changed, 29 insertions(+), 14 deletions(-) diff --git a/security/acme.sh/Makefile b/security/acme.sh/Makefile index 47af0b99895c..7b383a071e92 100644 --- a/security/acme.sh/Makefile +++ b/security/acme.sh/Makefile @@ -1,5 +1,6 @@ PORTNAME= acme.sh PORTVERSION= 3.0.7 +PORTREVISION= 1 CATEGORIES= security MAINTAINER= dvl@FreeBSD.org diff --git a/security/acme.sh/files/acme-crontab.in b/security/acme.sh/files/acme-crontab.in index ffde51de652f..7793b84a8bf9 100644 --- a/security/acme.sh/files/acme-crontab.in +++ b/security/acme.sh/files/acme-crontab.in @@ -1,5 +1,5 @@ # -# This file should be copied to /usr/local/etc/cron.d/acme +# This file should be copied to %%PREFIX%%/etc/cron.d/acme # use /bin/sh to run commands, overriding the default set by cron #SHELL=/bin/sh @@ -7,6 +7,24 @@ # mail any output to here, no matter whose crontab this is #MAILTO=me@example.org -# set mm and hh to the time (e.g. hh:mm) of day you want the -# cronjob to run +# uncomment, set mm and hh to the time (e.g. hh:mm) of day you want the +# cronjob to run - pick one of the following and enable it. Running more +# than one won't hurt, but you should avoid running them concurrently. +# +# the lockf ensures only one runs at a time if for some reason it never completes. +# I tend to do this for most cronjobs. + + +# This will send only errors to your email, everything else goes to /dev/null +# I find it lacks context. mm hh * * * %%ACME_USER%% %%PREFIX%%/sbin/acme.sh --cron --home /var/db/acme/.acme.sh > /dev/null + +# +# This dumps STDERR and STDOUT to a file and should never generate an email. +# The resulting log file shows any errors in context, which I found more useful for debugging. +# I set this file to rotate daily, since the cronjob also runs daily. +# I still get email if something goes wrong, via the SAVED_MAIL_FROM and +# SAVED_MAIL_TO options in account.conf - I also use NOTIFY_HOOK='pushover,mail' +# which requires setting SAVED_PUSHOVER_TOKEN and SAVED_PUSHOVER_USER. +# +mm hh * * * %%ACME_USER%% /usr/bin/lockf -t 0 /tmp/.acme.sh.cronjob %%PREFIX%%/sbin/acme.sh --cron --home /var/db/acme/.acme.sh > /var/log/acme.sh.cronjob.log 2>&1 diff --git a/security/acme.sh/pkg-install b/security/acme.sh/pkg-install deleted file mode 100644 index 63e21b1daa57..000000000000 --- a/security/acme.sh/pkg-install +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh - -case $2 in - POST-INSTALL) - # create the log file, if it does not exist - if [ !-f /var/log/acme.sh.log ] - then - /usr/bin/install -C -m 640 -o acme -g acme /dev/null /var/log/acme.sh.log - fi - ;; -esac diff --git a/security/acme.sh/pkg-post-install b/security/acme.sh/pkg-post-install new file mode 100644 index 000000000000..7f1b8ddddc63 --- /dev/null +++ b/security/acme.sh/pkg-post-install @@ -0,0 +1,7 @@ +#!/bin/sh + +# create the log file, if it does not exist +if [ ! -f /var/log/acme.sh.log ] +then + /usr/bin/install -C -m 640 -o acme -g acme /dev/null /var/log/acme.sh.log +fi