www/caddy{,-custom}: chown caddy.log to caddy user/group

We have set caddy.log to root:wheel, which works for the default case
of running caddy as root.

When caddy is run as a non-root users, caddy.log can't actually be
written to. Instead, chown caddy.log to the caddy user/group so that
it can be written to.

PR:		276150
This commit is contained in:
Mike Fisher 2024-01-21 08:04:55 -05:00 committed by Adam Weinberger
parent b8b00b0de7
commit 5c6886afad
4 changed files with 6 additions and 6 deletions

View file

@ -4,7 +4,7 @@
PORTNAME= caddy-custom
PORTVERSION= ${CADDY_VERSION}.${XCADDY_VERSION}
PORTREVISION= 12
PORTREVISION= 13
CATEGORIES= www
DISTFILES= # none

View file

@ -119,9 +119,9 @@ caddy_precmd()
/usr/bin/install -d -m 700 -o "${caddy_user}" -g "${caddy_group}" /var/run/caddy
if [ -e ${caddy_logfile} ]; then
/bin/chmod 644 ${caddy_logfile}
/usr/sbin/chown root:wheel ${caddy_logfile}
/usr/sbin/chown "${caddy_user}:${caddy_group}" ${caddy_logfile}
else
/usr/bin/install -m 644 -o root -g wheel /dev/null ${caddy_logfile}
/usr/bin/install -m 644 -o "${caddy_user}" -g "${caddy_group}" /dev/null ${caddy_logfile}
fi
}

View file

@ -1,7 +1,7 @@
PORTNAME= caddy
DISTVERSIONPREFIX= v
DISTVERSION= 2.7.6
PORTREVISION= 1
PORTREVISION= 2
CATEGORIES= www
DIST_SUBDIR= caddy

View file

@ -119,9 +119,9 @@ caddy_precmd()
/usr/bin/install -d -m 700 -o "${caddy_user}" -g "${caddy_group}" /var/run/caddy
if [ -e ${caddy_logfile} ]; then
/bin/chmod 644 ${caddy_logfile}
/usr/sbin/chown root:wheel ${caddy_logfile}
/usr/sbin/chown "${caddy_user}:${caddy_group}" ${caddy_logfile}
else
/usr/bin/install -m 644 -o root -g wheel /dev/null ${caddy_logfile}
/usr/bin/install -m 644 -o "${caddy_user}" -g "${caddy_group}" /dev/null ${caddy_logfile}
fi
}