caddy: upgrade to 2.4.3

As there is currently a bug with go build info a patch is needed to
fix printing the correct version number of the binary. Once the bug is
fixed, the patch can be dropped.

Fixes #22092
This commit is contained in:
Patrick Pichler 2021-04-15 15:44:37 +02:00 committed by Érico Nogueira Rolim
parent 1907757d14
commit f9013e2b7a
4 changed files with 37 additions and 11 deletions

View file

@ -0,0 +1,3 @@
WARNING: The config syntax has changed from caddy 1.x to 2.x
Be sure to upgrade all your configuration files!

View file

@ -2,7 +2,7 @@
[ -r ./conf ] && . ./conf
export CADDYPATH=/var/lib/caddy
export HOME=/var/lib/caddy
ulimit -n ${MAX_OPEN_FILES:-8192}
cd /etc/caddy
exec chpst -u caddy caddy
exec chpst -u caddy caddy run --config ${CONFFILE:-/etc/caddy/Caddyfile}

View file

@ -0,0 +1,17 @@
--- a/caddy.go
+++ b/caddy.go
@@ -712,14 +711,0 @@ func goModule(mod *debug.Module) *debug.Module {
- bi, ok := debug.ReadBuildInfo()
- if ok {
- mod.Path = bi.Main.Path
- // The recommended way to build Caddy involves
- // creating a separate main module, which
- // TODO: track related Go issue: https://github.com/golang/go/issues/29228
- // once that issue is fixed, we should just be able to use bi.Main... hopefully.
- for _, dep := range bi.Deps {
- if dep.Path == ImportPath {
- return dep
- }
- }
- return &bi.Main
- }

View file

@ -1,28 +1,34 @@
# Template file for 'caddy'
pkgname=caddy
version=1.0.5
version=2.4.3
revision=1
build_style=go
# XXX: use caddy/v2 when updating
go_import_path=github.com/caddyserver/caddy
go_package="${go_import_path}/caddy"
hostmakedepends="git"
go_import_path=github.com/caddyserver/caddy/v2
go_package="${go_import_path}/cmd/caddy"
short_desc="Fast, cross-platform HTTP/2 web server with automatic HTTPS"
maintainer="Dominic Monroe <monroef4@googlemail.com>"
license="Apache-2.0"
homepage="https://caddyserver.com"
distfiles="https://github.com/caddyserver/caddy/archive/v${version}.tar.gz"
checksum=0e7dc07e4f61f9a00a4c962755098e19ebf8c8a8e0d72e311597ce021b7a2a5e
checksum=10317b5ab7bee861631a8d94d13aeafb62e9665759271a6c65422a70d6584d6b
system_accounts="caddy"
caddy_homedir="/var/lib/caddy"
caddy_descr="caddy daemon"
conf_files="/etc/caddy/Caddyfile"
make_dirs="
/etc/caddy 0700 caddy caddy
/var/lib/caddy 0700 caddy caddy"
pre_build() {
vsed -e 's,var EnableTelemetry = true,var EnableTelemetry = false,g' -i caddy/caddymain/run.go
post_extract() {
vsed -e "s,unknown,${version},g" -i ${wrksrc}/caddy.go
}
post_install() {
vsv caddy
printf "\n" > Caddyfile
vinstall Caddyfile 600 etc/caddy
}