Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] caddy: upgrade to 2.3.0
@ 2021-02-28 19:50 patrickpichler
  2021-02-28 19:51 ` [PR PATCH] [Updated] " patrickpichler
                   ` (43 more replies)
  0 siblings, 44 replies; 45+ messages in thread
From: patrickpichler @ 2021-02-28 19:50 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1546 bytes --]

There is a new pull request by patrickpichler against master on the void-packages repository

https://github.com/patrickpichler/void-packages upgrade-caddy-2.3.0
https://github.com/void-linux/void-packages/pull/29128

caddy: upgrade to 2.3.0
As there is currently a bug with go build info
(https://github.com/golang/go/issues/29228) a patch is needed to
fix printing the correct version number of the binary. Once the bug is
fixed, the patch can be dropped.

Fix for #22092

#### Have the results of the proposed changes been tested?
- [ x] I use the packages affected by the proposed changes on a regular basis and confirm this PR works for me

<!--
If GitHub CI cannot be used to validate the build result (for example, if the
build is likely to take several hours), make sure to
[skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration).
When skipping CI, uncomment and fill out the following section.
Note: for builds that are likely to complete in less than 2 hours, it is not
acceptable to skip CI.
-->
<!-- 
#### Does it build and run successfully? 
(Please choose at least one native build and, if supported, at least one cross build. More are better.)
- [ ] I built this PR locally for my native architecture, (ARCH-LIBC)
- [ ] I built this PR locally for these architectures (if supported. mark crossbuilds):
  - [ ] aarch64-musl
  - [ ] armv7l
  - [ ] armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/29128.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-upgrade-caddy-2.3.0-29128.patch --]
[-- Type: text/x-diff, Size: 4222 bytes --]

From daed374a77fb2bb863ce316ed006c2e568a7f427 Mon Sep 17 00:00:00 2001
From: Patrick Pichler <git@patrickpichler.dev>
Date: Sun, 28 Feb 2021 17:54:10 +0100
Subject: [PATCH] caddy: upgrade to 2.3.0

As there is currently a bug with go build info
(https://github.com/golang/go/issues/29228) a patch is needed to
fix printing the correct version number of the binary. Once the bug is
fixed, the patch can be dropped.
---
 srcpkgs/caddy/INSTALL                         |  3 +--
 srcpkgs/caddy/INSTALL.md                      |  4 +++
 srcpkgs/caddy/files/caddy/run                 |  6 ++---
 .../caddy/patches/fix_version_command.patch   | 25 +++++++++++++++++++
 srcpkgs/caddy/template                        | 16 ++++++------
 5 files changed, 42 insertions(+), 12 deletions(-)
 create mode 100644 srcpkgs/caddy/INSTALL.md
 create mode 100644 srcpkgs/caddy/patches/fix_version_command.patch

diff --git a/srcpkgs/caddy/INSTALL b/srcpkgs/caddy/INSTALL
index db063595f43..03302bbf41d 100644
--- a/srcpkgs/caddy/INSTALL
+++ b/srcpkgs/caddy/INSTALL
@@ -1,6 +1,5 @@
 case "${ACTION}" in
 post)
-	setcap CAP_NET_BIND_SERVICE=+ep usr/bin/caddy
-	chown -R caddy:caddy etc/caddy
+	setcap CAP_NET_BIND_SERVICE=+ep bin/caddy
 	;;
 esac
diff --git a/srcpkgs/caddy/INSTALL.md b/srcpkgs/caddy/INSTALL.md
new file mode 100644
index 00000000000..10ef8e8213f
--- /dev/null
+++ b/srcpkgs/caddy/INSTALL.md
@@ -0,0 +1,4 @@
+WARNING: The config syntax has changed from caddy 1.x to 2.x
+
+Be sure to upgrade all your configuration files!
+
diff --git a/srcpkgs/caddy/files/caddy/run b/srcpkgs/caddy/files/caddy/run
index ff0cc9c8030..80d9e10c5e1 100644
--- a/srcpkgs/caddy/files/caddy/run
+++ b/srcpkgs/caddy/files/caddy/run
@@ -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 --environ --config /etc/caddy/Caddyfile
diff --git a/srcpkgs/caddy/patches/fix_version_command.patch b/srcpkgs/caddy/patches/fix_version_command.patch
new file mode 100644
index 00000000000..094d59b285a
--- /dev/null
+++ b/srcpkgs/caddy/patches/fix_version_command.patch
@@ -0,0 +1,25 @@
+Return fake module info to show correct build version.
+
+TODO: remove once https://github.com/golang/go/issues/29228 is 
+      fixed and replace with proper solution
+
+--- caddy.go
++++ caddy.go
+@@ -554,18 +554,4 @@
+-	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
+-	}
+-	return mod
++  return mod
+ }
diff --git a/srcpkgs/caddy/template b/srcpkgs/caddy/template
index 6fe986419c9..5737ce56a57 100644
--- a/srcpkgs/caddy/template
+++ b/srcpkgs/caddy/template
@@ -1,26 +1,28 @@
 # Template file for 'caddy'
 pkgname=caddy
-version=1.0.5
+version=2.3.0
 revision=1
 build_style=go
-# XXX: use caddy/v2 when updating
-go_import_path=github.com/caddyserver/caddy
-go_package="${go_import_path}/caddy"
+go_import_path=github.com/caddyserver/caddy/v2
+go_package="${go_import_path}/cmd/caddy"
 hostmakedepends="git"
 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=4688b122ac05be39622aa81324d1635f1642e4a66d731e82d210aef78cf2766a
 
 system_accounts="caddy"
+caddy_homedir="/var/lib/caddy"
+caddy_descr="caddy daemon"
+
 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() {

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [PR PATCH] [Updated] caddy: upgrade to 2.3.0
  2021-02-28 19:50 [PR PATCH] caddy: upgrade to 2.3.0 patrickpichler
@ 2021-02-28 19:51 ` patrickpichler
  2021-03-01  5:00 ` patrickpichler
                   ` (42 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: patrickpichler @ 2021-02-28 19:51 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1551 bytes --]

There is an updated pull request by patrickpichler against master on the void-packages repository

https://github.com/patrickpichler/void-packages upgrade-caddy-2.3.0
https://github.com/void-linux/void-packages/pull/29128

caddy: upgrade to 2.3.0
As there is currently a bug with go build info
(https://github.com/golang/go/issues/29228) a patch is needed to
fix printing the correct version number of the binary. Once the bug is
fixed, the patch can be dropped.

Fix for #22092

#### Have the results of the proposed changes been tested?
- [ x] I use the packages affected by the proposed changes on a regular basis and confirm this PR works for me

<!--
If GitHub CI cannot be used to validate the build result (for example, if the
build is likely to take several hours), make sure to
[skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration).
When skipping CI, uncomment and fill out the following section.
Note: for builds that are likely to complete in less than 2 hours, it is not
acceptable to skip CI.
-->
<!-- 
#### Does it build and run successfully? 
(Please choose at least one native build and, if supported, at least one cross build. More are better.)
- [ ] I built this PR locally for my native architecture, (ARCH-LIBC)
- [ ] I built this PR locally for these architectures (if supported. mark crossbuilds):
  - [ ] aarch64-musl
  - [ ] armv7l
  - [ ] armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/29128.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-upgrade-caddy-2.3.0-29128.patch --]
[-- Type: text/x-diff, Size: 4192 bytes --]

From 629424b5b4238b972c4f686aa3b098ec30da1d10 Mon Sep 17 00:00:00 2001
From: Patrick Pichler <git@patrickpichler.dev>
Date: Sun, 28 Feb 2021 17:54:10 +0100
Subject: [PATCH] caddy: upgrade to 2.3.0

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
---
 srcpkgs/caddy/INSTALL                         |  3 +--
 srcpkgs/caddy/INSTALL.md                      |  4 +++
 srcpkgs/caddy/files/caddy/run                 |  6 ++---
 .../caddy/patches/fix_version_command.patch   | 25 +++++++++++++++++++
 srcpkgs/caddy/template                        | 16 ++++++------
 5 files changed, 42 insertions(+), 12 deletions(-)
 create mode 100644 srcpkgs/caddy/INSTALL.md
 create mode 100644 srcpkgs/caddy/patches/fix_version_command.patch

diff --git a/srcpkgs/caddy/INSTALL b/srcpkgs/caddy/INSTALL
index db063595f43..03302bbf41d 100644
--- a/srcpkgs/caddy/INSTALL
+++ b/srcpkgs/caddy/INSTALL
@@ -1,6 +1,5 @@
 case "${ACTION}" in
 post)
-	setcap CAP_NET_BIND_SERVICE=+ep usr/bin/caddy
-	chown -R caddy:caddy etc/caddy
+	setcap CAP_NET_BIND_SERVICE=+ep bin/caddy
 	;;
 esac
diff --git a/srcpkgs/caddy/INSTALL.md b/srcpkgs/caddy/INSTALL.md
new file mode 100644
index 00000000000..10ef8e8213f
--- /dev/null
+++ b/srcpkgs/caddy/INSTALL.md
@@ -0,0 +1,4 @@
+WARNING: The config syntax has changed from caddy 1.x to 2.x
+
+Be sure to upgrade all your configuration files!
+
diff --git a/srcpkgs/caddy/files/caddy/run b/srcpkgs/caddy/files/caddy/run
index ff0cc9c8030..80d9e10c5e1 100644
--- a/srcpkgs/caddy/files/caddy/run
+++ b/srcpkgs/caddy/files/caddy/run
@@ -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 --environ --config /etc/caddy/Caddyfile
diff --git a/srcpkgs/caddy/patches/fix_version_command.patch b/srcpkgs/caddy/patches/fix_version_command.patch
new file mode 100644
index 00000000000..094d59b285a
--- /dev/null
+++ b/srcpkgs/caddy/patches/fix_version_command.patch
@@ -0,0 +1,25 @@
+Return fake module info to show correct build version.
+
+TODO: remove once https://github.com/golang/go/issues/29228 is 
+      fixed and replace with proper solution
+
+--- caddy.go
++++ caddy.go
+@@ -554,18 +554,4 @@
+-	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
+-	}
+-	return mod
++  return mod
+ }
diff --git a/srcpkgs/caddy/template b/srcpkgs/caddy/template
index 6fe986419c9..5737ce56a57 100644
--- a/srcpkgs/caddy/template
+++ b/srcpkgs/caddy/template
@@ -1,26 +1,28 @@
 # Template file for 'caddy'
 pkgname=caddy
-version=1.0.5
+version=2.3.0
 revision=1
 build_style=go
-# XXX: use caddy/v2 when updating
-go_import_path=github.com/caddyserver/caddy
-go_package="${go_import_path}/caddy"
+go_import_path=github.com/caddyserver/caddy/v2
+go_package="${go_import_path}/cmd/caddy"
 hostmakedepends="git"
 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=4688b122ac05be39622aa81324d1635f1642e4a66d731e82d210aef78cf2766a
 
 system_accounts="caddy"
+caddy_homedir="/var/lib/caddy"
+caddy_descr="caddy daemon"
+
 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() {

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [PR PATCH] [Updated] caddy: upgrade to 2.3.0
  2021-02-28 19:50 [PR PATCH] caddy: upgrade to 2.3.0 patrickpichler
  2021-02-28 19:51 ` [PR PATCH] [Updated] " patrickpichler
@ 2021-03-01  5:00 ` patrickpichler
  2021-03-01  9:14 ` the-maldridge
                   ` (41 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: patrickpichler @ 2021-03-01  5:00 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1551 bytes --]

There is an updated pull request by patrickpichler against master on the void-packages repository

https://github.com/patrickpichler/void-packages upgrade-caddy-2.3.0
https://github.com/void-linux/void-packages/pull/29128

caddy: upgrade to 2.3.0
As there is currently a bug with go build info
(https://github.com/golang/go/issues/29228) a patch is needed to
fix printing the correct version number of the binary. Once the bug is
fixed, the patch can be dropped.

Fix for #22092

#### Have the results of the proposed changes been tested?
- [ x] I use the packages affected by the proposed changes on a regular basis and confirm this PR works for me

<!--
If GitHub CI cannot be used to validate the build result (for example, if the
build is likely to take several hours), make sure to
[skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration).
When skipping CI, uncomment and fill out the following section.
Note: for builds that are likely to complete in less than 2 hours, it is not
acceptable to skip CI.
-->
<!-- 
#### Does it build and run successfully? 
(Please choose at least one native build and, if supported, at least one cross build. More are better.)
- [ ] I built this PR locally for my native architecture, (ARCH-LIBC)
- [ ] I built this PR locally for these architectures (if supported. mark crossbuilds):
  - [ ] aarch64-musl
  - [ ] armv7l
  - [ ] armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/29128.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-upgrade-caddy-2.3.0-29128.patch --]
[-- Type: text/x-diff, Size: 4191 bytes --]

From 617634e9febc02669fd179c5764e8d40d0d29ad9 Mon Sep 17 00:00:00 2001
From: Patrick Pichler <git@patrickpichler.dev>
Date: Sun, 28 Feb 2021 17:54:10 +0100
Subject: [PATCH] caddy: upgrade to 2.3.0

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
---
 srcpkgs/caddy/INSTALL                         |  3 +--
 srcpkgs/caddy/INSTALL.md                      |  4 +++
 srcpkgs/caddy/files/caddy/run                 |  6 ++---
 .../caddy/patches/fix_version_command.patch   | 25 +++++++++++++++++++
 srcpkgs/caddy/template                        | 16 ++++++------
 5 files changed, 42 insertions(+), 12 deletions(-)
 create mode 100644 srcpkgs/caddy/INSTALL.md
 create mode 100644 srcpkgs/caddy/patches/fix_version_command.patch

diff --git a/srcpkgs/caddy/INSTALL b/srcpkgs/caddy/INSTALL
index db063595f43..03302bbf41d 100644
--- a/srcpkgs/caddy/INSTALL
+++ b/srcpkgs/caddy/INSTALL
@@ -1,6 +1,5 @@
 case "${ACTION}" in
 post)
-	setcap CAP_NET_BIND_SERVICE=+ep usr/bin/caddy
-	chown -R caddy:caddy etc/caddy
+	setcap CAP_NET_BIND_SERVICE=+ep bin/caddy
 	;;
 esac
diff --git a/srcpkgs/caddy/INSTALL.md b/srcpkgs/caddy/INSTALL.md
new file mode 100644
index 00000000000..10ef8e8213f
--- /dev/null
+++ b/srcpkgs/caddy/INSTALL.md
@@ -0,0 +1,4 @@
+WARNING: The config syntax has changed from caddy 1.x to 2.x
+
+Be sure to upgrade all your configuration files!
+
diff --git a/srcpkgs/caddy/files/caddy/run b/srcpkgs/caddy/files/caddy/run
index ff0cc9c8030..80d9e10c5e1 100644
--- a/srcpkgs/caddy/files/caddy/run
+++ b/srcpkgs/caddy/files/caddy/run
@@ -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 --environ --config /etc/caddy/Caddyfile
diff --git a/srcpkgs/caddy/patches/fix_version_command.patch b/srcpkgs/caddy/patches/fix_version_command.patch
new file mode 100644
index 00000000000..094d59b285a
--- /dev/null
+++ b/srcpkgs/caddy/patches/fix_version_command.patch
@@ -0,0 +1,25 @@
+Return fake module info to show correct build version.
+
+TODO: remove once https://github.com/golang/go/issues/29228 is 
+      fixed and replace with proper solution
+
+--- caddy.go
++++ caddy.go
+@@ -554,18 +554,4 @@
+-	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
+-	}
+-	return mod
++  return mod
+ }
diff --git a/srcpkgs/caddy/template b/srcpkgs/caddy/template
index 6fe986419c9..4de7ee6e1de 100644
--- a/srcpkgs/caddy/template
+++ b/srcpkgs/caddy/template
@@ -1,26 +1,28 @@
 # Template file for 'caddy'
 pkgname=caddy
-version=1.0.5
+version=2.3.0
 revision=1
 build_style=go
-# XXX: use caddy/v2 when updating
-go_import_path=github.com/caddyserver/caddy
-go_package="${go_import_path}/caddy"
+go_import_path=github.com/caddyserver/caddy/v2
+go_package="${go_import_path}/cmd/caddy"
 hostmakedepends="git"
 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=4688b122ac05be39622aa81324d1635f1642e4a66d731e82d210aef78cf2766a
 
 system_accounts="caddy"
+caddy_homedir="/var/lib/caddy"
+caddy_descr="caddy daemon"
+
 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() {

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: caddy: upgrade to 2.3.0
  2021-02-28 19:50 [PR PATCH] caddy: upgrade to 2.3.0 patrickpichler
  2021-02-28 19:51 ` [PR PATCH] [Updated] " patrickpichler
  2021-03-01  5:00 ` patrickpichler
@ 2021-03-01  9:14 ` the-maldridge
  2021-03-01  9:40 ` patrickpichler
                   ` (40 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: the-maldridge @ 2021-03-01  9:14 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 354 bytes --]

New comment by the-maldridge on void-packages repository

https://github.com/void-linux/void-packages/pull/29128#issuecomment-787791632

Comment:
typically when the config changes in a non-backwards compatible way, we'll create a new package, in this case `caddy2` so that users aren't broken by an upgrade.  Please amend your PR to follow this pattern.

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: caddy: upgrade to 2.3.0
  2021-02-28 19:50 [PR PATCH] caddy: upgrade to 2.3.0 patrickpichler
                   ` (2 preceding siblings ...)
  2021-03-01  9:14 ` the-maldridge
@ 2021-03-01  9:40 ` patrickpichler
  2021-03-01  9:41 ` patrickpichler
                   ` (39 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: patrickpichler @ 2021-03-01  9:40 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 239 bytes --]

New comment by patrickpichler on void-packages repository

https://github.com/void-linux/void-packages/pull/29128#issuecomment-787809812

Comment:
There was a PR for that (#24778) , which said, that we should update the old caddy package.

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: caddy: upgrade to 2.3.0
  2021-02-28 19:50 [PR PATCH] caddy: upgrade to 2.3.0 patrickpichler
                   ` (3 preceding siblings ...)
  2021-03-01  9:40 ` patrickpichler
@ 2021-03-01  9:41 ` patrickpichler
  2021-03-01  9:41 ` patrickpichler
                   ` (38 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: patrickpichler @ 2021-03-01  9:41 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 304 bytes --]

New comment by patrickpichler on void-packages repository

https://github.com/void-linux/void-packages/pull/29128#issuecomment-787809812

Comment:
There was a PR for that (#24778) , which said, that we should update the old caddy package.

Should we now introduce a new package, or update the old one?

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: caddy: upgrade to 2.3.0
  2021-02-28 19:50 [PR PATCH] caddy: upgrade to 2.3.0 patrickpichler
                   ` (4 preceding siblings ...)
  2021-03-01  9:41 ` patrickpichler
@ 2021-03-01  9:41 ` patrickpichler
  2021-03-01  9:43 ` patrickpichler
                   ` (37 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: patrickpichler @ 2021-03-01  9:41 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 304 bytes --]

New comment by patrickpichler on void-packages repository

https://github.com/void-linux/void-packages/pull/29128#issuecomment-787809812

Comment:
There was a PR for that (#24778) , in which was said, that we should update the old package. 
Should we now introduce a new package, or update the old one?

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: caddy: upgrade to 2.3.0
  2021-02-28 19:50 [PR PATCH] caddy: upgrade to 2.3.0 patrickpichler
                   ` (5 preceding siblings ...)
  2021-03-01  9:41 ` patrickpichler
@ 2021-03-01  9:43 ` patrickpichler
  2021-03-01 19:56 ` [PR REVIEW] " ericonr
                   ` (36 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: patrickpichler @ 2021-03-01  9:43 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 423 bytes --]

New comment by patrickpichler on void-packages repository

https://github.com/void-linux/void-packages/pull/29128#issuecomment-787809812

Comment:
There was a PR for that (#24778), in which was [said](https://github.com/void-linux/void-packages/pull/24778#issuecomment-706545842),  that we should update the old package. 
Should we now introduce a new package, or update the old one?

Edit: rephrasing, adding more info

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [PR REVIEW] caddy: upgrade to 2.3.0
  2021-02-28 19:50 [PR PATCH] caddy: upgrade to 2.3.0 patrickpichler
                   ` (6 preceding siblings ...)
  2021-03-01  9:43 ` patrickpichler
@ 2021-03-01 19:56 ` ericonr
  2021-03-02  5:22 ` [PR PATCH] [Updated] " patrickpichler
                   ` (35 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: ericonr @ 2021-03-01 19:56 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 165 bytes --]

New review comment by ericonr on void-packages repository

https://github.com/void-linux/void-packages/pull/29128#discussion_r585007725

Comment:
Trailing new line.

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [PR PATCH] [Updated] caddy: upgrade to 2.3.0
  2021-02-28 19:50 [PR PATCH] caddy: upgrade to 2.3.0 patrickpichler
                   ` (7 preceding siblings ...)
  2021-03-01 19:56 ` [PR REVIEW] " ericonr
@ 2021-03-02  5:22 ` patrickpichler
  2021-03-02  5:55 ` patrickpichler
                   ` (34 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: patrickpichler @ 2021-03-02  5:22 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1551 bytes --]

There is an updated pull request by patrickpichler against master on the void-packages repository

https://github.com/patrickpichler/void-packages upgrade-caddy-2.3.0
https://github.com/void-linux/void-packages/pull/29128

caddy: upgrade to 2.3.0
As there is currently a bug with go build info
(https://github.com/golang/go/issues/29228) a patch is needed to
fix printing the correct version number of the binary. Once the bug is
fixed, the patch can be dropped.

Fix for #22092

#### Have the results of the proposed changes been tested?
- [ x] I use the packages affected by the proposed changes on a regular basis and confirm this PR works for me

<!--
If GitHub CI cannot be used to validate the build result (for example, if the
build is likely to take several hours), make sure to
[skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration).
When skipping CI, uncomment and fill out the following section.
Note: for builds that are likely to complete in less than 2 hours, it is not
acceptable to skip CI.
-->
<!-- 
#### Does it build and run successfully? 
(Please choose at least one native build and, if supported, at least one cross build. More are better.)
- [ ] I built this PR locally for my native architecture, (ARCH-LIBC)
- [ ] I built this PR locally for these architectures (if supported. mark crossbuilds):
  - [ ] aarch64-musl
  - [ ] armv7l
  - [ ] armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/29128.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-upgrade-caddy-2.3.0-29128.patch --]
[-- Type: text/x-diff, Size: 4189 bytes --]

From 2a9ed1864bbac6323316b61dad8545fcd59fb032 Mon Sep 17 00:00:00 2001
From: Patrick Pichler <git@patrickpichler.dev>
Date: Sun, 28 Feb 2021 17:54:10 +0100
Subject: [PATCH] caddy: upgrade to 2.3.0

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
---
 srcpkgs/caddy/INSTALL                         |  3 +--
 srcpkgs/caddy/INSTALL.md                      |  3 +++
 srcpkgs/caddy/files/caddy/run                 |  6 ++---
 .../caddy/patches/fix_version_command.patch   | 25 +++++++++++++++++++
 srcpkgs/caddy/template                        | 16 ++++++------
 5 files changed, 41 insertions(+), 12 deletions(-)
 create mode 100644 srcpkgs/caddy/INSTALL.md
 create mode 100644 srcpkgs/caddy/patches/fix_version_command.patch

diff --git a/srcpkgs/caddy/INSTALL b/srcpkgs/caddy/INSTALL
index db063595f43..03302bbf41d 100644
--- a/srcpkgs/caddy/INSTALL
+++ b/srcpkgs/caddy/INSTALL
@@ -1,6 +1,5 @@
 case "${ACTION}" in
 post)
-	setcap CAP_NET_BIND_SERVICE=+ep usr/bin/caddy
-	chown -R caddy:caddy etc/caddy
+	setcap CAP_NET_BIND_SERVICE=+ep bin/caddy
 	;;
 esac
diff --git a/srcpkgs/caddy/INSTALL.md b/srcpkgs/caddy/INSTALL.md
new file mode 100644
index 00000000000..2b425ede6ea
--- /dev/null
+++ b/srcpkgs/caddy/INSTALL.md
@@ -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!
diff --git a/srcpkgs/caddy/files/caddy/run b/srcpkgs/caddy/files/caddy/run
index ff0cc9c8030..80d9e10c5e1 100644
--- a/srcpkgs/caddy/files/caddy/run
+++ b/srcpkgs/caddy/files/caddy/run
@@ -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 --environ --config /etc/caddy/Caddyfile
diff --git a/srcpkgs/caddy/patches/fix_version_command.patch b/srcpkgs/caddy/patches/fix_version_command.patch
new file mode 100644
index 00000000000..094d59b285a
--- /dev/null
+++ b/srcpkgs/caddy/patches/fix_version_command.patch
@@ -0,0 +1,25 @@
+Return fake module info to show correct build version.
+
+TODO: remove once https://github.com/golang/go/issues/29228 is 
+      fixed and replace with proper solution
+
+--- caddy.go
++++ caddy.go
+@@ -554,18 +554,4 @@
+-	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
+-	}
+-	return mod
++  return mod
+ }
diff --git a/srcpkgs/caddy/template b/srcpkgs/caddy/template
index 6fe986419c9..4de7ee6e1de 100644
--- a/srcpkgs/caddy/template
+++ b/srcpkgs/caddy/template
@@ -1,26 +1,28 @@
 # Template file for 'caddy'
 pkgname=caddy
-version=1.0.5
+version=2.3.0
 revision=1
 build_style=go
-# XXX: use caddy/v2 when updating
-go_import_path=github.com/caddyserver/caddy
-go_package="${go_import_path}/caddy"
+go_import_path=github.com/caddyserver/caddy/v2
+go_package="${go_import_path}/cmd/caddy"
 hostmakedepends="git"
 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=4688b122ac05be39622aa81324d1635f1642e4a66d731e82d210aef78cf2766a
 
 system_accounts="caddy"
+caddy_homedir="/var/lib/caddy"
+caddy_descr="caddy daemon"
+
 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() {

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [PR PATCH] [Updated] caddy: upgrade to 2.3.0
  2021-02-28 19:50 [PR PATCH] caddy: upgrade to 2.3.0 patrickpichler
                   ` (8 preceding siblings ...)
  2021-03-02  5:22 ` [PR PATCH] [Updated] " patrickpichler
@ 2021-03-02  5:55 ` patrickpichler
  2021-03-02  6:58 ` patrickpichler
                   ` (33 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: patrickpichler @ 2021-03-02  5:55 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1551 bytes --]

There is an updated pull request by patrickpichler against master on the void-packages repository

https://github.com/patrickpichler/void-packages upgrade-caddy-2.3.0
https://github.com/void-linux/void-packages/pull/29128

caddy: upgrade to 2.3.0
As there is currently a bug with go build info
(https://github.com/golang/go/issues/29228) a patch is needed to
fix printing the correct version number of the binary. Once the bug is
fixed, the patch can be dropped.

Fix for #22092

#### Have the results of the proposed changes been tested?
- [ x] I use the packages affected by the proposed changes on a regular basis and confirm this PR works for me

<!--
If GitHub CI cannot be used to validate the build result (for example, if the
build is likely to take several hours), make sure to
[skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration).
When skipping CI, uncomment and fill out the following section.
Note: for builds that are likely to complete in less than 2 hours, it is not
acceptable to skip CI.
-->
<!-- 
#### Does it build and run successfully? 
(Please choose at least one native build and, if supported, at least one cross build. More are better.)
- [ ] I built this PR locally for my native architecture, (ARCH-LIBC)
- [ ] I built this PR locally for these architectures (if supported. mark crossbuilds):
  - [ ] aarch64-musl
  - [ ] armv7l
  - [ ] armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/29128.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-upgrade-caddy-2.3.0-29128.patch --]
[-- Type: text/x-diff, Size: 4188 bytes --]

From 97234b86452734a8b4e1d4a4f2528893f1b6ced1 Mon Sep 17 00:00:00 2001
From: Patrick Pichler <git@patrickpichler.dev>
Date: Tue, 2 Mar 2021 06:55:27 +0100
Subject: [PATCH] caddy: upgrade to 2.3.0

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
---
 srcpkgs/caddy/INSTALL                         |  3 +--
 srcpkgs/caddy/INSTALL.md                      |  3 +++
 srcpkgs/caddy/files/caddy/run                 |  6 ++---
 .../caddy/patches/fix_version_command.patch   | 25 +++++++++++++++++++
 srcpkgs/caddy/template                        | 16 ++++++------
 5 files changed, 41 insertions(+), 12 deletions(-)
 create mode 100644 srcpkgs/caddy/INSTALL.md
 create mode 100644 srcpkgs/caddy/patches/fix_version_command.patch

diff --git a/srcpkgs/caddy/INSTALL b/srcpkgs/caddy/INSTALL
index db063595f43..03302bbf41d 100644
--- a/srcpkgs/caddy/INSTALL
+++ b/srcpkgs/caddy/INSTALL
@@ -1,6 +1,5 @@
 case "${ACTION}" in
 post)
-	setcap CAP_NET_BIND_SERVICE=+ep usr/bin/caddy
-	chown -R caddy:caddy etc/caddy
+	setcap CAP_NET_BIND_SERVICE=+ep bin/caddy
 	;;
 esac
diff --git a/srcpkgs/caddy/INSTALL.md b/srcpkgs/caddy/INSTALL.md
new file mode 100644
index 00000000000..2b425ede6ea
--- /dev/null
+++ b/srcpkgs/caddy/INSTALL.md
@@ -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!
diff --git a/srcpkgs/caddy/files/caddy/run b/srcpkgs/caddy/files/caddy/run
index ff0cc9c8030..80d9e10c5e1 100644
--- a/srcpkgs/caddy/files/caddy/run
+++ b/srcpkgs/caddy/files/caddy/run
@@ -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 --environ --config /etc/caddy/Caddyfile
diff --git a/srcpkgs/caddy/patches/fix_version_command.patch b/srcpkgs/caddy/patches/fix_version_command.patch
new file mode 100644
index 00000000000..094d59b285a
--- /dev/null
+++ b/srcpkgs/caddy/patches/fix_version_command.patch
@@ -0,0 +1,25 @@
+Return fake module info to show correct build version.
+
+TODO: remove once https://github.com/golang/go/issues/29228 is 
+      fixed and replace with proper solution
+
+--- caddy.go
++++ caddy.go
+@@ -554,18 +554,4 @@
+-	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
+-	}
+-	return mod
++  return mod
+ }
diff --git a/srcpkgs/caddy/template b/srcpkgs/caddy/template
index 6fe986419c9..4de7ee6e1de 100644
--- a/srcpkgs/caddy/template
+++ b/srcpkgs/caddy/template
@@ -1,26 +1,28 @@
 # Template file for 'caddy'
 pkgname=caddy
-version=1.0.5
+version=2.3.0
 revision=1
 build_style=go
-# XXX: use caddy/v2 when updating
-go_import_path=github.com/caddyserver/caddy
-go_package="${go_import_path}/caddy"
+go_import_path=github.com/caddyserver/caddy/v2
+go_package="${go_import_path}/cmd/caddy"
 hostmakedepends="git"
 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=4688b122ac05be39622aa81324d1635f1642e4a66d731e82d210aef78cf2766a
 
 system_accounts="caddy"
+caddy_homedir="/var/lib/caddy"
+caddy_descr="caddy daemon"
+
 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() {

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: caddy: upgrade to 2.3.0
  2021-02-28 19:50 [PR PATCH] caddy: upgrade to 2.3.0 patrickpichler
                   ` (9 preceding siblings ...)
  2021-03-02  5:55 ` patrickpichler
@ 2021-03-02  6:58 ` patrickpichler
  2021-03-03  5:03 ` [PR PATCH] [Updated] " patrickpichler
                   ` (32 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: patrickpichler @ 2021-03-02  6:58 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 401 bytes --]

New comment by patrickpichler on void-packages repository

https://github.com/void-linux/void-packages/pull/29128#issuecomment-788667082

Comment:
There seems to be an issue with the pipeline. It complains that it cannot download`base files-0141_10`. 

```
 ERROR: [trans] failed to download `base-files-0.141_10' signature from `http://alpha.us.repo.voidlinux.org/current/aarch64': Not Found
```

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [PR PATCH] [Updated] caddy: upgrade to 2.3.0
  2021-02-28 19:50 [PR PATCH] caddy: upgrade to 2.3.0 patrickpichler
                   ` (10 preceding siblings ...)
  2021-03-02  6:58 ` patrickpichler
@ 2021-03-03  5:03 ` patrickpichler
  2021-03-08  4:04 ` ericonr
                   ` (31 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: patrickpichler @ 2021-03-03  5:03 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1551 bytes --]

There is an updated pull request by patrickpichler against master on the void-packages repository

https://github.com/patrickpichler/void-packages upgrade-caddy-2.3.0
https://github.com/void-linux/void-packages/pull/29128

caddy: upgrade to 2.3.0
As there is currently a bug with go build info
(https://github.com/golang/go/issues/29228) a patch is needed to
fix printing the correct version number of the binary. Once the bug is
fixed, the patch can be dropped.

Fix for #22092

#### Have the results of the proposed changes been tested?
- [ x] I use the packages affected by the proposed changes on a regular basis and confirm this PR works for me

<!--
If GitHub CI cannot be used to validate the build result (for example, if the
build is likely to take several hours), make sure to
[skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration).
When skipping CI, uncomment and fill out the following section.
Note: for builds that are likely to complete in less than 2 hours, it is not
acceptable to skip CI.
-->
<!-- 
#### Does it build and run successfully? 
(Please choose at least one native build and, if supported, at least one cross build. More are better.)
- [ ] I built this PR locally for my native architecture, (ARCH-LIBC)
- [ ] I built this PR locally for these architectures (if supported. mark crossbuilds):
  - [ ] aarch64-musl
  - [ ] armv7l
  - [ ] armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/29128.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-upgrade-caddy-2.3.0-29128.patch --]
[-- Type: text/x-diff, Size: 4188 bytes --]

From eaff4d33c2fc9859bb9258236673f043162c8f9b Mon Sep 17 00:00:00 2001
From: Patrick Pichler <git@patrickpichler.dev>
Date: Wed, 3 Mar 2021 06:02:58 +0100
Subject: [PATCH] caddy: upgrade to 2.3.0

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
---
 srcpkgs/caddy/INSTALL                         |  3 +--
 srcpkgs/caddy/INSTALL.md                      |  3 +++
 srcpkgs/caddy/files/caddy/run                 |  6 ++---
 .../caddy/patches/fix_version_command.patch   | 25 +++++++++++++++++++
 srcpkgs/caddy/template                        | 16 ++++++------
 5 files changed, 41 insertions(+), 12 deletions(-)
 create mode 100644 srcpkgs/caddy/INSTALL.md
 create mode 100644 srcpkgs/caddy/patches/fix_version_command.patch

diff --git a/srcpkgs/caddy/INSTALL b/srcpkgs/caddy/INSTALL
index db063595f43..03302bbf41d 100644
--- a/srcpkgs/caddy/INSTALL
+++ b/srcpkgs/caddy/INSTALL
@@ -1,6 +1,5 @@
 case "${ACTION}" in
 post)
-	setcap CAP_NET_BIND_SERVICE=+ep usr/bin/caddy
-	chown -R caddy:caddy etc/caddy
+	setcap CAP_NET_BIND_SERVICE=+ep bin/caddy
 	;;
 esac
diff --git a/srcpkgs/caddy/INSTALL.md b/srcpkgs/caddy/INSTALL.md
new file mode 100644
index 00000000000..2b425ede6ea
--- /dev/null
+++ b/srcpkgs/caddy/INSTALL.md
@@ -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!
diff --git a/srcpkgs/caddy/files/caddy/run b/srcpkgs/caddy/files/caddy/run
index ff0cc9c8030..80d9e10c5e1 100644
--- a/srcpkgs/caddy/files/caddy/run
+++ b/srcpkgs/caddy/files/caddy/run
@@ -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 --environ --config /etc/caddy/Caddyfile
diff --git a/srcpkgs/caddy/patches/fix_version_command.patch b/srcpkgs/caddy/patches/fix_version_command.patch
new file mode 100644
index 00000000000..094d59b285a
--- /dev/null
+++ b/srcpkgs/caddy/patches/fix_version_command.patch
@@ -0,0 +1,25 @@
+Return fake module info to show correct build version.
+
+TODO: remove once https://github.com/golang/go/issues/29228 is 
+      fixed and replace with proper solution
+
+--- caddy.go
++++ caddy.go
+@@ -554,18 +554,4 @@
+-	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
+-	}
+-	return mod
++  return mod
+ }
diff --git a/srcpkgs/caddy/template b/srcpkgs/caddy/template
index 6fe986419c9..4de7ee6e1de 100644
--- a/srcpkgs/caddy/template
+++ b/srcpkgs/caddy/template
@@ -1,26 +1,28 @@
 # Template file for 'caddy'
 pkgname=caddy
-version=1.0.5
+version=2.3.0
 revision=1
 build_style=go
-# XXX: use caddy/v2 when updating
-go_import_path=github.com/caddyserver/caddy
-go_package="${go_import_path}/caddy"
+go_import_path=github.com/caddyserver/caddy/v2
+go_package="${go_import_path}/cmd/caddy"
 hostmakedepends="git"
 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=4688b122ac05be39622aa81324d1635f1642e4a66d731e82d210aef78cf2766a
 
 system_accounts="caddy"
+caddy_homedir="/var/lib/caddy"
+caddy_descr="caddy daemon"
+
 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() {

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: caddy: upgrade to 2.3.0
  2021-02-28 19:50 [PR PATCH] caddy: upgrade to 2.3.0 patrickpichler
                   ` (11 preceding siblings ...)
  2021-03-03  5:03 ` [PR PATCH] [Updated] " patrickpichler
@ 2021-03-08  4:04 ` ericonr
  2021-03-16 16:53 ` patrickpichler
                   ` (30 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: ericonr @ 2021-03-08  4:04 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 244 bytes --]

New comment by ericonr on void-packages repository

https://github.com/void-linux/void-packages/pull/29128#issuecomment-792446446

Comment:
@lemmi do you think we can merge this? It would be nice to not ship a super outdated version anymore...

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: caddy: upgrade to 2.3.0
  2021-02-28 19:50 [PR PATCH] caddy: upgrade to 2.3.0 patrickpichler
                   ` (12 preceding siblings ...)
  2021-03-08  4:04 ` ericonr
@ 2021-03-16 16:53 ` patrickpichler
  2021-03-17 11:06 ` lemmi
                   ` (29 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: patrickpichler @ 2021-03-16 16:53 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 175 bytes --]

New comment by patrickpichler on void-packages repository

https://github.com/void-linux/void-packages/pull/29128#issuecomment-800434960

Comment:
Are there any news on this?

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: caddy: upgrade to 2.3.0
  2021-02-28 19:50 [PR PATCH] caddy: upgrade to 2.3.0 patrickpichler
                   ` (13 preceding siblings ...)
  2021-03-16 16:53 ` patrickpichler
@ 2021-03-17 11:06 ` lemmi
  2021-04-11  4:10 ` [PR REVIEW] " ericonr
                   ` (28 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: lemmi @ 2021-03-17 11:06 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 356 bytes --]

New comment by lemmi on void-packages repository

https://github.com/void-linux/void-packages/pull/29128#issuecomment-800994784

Comment:
Hm.. I *really* wish we could mark packages as on-hold if they break things like in this case, so they are only updated when the user explicitly allows it.
But since we don't have that, I'm not opposed to the update.

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [PR REVIEW] caddy: upgrade to 2.3.0
  2021-02-28 19:50 [PR PATCH] caddy: upgrade to 2.3.0 patrickpichler
                   ` (14 preceding siblings ...)
  2021-03-17 11:06 ` lemmi
@ 2021-04-11  4:10 ` ericonr
  2021-04-14 17:53 ` [PR PATCH] [Updated] " patrickpichler
                   ` (27 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: ericonr @ 2021-04-11  4:10 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 219 bytes --]

New review comment by ericonr on void-packages repository

https://github.com/void-linux/void-packages/pull/29128#discussion_r611127307

Comment:
This file doesn't exist in the package... Does it still work regardless?

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [PR PATCH] [Updated] caddy: upgrade to 2.3.0
  2021-02-28 19:50 [PR PATCH] caddy: upgrade to 2.3.0 patrickpichler
                   ` (15 preceding siblings ...)
  2021-04-11  4:10 ` [PR REVIEW] " ericonr
@ 2021-04-14 17:53 ` patrickpichler
  2021-04-14 17:58 ` [PR REVIEW] " patrickpichler
                   ` (26 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: patrickpichler @ 2021-04-14 17:53 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1551 bytes --]

There is an updated pull request by patrickpichler against master on the void-packages repository

https://github.com/patrickpichler/void-packages upgrade-caddy-2.3.0
https://github.com/void-linux/void-packages/pull/29128

caddy: upgrade to 2.3.0
As there is currently a bug with go build info
(https://github.com/golang/go/issues/29228) a patch is needed to
fix printing the correct version number of the binary. Once the bug is
fixed, the patch can be dropped.

Fix for #22092

#### Have the results of the proposed changes been tested?
- [ x] I use the packages affected by the proposed changes on a regular basis and confirm this PR works for me

<!--
If GitHub CI cannot be used to validate the build result (for example, if the
build is likely to take several hours), make sure to
[skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration).
When skipping CI, uncomment and fill out the following section.
Note: for builds that are likely to complete in less than 2 hours, it is not
acceptable to skip CI.
-->
<!-- 
#### Does it build and run successfully? 
(Please choose at least one native build and, if supported, at least one cross build. More are better.)
- [ ] I built this PR locally for my native architecture, (ARCH-LIBC)
- [ ] I built this PR locally for these architectures (if supported. mark crossbuilds):
  - [ ] aarch64-musl
  - [ ] armv7l
  - [ ] armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/29128.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-upgrade-caddy-2.3.0-29128.patch --]
[-- Type: text/x-diff, Size: 4492 bytes --]

From 68f52e80ff6c3938d39cbf4eb34f5805ee4d32b1 Mon Sep 17 00:00:00 2001
From: Patrick Pichler <git@patrickpichler.dev>
Date: Wed, 3 Mar 2021 06:02:58 +0100
Subject: [PATCH] caddy: upgrade to 2.3.0

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
---
 srcpkgs/caddy/INSTALL                         |  3 +--
 srcpkgs/caddy/INSTALL.md                      |  3 +++
 srcpkgs/caddy/files/Caddyfile                 |  0
 srcpkgs/caddy/files/caddy/run                 |  6 ++---
 .../caddy/patches/fix_version_command.patch   | 25 +++++++++++++++++++
 srcpkgs/caddy/template                        | 18 +++++++------
 6 files changed, 42 insertions(+), 13 deletions(-)
 create mode 100644 srcpkgs/caddy/INSTALL.md
 create mode 100644 srcpkgs/caddy/files/Caddyfile
 create mode 100644 srcpkgs/caddy/patches/fix_version_command.patch

diff --git a/srcpkgs/caddy/INSTALL b/srcpkgs/caddy/INSTALL
index db063595f436..03302bbf41d4 100644
--- a/srcpkgs/caddy/INSTALL
+++ b/srcpkgs/caddy/INSTALL
@@ -1,6 +1,5 @@
 case "${ACTION}" in
 post)
-	setcap CAP_NET_BIND_SERVICE=+ep usr/bin/caddy
-	chown -R caddy:caddy etc/caddy
+	setcap CAP_NET_BIND_SERVICE=+ep bin/caddy
 	;;
 esac
diff --git a/srcpkgs/caddy/INSTALL.md b/srcpkgs/caddy/INSTALL.md
new file mode 100644
index 000000000000..2b425ede6ea6
--- /dev/null
+++ b/srcpkgs/caddy/INSTALL.md
@@ -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!
diff --git a/srcpkgs/caddy/files/Caddyfile b/srcpkgs/caddy/files/Caddyfile
new file mode 100644
index 000000000000..e69de29bb2d1
diff --git a/srcpkgs/caddy/files/caddy/run b/srcpkgs/caddy/files/caddy/run
index ff0cc9c80306..80d9e10c5e17 100644
--- a/srcpkgs/caddy/files/caddy/run
+++ b/srcpkgs/caddy/files/caddy/run
@@ -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 --environ --config /etc/caddy/Caddyfile
diff --git a/srcpkgs/caddy/patches/fix_version_command.patch b/srcpkgs/caddy/patches/fix_version_command.patch
new file mode 100644
index 000000000000..094d59b285a9
--- /dev/null
+++ b/srcpkgs/caddy/patches/fix_version_command.patch
@@ -0,0 +1,25 @@
+Return fake module info to show correct build version.
+
+TODO: remove once https://github.com/golang/go/issues/29228 is 
+      fixed and replace with proper solution
+
+--- caddy.go
++++ caddy.go
+@@ -554,18 +554,4 @@
+-	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
+-	}
+-	return mod
++  return mod
+ }
diff --git a/srcpkgs/caddy/template b/srcpkgs/caddy/template
index 6fe986419c94..0a1380d98014 100644
--- a/srcpkgs/caddy/template
+++ b/srcpkgs/caddy/template
@@ -1,28 +1,30 @@
 # Template file for 'caddy'
 pkgname=caddy
-version=1.0.5
+version=2.3.0
 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=4688b122ac05be39622aa81324d1635f1642e4a66d731e82d210aef78cf2766a
 
 system_accounts="caddy"
+caddy_homedir="/var/lib/caddy"
+caddy_descr="caddy daemon"
+
 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
+	vinstall ${FILESDIR}/Caddyfile 600 etc/caddy
 }

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [PR REVIEW] caddy: upgrade to 2.3.0
  2021-02-28 19:50 [PR PATCH] caddy: upgrade to 2.3.0 patrickpichler
                   ` (16 preceding siblings ...)
  2021-04-14 17:53 ` [PR PATCH] [Updated] " patrickpichler
@ 2021-04-14 17:58 ` patrickpichler
  2021-04-14 18:36 ` lemmi
                   ` (25 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: patrickpichler @ 2021-04-14 17:58 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 200 bytes --]

New review comment by patrickpichler on void-packages repository

https://github.com/void-linux/void-packages/pull/29128#discussion_r613459120

Comment:
Good catch!

I've added an empty `Caddyfile`

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [PR REVIEW] caddy: upgrade to 2.3.0
  2021-02-28 19:50 [PR PATCH] caddy: upgrade to 2.3.0 patrickpichler
                   ` (17 preceding siblings ...)
  2021-04-14 17:58 ` [PR REVIEW] " patrickpichler
@ 2021-04-14 18:36 ` lemmi
  2021-04-14 18:41 ` [PR PATCH] [Updated] " patrickpichler
                   ` (24 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: lemmi @ 2021-04-14 18:36 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 186 bytes --]

New review comment by lemmi on void-packages repository

https://github.com/void-linux/void-packages/pull/29128#discussion_r613494010

Comment:
Don't forget to add this to `conf_files`.

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [PR PATCH] [Updated] caddy: upgrade to 2.3.0
  2021-02-28 19:50 [PR PATCH] caddy: upgrade to 2.3.0 patrickpichler
                   ` (18 preceding siblings ...)
  2021-04-14 18:36 ` lemmi
@ 2021-04-14 18:41 ` patrickpichler
  2021-04-14 18:42 ` [PR REVIEW] " patrickpichler
                   ` (23 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: patrickpichler @ 2021-04-14 18:41 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1551 bytes --]

There is an updated pull request by patrickpichler against master on the void-packages repository

https://github.com/patrickpichler/void-packages upgrade-caddy-2.3.0
https://github.com/void-linux/void-packages/pull/29128

caddy: upgrade to 2.3.0
As there is currently a bug with go build info
(https://github.com/golang/go/issues/29228) a patch is needed to
fix printing the correct version number of the binary. Once the bug is
fixed, the patch can be dropped.

Fix for #22092

#### Have the results of the proposed changes been tested?
- [ x] I use the packages affected by the proposed changes on a regular basis and confirm this PR works for me

<!--
If GitHub CI cannot be used to validate the build result (for example, if the
build is likely to take several hours), make sure to
[skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration).
When skipping CI, uncomment and fill out the following section.
Note: for builds that are likely to complete in less than 2 hours, it is not
acceptable to skip CI.
-->
<!-- 
#### Does it build and run successfully? 
(Please choose at least one native build and, if supported, at least one cross build. More are better.)
- [ ] I built this PR locally for my native architecture, (ARCH-LIBC)
- [ ] I built this PR locally for these architectures (if supported. mark crossbuilds):
  - [ ] aarch64-musl
  - [ ] armv7l
  - [ ] armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/29128.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-upgrade-caddy-2.3.0-29128.patch --]
[-- Type: text/x-diff, Size: 4599 bytes --]

From 00b7893396b6444c19433f763d47d9bca314dd2d Mon Sep 17 00:00:00 2001
From: Patrick Pichler <git@patrickpichler.dev>
Date: Wed, 3 Mar 2021 06:02:58 +0100
Subject: [PATCH] caddy: upgrade to 2.3.0

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
---
 srcpkgs/caddy/INSTALL                         |  3 +--
 srcpkgs/caddy/INSTALL.md                      |  3 +++
 srcpkgs/caddy/files/Caddyfile                 |  1 +
 srcpkgs/caddy/files/caddy/run                 |  6 ++---
 .../caddy/patches/fix_version_command.patch   | 25 +++++++++++++++++++
 srcpkgs/caddy/template                        | 20 +++++++++------
 6 files changed, 45 insertions(+), 13 deletions(-)
 create mode 100644 srcpkgs/caddy/INSTALL.md
 create mode 100644 srcpkgs/caddy/files/Caddyfile
 create mode 100644 srcpkgs/caddy/patches/fix_version_command.patch

diff --git a/srcpkgs/caddy/INSTALL b/srcpkgs/caddy/INSTALL
index db063595f436..03302bbf41d4 100644
--- a/srcpkgs/caddy/INSTALL
+++ b/srcpkgs/caddy/INSTALL
@@ -1,6 +1,5 @@
 case "${ACTION}" in
 post)
-	setcap CAP_NET_BIND_SERVICE=+ep usr/bin/caddy
-	chown -R caddy:caddy etc/caddy
+	setcap CAP_NET_BIND_SERVICE=+ep bin/caddy
 	;;
 esac
diff --git a/srcpkgs/caddy/INSTALL.md b/srcpkgs/caddy/INSTALL.md
new file mode 100644
index 000000000000..2b425ede6ea6
--- /dev/null
+++ b/srcpkgs/caddy/INSTALL.md
@@ -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!
diff --git a/srcpkgs/caddy/files/Caddyfile b/srcpkgs/caddy/files/Caddyfile
new file mode 100644
index 000000000000..8b137891791f
--- /dev/null
+++ b/srcpkgs/caddy/files/Caddyfile
@@ -0,0 +1 @@
+
diff --git a/srcpkgs/caddy/files/caddy/run b/srcpkgs/caddy/files/caddy/run
index ff0cc9c80306..80d9e10c5e17 100644
--- a/srcpkgs/caddy/files/caddy/run
+++ b/srcpkgs/caddy/files/caddy/run
@@ -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 --environ --config /etc/caddy/Caddyfile
diff --git a/srcpkgs/caddy/patches/fix_version_command.patch b/srcpkgs/caddy/patches/fix_version_command.patch
new file mode 100644
index 000000000000..094d59b285a9
--- /dev/null
+++ b/srcpkgs/caddy/patches/fix_version_command.patch
@@ -0,0 +1,25 @@
+Return fake module info to show correct build version.
+
+TODO: remove once https://github.com/golang/go/issues/29228 is 
+      fixed and replace with proper solution
+
+--- caddy.go
++++ caddy.go
+@@ -554,18 +554,4 @@
+-	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
+-	}
+-	return mod
++  return mod
+ }
diff --git a/srcpkgs/caddy/template b/srcpkgs/caddy/template
index 6fe986419c94..f67978e474d4 100644
--- a/srcpkgs/caddy/template
+++ b/srcpkgs/caddy/template
@@ -1,28 +1,32 @@
 # Template file for 'caddy'
 pkgname=caddy
-version=1.0.5
+version=2.3.0
 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=4688b122ac05be39622aa81324d1635f1642e4a66d731e82d210aef78cf2766a
 
 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
+	vinstall ${FILESDIR}/Caddyfile 600 etc/caddy
 }

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [PR REVIEW] caddy: upgrade to 2.3.0
  2021-02-28 19:50 [PR PATCH] caddy: upgrade to 2.3.0 patrickpichler
                   ` (19 preceding siblings ...)
  2021-04-14 18:41 ` [PR PATCH] [Updated] " patrickpichler
@ 2021-04-14 18:42 ` patrickpichler
  2021-04-14 19:27 ` ericonr
                   ` (22 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: patrickpichler @ 2021-04-14 18:42 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 197 bytes --]

New review comment by patrickpichler on void-packages repository

https://github.com/void-linux/void-packages/pull/29128#discussion_r613500129

Comment:
Thanks for pointing out!

I've added it. 

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [PR REVIEW] caddy: upgrade to 2.3.0
  2021-02-28 19:50 [PR PATCH] caddy: upgrade to 2.3.0 patrickpichler
                   ` (20 preceding siblings ...)
  2021-04-14 18:42 ` [PR REVIEW] " patrickpichler
@ 2021-04-14 19:27 ` ericonr
  2021-04-14 19:27 ` ericonr
                   ` (21 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: ericonr @ 2021-04-14 19:27 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 307 bytes --]

New review comment by ericonr on void-packages repository

https://github.com/void-linux/void-packages/pull/29128#discussion_r613529066

Comment:
I think carrying an empty file doesn't make sense here. You can use `vmkdir`, `touch` and `chmod` to create the file and directory without having to install it.

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [PR REVIEW] caddy: upgrade to 2.3.0
  2021-02-28 19:50 [PR PATCH] caddy: upgrade to 2.3.0 patrickpichler
                   ` (21 preceding siblings ...)
  2021-04-14 19:27 ` ericonr
@ 2021-04-14 19:27 ` ericonr
  2021-04-15  4:01 ` patrickpichler
                   ` (20 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: ericonr @ 2021-04-14 19:27 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 364 bytes --]

New review comment by ericonr on void-packages repository

https://github.com/void-linux/void-packages/pull/29128#discussion_r613529872

Comment:
Maybe 

```suggestion
exec chpst -u caddy caddy run --environ --config ${CONFFILE:-/etc/caddy/Caddyfile}
```

How does `caddy` behave if you don't give it a config file? Maybe we shouldn't start requiring one...

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [PR REVIEW] caddy: upgrade to 2.3.0
  2021-02-28 19:50 [PR PATCH] caddy: upgrade to 2.3.0 patrickpichler
                   ` (22 preceding siblings ...)
  2021-04-14 19:27 ` ericonr
@ 2021-04-15  4:01 ` patrickpichler
  2021-04-15 13:44 ` [PR PATCH] [Updated] " patrickpichler
                   ` (19 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: patrickpichler @ 2021-04-15  4:01 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 302 bytes --]

New review comment by patrickpichler on void-packages repository

https://github.com/void-linux/void-packages/pull/29128#discussion_r613740714

Comment:
Actually the file isn't allowed to be completely empty. 
It needs an empty line, otherwise caddy fails (strange behavior if you ask me, but yeah). 

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [PR PATCH] [Updated] caddy: upgrade to 2.3.0
  2021-02-28 19:50 [PR PATCH] caddy: upgrade to 2.3.0 patrickpichler
                   ` (23 preceding siblings ...)
  2021-04-15  4:01 ` patrickpichler
@ 2021-04-15 13:44 ` patrickpichler
  2021-05-14 19:58 ` mkreu
                   ` (18 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: patrickpichler @ 2021-04-15 13:44 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1551 bytes --]

There is an updated pull request by patrickpichler against master on the void-packages repository

https://github.com/patrickpichler/void-packages upgrade-caddy-2.3.0
https://github.com/void-linux/void-packages/pull/29128

caddy: upgrade to 2.3.0
As there is currently a bug with go build info
(https://github.com/golang/go/issues/29228) a patch is needed to
fix printing the correct version number of the binary. Once the bug is
fixed, the patch can be dropped.

Fix for #22092

#### Have the results of the proposed changes been tested?
- [ x] I use the packages affected by the proposed changes on a regular basis and confirm this PR works for me

<!--
If GitHub CI cannot be used to validate the build result (for example, if the
build is likely to take several hours), make sure to
[skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration).
When skipping CI, uncomment and fill out the following section.
Note: for builds that are likely to complete in less than 2 hours, it is not
acceptable to skip CI.
-->
<!-- 
#### Does it build and run successfully? 
(Please choose at least one native build and, if supported, at least one cross build. More are better.)
- [ ] I built this PR locally for my native architecture, (ARCH-LIBC)
- [ ] I built this PR locally for these architectures (if supported. mark crossbuilds):
  - [ ] aarch64-musl
  - [ ] armv7l
  - [ ] armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/29128.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-upgrade-caddy-2.3.0-29128.patch --]
[-- Type: text/x-diff, Size: 4613 bytes --]

From ce3b8388b6ffa0e0d3490b7025865419788daccf Mon Sep 17 00:00:00 2001
From: Patrick Pichler <git@patrickpichler.dev>
Date: Thu, 15 Apr 2021 15:44:37 +0200
Subject: [PATCH] caddy: upgrade to 2.3.0

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
---
 srcpkgs/caddy/INSTALL                         |  3 +--
 srcpkgs/caddy/INSTALL.md                      |  3 +++
 srcpkgs/caddy/files/Caddyfile                 |  1 +
 srcpkgs/caddy/files/caddy/run                 |  6 ++---
 .../caddy/patches/fix_version_command.patch   | 25 +++++++++++++++++++
 srcpkgs/caddy/template                        | 20 +++++++++------
 6 files changed, 45 insertions(+), 13 deletions(-)
 create mode 100644 srcpkgs/caddy/INSTALL.md
 create mode 100644 srcpkgs/caddy/files/Caddyfile
 create mode 100644 srcpkgs/caddy/patches/fix_version_command.patch

diff --git a/srcpkgs/caddy/INSTALL b/srcpkgs/caddy/INSTALL
index db063595f436..03302bbf41d4 100644
--- a/srcpkgs/caddy/INSTALL
+++ b/srcpkgs/caddy/INSTALL
@@ -1,6 +1,5 @@
 case "${ACTION}" in
 post)
-	setcap CAP_NET_BIND_SERVICE=+ep usr/bin/caddy
-	chown -R caddy:caddy etc/caddy
+	setcap CAP_NET_BIND_SERVICE=+ep bin/caddy
 	;;
 esac
diff --git a/srcpkgs/caddy/INSTALL.md b/srcpkgs/caddy/INSTALL.md
new file mode 100644
index 000000000000..2b425ede6ea6
--- /dev/null
+++ b/srcpkgs/caddy/INSTALL.md
@@ -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!
diff --git a/srcpkgs/caddy/files/Caddyfile b/srcpkgs/caddy/files/Caddyfile
new file mode 100644
index 000000000000..8b137891791f
--- /dev/null
+++ b/srcpkgs/caddy/files/Caddyfile
@@ -0,0 +1 @@
+
diff --git a/srcpkgs/caddy/files/caddy/run b/srcpkgs/caddy/files/caddy/run
index ff0cc9c80306..90b15c243364 100644
--- a/srcpkgs/caddy/files/caddy/run
+++ b/srcpkgs/caddy/files/caddy/run
@@ -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 --environ --config ${CONFFILE:-/etc/caddy/Caddyfile}
diff --git a/srcpkgs/caddy/patches/fix_version_command.patch b/srcpkgs/caddy/patches/fix_version_command.patch
new file mode 100644
index 000000000000..094d59b285a9
--- /dev/null
+++ b/srcpkgs/caddy/patches/fix_version_command.patch
@@ -0,0 +1,25 @@
+Return fake module info to show correct build version.
+
+TODO: remove once https://github.com/golang/go/issues/29228 is 
+      fixed and replace with proper solution
+
+--- caddy.go
++++ caddy.go
+@@ -554,18 +554,4 @@
+-	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
+-	}
+-	return mod
++  return mod
+ }
diff --git a/srcpkgs/caddy/template b/srcpkgs/caddy/template
index 6fe986419c94..f67978e474d4 100644
--- a/srcpkgs/caddy/template
+++ b/srcpkgs/caddy/template
@@ -1,28 +1,32 @@
 # Template file for 'caddy'
 pkgname=caddy
-version=1.0.5
+version=2.3.0
 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=4688b122ac05be39622aa81324d1635f1642e4a66d731e82d210aef78cf2766a
 
 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
+	vinstall ${FILESDIR}/Caddyfile 600 etc/caddy
 }

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: caddy: upgrade to 2.3.0
  2021-02-28 19:50 [PR PATCH] caddy: upgrade to 2.3.0 patrickpichler
                   ` (24 preceding siblings ...)
  2021-04-15 13:44 ` [PR PATCH] [Updated] " patrickpichler
@ 2021-05-14 19:58 ` mkreu
  2021-06-25 15:42 ` [PR REVIEW] " steinex
                   ` (17 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: mkreu @ 2021-05-14 19:58 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 169 bytes --]

New comment by mkreu on void-packages repository

https://github.com/void-linux/void-packages/pull/29128#issuecomment-841470591

Comment:
Are there any updates on this?

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [PR REVIEW] caddy: upgrade to 2.3.0
  2021-02-28 19:50 [PR PATCH] caddy: upgrade to 2.3.0 patrickpichler
                   ` (25 preceding siblings ...)
  2021-05-14 19:58 ` mkreu
@ 2021-06-25 15:42 ` steinex
  2021-06-25 15:42 ` steinex
                   ` (16 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: steinex @ 2021-06-25 15:42 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 280 bytes --]

New review comment by steinex on void-packages repository

https://github.com/void-linux/void-packages/pull/29128#discussion_r658860471

Comment:
The `chown` must be left intact, otherwise caddy isn't able to read the file on startup (you vinstall 600 the Caddyfile in template).

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [PR REVIEW] caddy: upgrade to 2.3.0
  2021-02-28 19:50 [PR PATCH] caddy: upgrade to 2.3.0 patrickpichler
                   ` (26 preceding siblings ...)
  2021-06-25 15:42 ` [PR REVIEW] " steinex
@ 2021-06-25 15:42 ` steinex
  2021-06-25 15:42 ` steinex
                   ` (15 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: steinex @ 2021-06-25 15:42 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 245 bytes --]

New review comment by steinex on void-packages repository

https://github.com/void-linux/void-packages/pull/29128#discussion_r658861500

Comment:
Please remove `--environ`, it does nothing but flooding syslog with caddys environment on startup.

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [PR REVIEW] caddy: upgrade to 2.3.0
  2021-02-28 19:50 [PR PATCH] caddy: upgrade to 2.3.0 patrickpichler
                   ` (27 preceding siblings ...)
  2021-06-25 15:42 ` steinex
@ 2021-06-25 15:42 ` steinex
  2021-06-25 15:44 ` steinex
                   ` (14 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: steinex @ 2021-06-25 15:42 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 168 bytes --]

New review comment by steinex on void-packages repository

https://github.com/void-linux/void-packages/pull/29128#discussion_r658861708

Comment:
Please bump to 2.4.3.

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: caddy: upgrade to 2.3.0
  2021-02-28 19:50 [PR PATCH] caddy: upgrade to 2.3.0 patrickpichler
                   ` (28 preceding siblings ...)
  2021-06-25 15:42 ` steinex
@ 2021-06-25 15:44 ` steinex
  2021-06-25 16:13 ` steinex
                   ` (13 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: steinex @ 2021-06-25 15:44 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 176 bytes --]

New comment by steinex on void-packages repository

https://github.com/void-linux/void-packages/pull/29128#issuecomment-868645520

Comment:
Other than that after a rebase LGTM

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: caddy: upgrade to 2.3.0
  2021-02-28 19:50 [PR PATCH] caddy: upgrade to 2.3.0 patrickpichler
                   ` (29 preceding siblings ...)
  2021-06-25 15:44 ` steinex
@ 2021-06-25 16:13 ` steinex
  2021-06-30 18:16 ` [PR PATCH] [Updated] " patrickpichler
                   ` (12 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: steinex @ 2021-06-25 16:13 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 193 bytes --]

New comment by steinex on void-packages repository

https://github.com/void-linux/void-packages/pull/29128#issuecomment-868675840

Comment:
Oh, and the patch needs to be changed to -Np1 format

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [PR PATCH] [Updated] caddy: upgrade to 2.3.0
  2021-02-28 19:50 [PR PATCH] caddy: upgrade to 2.3.0 patrickpichler
                   ` (30 preceding siblings ...)
  2021-06-25 16:13 ` steinex
@ 2021-06-30 18:16 ` patrickpichler
  2021-06-30 18:18 ` caddy: upgrade to 2.4.3 patrickpichler
                   ` (11 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: patrickpichler @ 2021-06-30 18:16 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1551 bytes --]

There is an updated pull request by patrickpichler against master on the void-packages repository

https://github.com/patrickpichler/void-packages upgrade-caddy-2.3.0
https://github.com/void-linux/void-packages/pull/29128

caddy: upgrade to 2.3.0
As there is currently a bug with go build info
(https://github.com/golang/go/issues/29228) a patch is needed to
fix printing the correct version number of the binary. Once the bug is
fixed, the patch can be dropped.

Fix for #22092

#### Have the results of the proposed changes been tested?
- [ x] I use the packages affected by the proposed changes on a regular basis and confirm this PR works for me

<!--
If GitHub CI cannot be used to validate the build result (for example, if the
build is likely to take several hours), make sure to
[skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration).
When skipping CI, uncomment and fill out the following section.
Note: for builds that are likely to complete in less than 2 hours, it is not
acceptable to skip CI.
-->
<!-- 
#### Does it build and run successfully? 
(Please choose at least one native build and, if supported, at least one cross build. More are better.)
- [ ] I built this PR locally for my native architecture, (ARCH-LIBC)
- [ ] I built this PR locally for these architectures (if supported. mark crossbuilds):
  - [ ] aarch64-musl
  - [ ] armv7l
  - [ ] armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/29128.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-upgrade-caddy-2.3.0-29128.patch --]
[-- Type: text/x-diff, Size: 4607 bytes --]

From 9b7275795042da46d203dade2606958707ca13b7 Mon Sep 17 00:00:00 2001
From: Patrick Pichler <git@patrickpichler.dev>
Date: Thu, 15 Apr 2021 15:44:37 +0200
Subject: [PATCH] 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
---
 srcpkgs/caddy/INSTALL                         |  2 +-
 srcpkgs/caddy/INSTALL.md                      |  3 +++
 srcpkgs/caddy/files/Caddyfile                 |  1 +
 srcpkgs/caddy/files/caddy/run                 |  6 +++---
 .../caddy/patches/fix_version_command.patch   | 21 +++++++++++++++++++
 srcpkgs/caddy/template                        | 20 +++++++++++-------
 6 files changed, 41 insertions(+), 12 deletions(-)
 create mode 100644 srcpkgs/caddy/INSTALL.md
 create mode 100644 srcpkgs/caddy/files/Caddyfile
 create mode 100644 srcpkgs/caddy/patches/fix_version_command.patch

diff --git a/srcpkgs/caddy/INSTALL b/srcpkgs/caddy/INSTALL
index db063595f436..202af2396ee7 100644
--- a/srcpkgs/caddy/INSTALL
+++ b/srcpkgs/caddy/INSTALL
@@ -1,6 +1,6 @@
 case "${ACTION}" in
 post)
-	setcap CAP_NET_BIND_SERVICE=+ep usr/bin/caddy
+	setcap CAP_NET_BIND_SERVICE=+ep bin/caddy
 	chown -R caddy:caddy etc/caddy
 	;;
 esac
diff --git a/srcpkgs/caddy/INSTALL.md b/srcpkgs/caddy/INSTALL.md
new file mode 100644
index 000000000000..2b425ede6ea6
--- /dev/null
+++ b/srcpkgs/caddy/INSTALL.md
@@ -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!
diff --git a/srcpkgs/caddy/files/Caddyfile b/srcpkgs/caddy/files/Caddyfile
new file mode 100644
index 000000000000..8b137891791f
--- /dev/null
+++ b/srcpkgs/caddy/files/Caddyfile
@@ -0,0 +1 @@
+
diff --git a/srcpkgs/caddy/files/caddy/run b/srcpkgs/caddy/files/caddy/run
index ff0cc9c80306..c8670fa67b69 100644
--- a/srcpkgs/caddy/files/caddy/run
+++ b/srcpkgs/caddy/files/caddy/run
@@ -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}
diff --git a/srcpkgs/caddy/patches/fix_version_command.patch b/srcpkgs/caddy/patches/fix_version_command.patch
new file mode 100644
index 000000000000..a55d571574b3
--- /dev/null
+++ b/srcpkgs/caddy/patches/fix_version_command.patch
@@ -0,0 +1,21 @@
+*** caddy.go.bkp	2021-06-30 20:00:39.914085640 +0200
+--- caddy.go	2021-06-30 20:02:48.007142966 +0200
+*************** func goModule(mod *debug.Module) *debug.
+*** 711,726 ****
+  	mod.Version = "unknown"
+- 	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
+- 	}
+  	return mod
+--- 711,712 ----
diff --git a/srcpkgs/caddy/template b/srcpkgs/caddy/template
index 6fe986419c94..31a10e2928b3 100644
--- a/srcpkgs/caddy/template
+++ b/srcpkgs/caddy/template
@@ -1,28 +1,32 @@
 # 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
+	vinstall ${FILESDIR}/Caddyfile 600 etc/caddy
 }

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: caddy: upgrade to 2.4.3
  2021-02-28 19:50 [PR PATCH] caddy: upgrade to 2.3.0 patrickpichler
                   ` (31 preceding siblings ...)
  2021-06-30 18:16 ` [PR PATCH] [Updated] " patrickpichler
@ 2021-06-30 18:18 ` patrickpichler
  2021-06-30 18:39 ` [PR PATCH] [Updated] " patrickpichler
                   ` (10 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: patrickpichler @ 2021-06-30 18:18 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 239 bytes --]

New comment by patrickpichler on void-packages repository

https://github.com/void-linux/void-packages/pull/29128#issuecomment-871626953

Comment:
All comments should be addressed :+1: 
Is there a way to create an `-Np1` patch with git? 

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [PR PATCH] [Updated] caddy: upgrade to 2.4.3
  2021-02-28 19:50 [PR PATCH] caddy: upgrade to 2.3.0 patrickpichler
                   ` (32 preceding siblings ...)
  2021-06-30 18:18 ` caddy: upgrade to 2.4.3 patrickpichler
@ 2021-06-30 18:39 ` patrickpichler
  2021-06-30 18:39 ` patrickpichler
                   ` (9 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: patrickpichler @ 2021-06-30 18:39 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1551 bytes --]

There is an updated pull request by patrickpichler against master on the void-packages repository

https://github.com/patrickpichler/void-packages upgrade-caddy-2.3.0
https://github.com/void-linux/void-packages/pull/29128

caddy: upgrade to 2.4.3
As there is currently a bug with go build info
(https://github.com/golang/go/issues/29228) a patch is needed to
fix printing the correct version number of the binary. Once the bug is
fixed, the patch can be dropped.

Fix for #22092

#### Have the results of the proposed changes been tested?
- [ x] I use the packages affected by the proposed changes on a regular basis and confirm this PR works for me

<!--
If GitHub CI cannot be used to validate the build result (for example, if the
build is likely to take several hours), make sure to
[skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration).
When skipping CI, uncomment and fill out the following section.
Note: for builds that are likely to complete in less than 2 hours, it is not
acceptable to skip CI.
-->
<!-- 
#### Does it build and run successfully? 
(Please choose at least one native build and, if supported, at least one cross build. More are better.)
- [ ] I built this PR locally for my native architecture, (ARCH-LIBC)
- [ ] I built this PR locally for these architectures (if supported. mark crossbuilds):
  - [ ] aarch64-musl
  - [ ] armv7l
  - [ ] armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/29128.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-upgrade-caddy-2.3.0-29128.patch --]
[-- Type: text/x-diff, Size: 4607 bytes --]

From e145c0a975b31134abc6dd39981c35a635890775 Mon Sep 17 00:00:00 2001
From: Patrick Pichler <git@patrickpichler.dev>
Date: Thu, 15 Apr 2021 15:44:37 +0200
Subject: [PATCH] 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
---
 srcpkgs/caddy/INSTALL                         |  2 +-
 srcpkgs/caddy/INSTALL.md                      |  3 +++
 srcpkgs/caddy/files/Caddyfile                 |  1 +
 srcpkgs/caddy/files/caddy/run                 |  6 +++---
 .../caddy/patches/fix_version_command.patch   | 21 +++++++++++++++++++
 srcpkgs/caddy/template                        | 20 +++++++++++-------
 6 files changed, 41 insertions(+), 12 deletions(-)
 create mode 100644 srcpkgs/caddy/INSTALL.md
 create mode 100644 srcpkgs/caddy/files/Caddyfile
 create mode 100644 srcpkgs/caddy/patches/fix_version_command.patch

diff --git a/srcpkgs/caddy/INSTALL b/srcpkgs/caddy/INSTALL
index db063595f436..202af2396ee7 100644
--- a/srcpkgs/caddy/INSTALL
+++ b/srcpkgs/caddy/INSTALL
@@ -1,6 +1,6 @@
 case "${ACTION}" in
 post)
-	setcap CAP_NET_BIND_SERVICE=+ep usr/bin/caddy
+	setcap CAP_NET_BIND_SERVICE=+ep bin/caddy
 	chown -R caddy:caddy etc/caddy
 	;;
 esac
diff --git a/srcpkgs/caddy/INSTALL.md b/srcpkgs/caddy/INSTALL.md
new file mode 100644
index 000000000000..2b425ede6ea6
--- /dev/null
+++ b/srcpkgs/caddy/INSTALL.md
@@ -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!
diff --git a/srcpkgs/caddy/files/Caddyfile b/srcpkgs/caddy/files/Caddyfile
new file mode 100644
index 000000000000..8b137891791f
--- /dev/null
+++ b/srcpkgs/caddy/files/Caddyfile
@@ -0,0 +1 @@
+
diff --git a/srcpkgs/caddy/files/caddy/run b/srcpkgs/caddy/files/caddy/run
index ff0cc9c80306..c8670fa67b69 100644
--- a/srcpkgs/caddy/files/caddy/run
+++ b/srcpkgs/caddy/files/caddy/run
@@ -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}
diff --git a/srcpkgs/caddy/patches/fix_version_command.patch b/srcpkgs/caddy/patches/fix_version_command.patch
new file mode 100644
index 000000000000..a55d571574b3
--- /dev/null
+++ b/srcpkgs/caddy/patches/fix_version_command.patch
@@ -0,0 +1,21 @@
+*** caddy.go.bkp	2021-06-30 20:00:39.914085640 +0200
+--- caddy.go	2021-06-30 20:02:48.007142966 +0200
+*************** func goModule(mod *debug.Module) *debug.
+*** 711,726 ****
+  	mod.Version = "unknown"
+- 	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
+- 	}
+  	return mod
+--- 711,712 ----
diff --git a/srcpkgs/caddy/template b/srcpkgs/caddy/template
index 6fe986419c94..31a10e2928b3 100644
--- a/srcpkgs/caddy/template
+++ b/srcpkgs/caddy/template
@@ -1,28 +1,32 @@
 # 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
+	vinstall ${FILESDIR}/Caddyfile 600 etc/caddy
 }

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: caddy: upgrade to 2.4.3
  2021-02-28 19:50 [PR PATCH] caddy: upgrade to 2.3.0 patrickpichler
                   ` (33 preceding siblings ...)
  2021-06-30 18:39 ` [PR PATCH] [Updated] " patrickpichler
@ 2021-06-30 18:39 ` patrickpichler
  2021-06-30 18:40 ` [PR PATCH] [Updated] " patrickpichler
                   ` (8 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: patrickpichler @ 2021-06-30 18:39 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 185 bytes --]

New comment by patrickpichler on void-packages repository

https://github.com/void-linux/void-packages/pull/29128#issuecomment-871626953

Comment:
All comments should be addressed :+1:

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [PR PATCH] [Updated] caddy: upgrade to 2.4.3
  2021-02-28 19:50 [PR PATCH] caddy: upgrade to 2.3.0 patrickpichler
                   ` (34 preceding siblings ...)
  2021-06-30 18:39 ` patrickpichler
@ 2021-06-30 18:40 ` patrickpichler
  2021-06-30 18:44 ` steinex
                   ` (7 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: patrickpichler @ 2021-06-30 18:40 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1551 bytes --]

There is an updated pull request by patrickpichler against master on the void-packages repository

https://github.com/patrickpichler/void-packages upgrade-caddy-2.3.0
https://github.com/void-linux/void-packages/pull/29128

caddy: upgrade to 2.4.3
As there is currently a bug with go build info
(https://github.com/golang/go/issues/29228) a patch is needed to
fix printing the correct version number of the binary. Once the bug is
fixed, the patch can be dropped.

Fix for #22092

#### Have the results of the proposed changes been tested?
- [ x] I use the packages affected by the proposed changes on a regular basis and confirm this PR works for me

<!--
If GitHub CI cannot be used to validate the build result (for example, if the
build is likely to take several hours), make sure to
[skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration).
When skipping CI, uncomment and fill out the following section.
Note: for builds that are likely to complete in less than 2 hours, it is not
acceptable to skip CI.
-->
<!-- 
#### Does it build and run successfully? 
(Please choose at least one native build and, if supported, at least one cross build. More are better.)
- [ ] I built this PR locally for my native architecture, (ARCH-LIBC)
- [ ] I built this PR locally for these architectures (if supported. mark crossbuilds):
  - [ ] aarch64-musl
  - [ ] armv7l
  - [ ] armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/29128.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-upgrade-caddy-2.3.0-29128.patch --]
[-- Type: text/x-diff, Size: 4496 bytes --]

From 2a58aab35c23e1bfa5c23142168938dfb7f4efc3 Mon Sep 17 00:00:00 2001
From: Patrick Pichler <git@patrickpichler.dev>
Date: Thu, 15 Apr 2021 15:44:37 +0200
Subject: [PATCH] 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
---
 srcpkgs/caddy/INSTALL                         |  2 +-
 srcpkgs/caddy/INSTALL.md                      |  3 +++
 srcpkgs/caddy/files/Caddyfile                 |  1 +
 srcpkgs/caddy/files/caddy/run                 |  6 +++---
 .../caddy/patches/fix_version_command.patch   | 19 ++++++++++++++++++
 srcpkgs/caddy/template                        | 20 +++++++++++--------
 6 files changed, 39 insertions(+), 12 deletions(-)
 create mode 100644 srcpkgs/caddy/INSTALL.md
 create mode 100644 srcpkgs/caddy/files/Caddyfile
 create mode 100644 srcpkgs/caddy/patches/fix_version_command.patch

diff --git a/srcpkgs/caddy/INSTALL b/srcpkgs/caddy/INSTALL
index db063595f436..202af2396ee7 100644
--- a/srcpkgs/caddy/INSTALL
+++ b/srcpkgs/caddy/INSTALL
@@ -1,6 +1,6 @@
 case "${ACTION}" in
 post)
-	setcap CAP_NET_BIND_SERVICE=+ep usr/bin/caddy
+	setcap CAP_NET_BIND_SERVICE=+ep bin/caddy
 	chown -R caddy:caddy etc/caddy
 	;;
 esac
diff --git a/srcpkgs/caddy/INSTALL.md b/srcpkgs/caddy/INSTALL.md
new file mode 100644
index 000000000000..2b425ede6ea6
--- /dev/null
+++ b/srcpkgs/caddy/INSTALL.md
@@ -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!
diff --git a/srcpkgs/caddy/files/Caddyfile b/srcpkgs/caddy/files/Caddyfile
new file mode 100644
index 000000000000..8b137891791f
--- /dev/null
+++ b/srcpkgs/caddy/files/Caddyfile
@@ -0,0 +1 @@
+
diff --git a/srcpkgs/caddy/files/caddy/run b/srcpkgs/caddy/files/caddy/run
index ff0cc9c80306..c8670fa67b69 100644
--- a/srcpkgs/caddy/files/caddy/run
+++ b/srcpkgs/caddy/files/caddy/run
@@ -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}
diff --git a/srcpkgs/caddy/patches/fix_version_command.patch b/srcpkgs/caddy/patches/fix_version_command.patch
new file mode 100644
index 000000000000..6a7d17ea786d
--- /dev/null
+++ b/srcpkgs/caddy/patches/fix_version_command.patch
@@ -0,0 +1,19 @@
+--- a/caddy.go
++++ b/caddy.go
+@@ -711,16 +711,2 @@ func goModule(mod *debug.Module) *debug.Module {
+ 	mod.Version = "unknown"
+-	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
+-	}
+ 	return mod
diff --git a/srcpkgs/caddy/template b/srcpkgs/caddy/template
index 6fe986419c94..31a10e2928b3 100644
--- a/srcpkgs/caddy/template
+++ b/srcpkgs/caddy/template
@@ -1,28 +1,32 @@
 # 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
+	vinstall ${FILESDIR}/Caddyfile 600 etc/caddy
 }

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: caddy: upgrade to 2.4.3
  2021-02-28 19:50 [PR PATCH] caddy: upgrade to 2.3.0 patrickpichler
                   ` (35 preceding siblings ...)
  2021-06-30 18:40 ` [PR PATCH] [Updated] " patrickpichler
@ 2021-06-30 18:44 ` steinex
  2021-06-30 18:45 ` [PR PATCH] [Updated] " patrickpichler
                   ` (6 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: steinex @ 2021-06-30 18:44 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 161 bytes --]

New comment by steinex on void-packages repository

https://github.com/void-linux/void-packages/pull/29128#issuecomment-871643024

Comment:
Thank you! LGTM 👍

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [PR PATCH] [Updated] caddy: upgrade to 2.4.3
  2021-02-28 19:50 [PR PATCH] caddy: upgrade to 2.3.0 patrickpichler
                   ` (36 preceding siblings ...)
  2021-06-30 18:44 ` steinex
@ 2021-06-30 18:45 ` patrickpichler
  2021-06-30 18:50 ` patrickpichler
                   ` (5 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: patrickpichler @ 2021-06-30 18:45 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1551 bytes --]

There is an updated pull request by patrickpichler against master on the void-packages repository

https://github.com/patrickpichler/void-packages upgrade-caddy-2.3.0
https://github.com/void-linux/void-packages/pull/29128

caddy: upgrade to 2.4.3
As there is currently a bug with go build info
(https://github.com/golang/go/issues/29228) a patch is needed to
fix printing the correct version number of the binary. Once the bug is
fixed, the patch can be dropped.

Fix for #22092

#### Have the results of the proposed changes been tested?
- [ x] I use the packages affected by the proposed changes on a regular basis and confirm this PR works for me

<!--
If GitHub CI cannot be used to validate the build result (for example, if the
build is likely to take several hours), make sure to
[skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration).
When skipping CI, uncomment and fill out the following section.
Note: for builds that are likely to complete in less than 2 hours, it is not
acceptable to skip CI.
-->
<!-- 
#### Does it build and run successfully? 
(Please choose at least one native build and, if supported, at least one cross build. More are better.)
- [ ] I built this PR locally for my native architecture, (ARCH-LIBC)
- [ ] I built this PR locally for these architectures (if supported. mark crossbuilds):
  - [ ] aarch64-musl
  - [ ] armv7l
  - [ ] armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/29128.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-upgrade-caddy-2.3.0-29128.patch --]
[-- Type: text/x-diff, Size: 4441 bytes --]

From 1adbd2eb0a7ba811fddb810860356a46d59669a6 Mon Sep 17 00:00:00 2001
From: Patrick Pichler <git@patrickpichler.dev>
Date: Thu, 15 Apr 2021 15:44:37 +0200
Subject: [PATCH] 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
---
 srcpkgs/caddy/INSTALL                         |  2 +-
 srcpkgs/caddy/INSTALL.md                      |  3 +++
 srcpkgs/caddy/files/Caddyfile                 |  1 +
 srcpkgs/caddy/files/caddy/run                 |  6 +++---
 .../caddy/patches/fix_version_command.patch   | 17 ++++++++++++++++
 srcpkgs/caddy/template                        | 20 +++++++++++--------
 6 files changed, 37 insertions(+), 12 deletions(-)
 create mode 100644 srcpkgs/caddy/INSTALL.md
 create mode 100644 srcpkgs/caddy/files/Caddyfile
 create mode 100644 srcpkgs/caddy/patches/fix_version_command.patch

diff --git a/srcpkgs/caddy/INSTALL b/srcpkgs/caddy/INSTALL
index db063595f436..202af2396ee7 100644
--- a/srcpkgs/caddy/INSTALL
+++ b/srcpkgs/caddy/INSTALL
@@ -1,6 +1,6 @@
 case "${ACTION}" in
 post)
-	setcap CAP_NET_BIND_SERVICE=+ep usr/bin/caddy
+	setcap CAP_NET_BIND_SERVICE=+ep bin/caddy
 	chown -R caddy:caddy etc/caddy
 	;;
 esac
diff --git a/srcpkgs/caddy/INSTALL.md b/srcpkgs/caddy/INSTALL.md
new file mode 100644
index 000000000000..2b425ede6ea6
--- /dev/null
+++ b/srcpkgs/caddy/INSTALL.md
@@ -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!
diff --git a/srcpkgs/caddy/files/Caddyfile b/srcpkgs/caddy/files/Caddyfile
new file mode 100644
index 000000000000..8b137891791f
--- /dev/null
+++ b/srcpkgs/caddy/files/Caddyfile
@@ -0,0 +1 @@
+
diff --git a/srcpkgs/caddy/files/caddy/run b/srcpkgs/caddy/files/caddy/run
index ff0cc9c80306..c8670fa67b69 100644
--- a/srcpkgs/caddy/files/caddy/run
+++ b/srcpkgs/caddy/files/caddy/run
@@ -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}
diff --git a/srcpkgs/caddy/patches/fix_version_command.patch b/srcpkgs/caddy/patches/fix_version_command.patch
new file mode 100644
index 000000000000..3f1409e1773e
--- /dev/null
+++ b/srcpkgs/caddy/patches/fix_version_command.patch
@@ -0,0 +1,17 @@
+--- caddy.go
++++ caddy.go
+@@ -712,14 +711,0 @@ func goModule(mod *debug.Module) *debug.
+-	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
+-	}
diff --git a/srcpkgs/caddy/template b/srcpkgs/caddy/template
index 6fe986419c94..31a10e2928b3 100644
--- a/srcpkgs/caddy/template
+++ b/srcpkgs/caddy/template
@@ -1,28 +1,32 @@
 # 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
+	vinstall ${FILESDIR}/Caddyfile 600 etc/caddy
 }

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: caddy: upgrade to 2.4.3
  2021-02-28 19:50 [PR PATCH] caddy: upgrade to 2.3.0 patrickpichler
                   ` (37 preceding siblings ...)
  2021-06-30 18:45 ` [PR PATCH] [Updated] " patrickpichler
@ 2021-06-30 18:50 ` patrickpichler
  2021-06-30 18:56 ` [PR PATCH] [Updated] " patrickpichler
                   ` (4 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: patrickpichler @ 2021-06-30 18:50 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 457 bytes --]

New comment by patrickpichler on void-packages repository

https://github.com/void-linux/void-packages/pull/29128#issuecomment-871646744

Comment:
I'm a bit confused how to best create the patch fie in `-Np1` format. 
I tried it with `diff -Naurp0` but now the patch cannot be applied (I tested locally 
with the wrong `./xbps-src` cmd,  hence the failing check :man_facepalming:) 

What is the recommended way of creating such patch files? `git diff`?

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [PR PATCH] [Updated] caddy: upgrade to 2.4.3
  2021-02-28 19:50 [PR PATCH] caddy: upgrade to 2.3.0 patrickpichler
                   ` (38 preceding siblings ...)
  2021-06-30 18:50 ` patrickpichler
@ 2021-06-30 18:56 ` patrickpichler
  2021-07-16 19:45 ` ericonr
                   ` (3 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: patrickpichler @ 2021-06-30 18:56 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1551 bytes --]

There is an updated pull request by patrickpichler against master on the void-packages repository

https://github.com/patrickpichler/void-packages upgrade-caddy-2.3.0
https://github.com/void-linux/void-packages/pull/29128

caddy: upgrade to 2.4.3
As there is currently a bug with go build info
(https://github.com/golang/go/issues/29228) a patch is needed to
fix printing the correct version number of the binary. Once the bug is
fixed, the patch can be dropped.

Fix for #22092

#### Have the results of the proposed changes been tested?
- [ x] I use the packages affected by the proposed changes on a regular basis and confirm this PR works for me

<!--
If GitHub CI cannot be used to validate the build result (for example, if the
build is likely to take several hours), make sure to
[skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration).
When skipping CI, uncomment and fill out the following section.
Note: for builds that are likely to complete in less than 2 hours, it is not
acceptable to skip CI.
-->
<!-- 
#### Does it build and run successfully? 
(Please choose at least one native build and, if supported, at least one cross build. More are better.)
- [ ] I built this PR locally for my native architecture, (ARCH-LIBC)
- [ ] I built this PR locally for these architectures (if supported. mark crossbuilds):
  - [ ] aarch64-musl
  - [ ] armv7l
  - [ ] armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/29128.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-upgrade-caddy-2.3.0-29128.patch --]
[-- Type: text/x-diff, Size: 4453 bytes --]

From 5173842ac8e4866f92efd5077782b9671ad3cc05 Mon Sep 17 00:00:00 2001
From: Patrick Pichler <git@patrickpichler.dev>
Date: Thu, 15 Apr 2021 15:44:37 +0200
Subject: [PATCH] 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
---
 srcpkgs/caddy/INSTALL                         |  2 +-
 srcpkgs/caddy/INSTALL.md                      |  3 +++
 srcpkgs/caddy/files/Caddyfile                 |  1 +
 srcpkgs/caddy/files/caddy/run                 |  6 +++---
 .../caddy/patches/fix_version_command.patch   | 17 ++++++++++++++++
 srcpkgs/caddy/template                        | 20 +++++++++++--------
 6 files changed, 37 insertions(+), 12 deletions(-)
 create mode 100644 srcpkgs/caddy/INSTALL.md
 create mode 100644 srcpkgs/caddy/files/Caddyfile
 create mode 100644 srcpkgs/caddy/patches/fix_version_command.patch

diff --git a/srcpkgs/caddy/INSTALL b/srcpkgs/caddy/INSTALL
index db063595f436..202af2396ee7 100644
--- a/srcpkgs/caddy/INSTALL
+++ b/srcpkgs/caddy/INSTALL
@@ -1,6 +1,6 @@
 case "${ACTION}" in
 post)
-	setcap CAP_NET_BIND_SERVICE=+ep usr/bin/caddy
+	setcap CAP_NET_BIND_SERVICE=+ep bin/caddy
 	chown -R caddy:caddy etc/caddy
 	;;
 esac
diff --git a/srcpkgs/caddy/INSTALL.md b/srcpkgs/caddy/INSTALL.md
new file mode 100644
index 000000000000..2b425ede6ea6
--- /dev/null
+++ b/srcpkgs/caddy/INSTALL.md
@@ -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!
diff --git a/srcpkgs/caddy/files/Caddyfile b/srcpkgs/caddy/files/Caddyfile
new file mode 100644
index 000000000000..8b137891791f
--- /dev/null
+++ b/srcpkgs/caddy/files/Caddyfile
@@ -0,0 +1 @@
+
diff --git a/srcpkgs/caddy/files/caddy/run b/srcpkgs/caddy/files/caddy/run
index ff0cc9c80306..c8670fa67b69 100644
--- a/srcpkgs/caddy/files/caddy/run
+++ b/srcpkgs/caddy/files/caddy/run
@@ -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}
diff --git a/srcpkgs/caddy/patches/fix_version_command.patch b/srcpkgs/caddy/patches/fix_version_command.patch
new file mode 100644
index 000000000000..4726054f48d7
--- /dev/null
+++ b/srcpkgs/caddy/patches/fix_version_command.patch
@@ -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
+-	}
diff --git a/srcpkgs/caddy/template b/srcpkgs/caddy/template
index 6fe986419c94..31a10e2928b3 100644
--- a/srcpkgs/caddy/template
+++ b/srcpkgs/caddy/template
@@ -1,28 +1,32 @@
 # 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
+	vinstall ${FILESDIR}/Caddyfile 600 etc/caddy
 }

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [PR PATCH] [Updated] caddy: upgrade to 2.4.3
  2021-02-28 19:50 [PR PATCH] caddy: upgrade to 2.3.0 patrickpichler
                   ` (39 preceding siblings ...)
  2021-06-30 18:56 ` [PR PATCH] [Updated] " patrickpichler
@ 2021-07-16 19:45 ` ericonr
  2021-07-16 19:48 ` ericonr
                   ` (2 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: ericonr @ 2021-07-16 19:45 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1544 bytes --]

There is an updated pull request by ericonr against master on the void-packages repository

https://github.com/patrickpichler/void-packages upgrade-caddy-2.3.0
https://github.com/void-linux/void-packages/pull/29128

caddy: upgrade to 2.4.3
As there is currently a bug with go build info
(https://github.com/golang/go/issues/29228) a patch is needed to
fix printing the correct version number of the binary. Once the bug is
fixed, the patch can be dropped.

Fix for #22092

#### Have the results of the proposed changes been tested?
- [ x] I use the packages affected by the proposed changes on a regular basis and confirm this PR works for me

<!--
If GitHub CI cannot be used to validate the build result (for example, if the
build is likely to take several hours), make sure to
[skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration).
When skipping CI, uncomment and fill out the following section.
Note: for builds that are likely to complete in less than 2 hours, it is not
acceptable to skip CI.
-->
<!-- 
#### Does it build and run successfully? 
(Please choose at least one native build and, if supported, at least one cross build. More are better.)
- [ ] I built this PR locally for my native architecture, (ARCH-LIBC)
- [ ] I built this PR locally for these architectures (if supported. mark crossbuilds):
  - [ ] aarch64-musl
  - [ ] armv7l
  - [ ] armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/29128.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-upgrade-caddy-2.3.0-29128.patch --]
[-- Type: text/x-diff, Size: 3777 bytes --]

From 5978f31f0ff6d033250acab14ec4513ae651b64d Mon Sep 17 00:00:00 2001
From: Patrick Pichler <git@patrickpichler.dev>
Date: Thu, 15 Apr 2021 15:44:37 +0200
Subject: [PATCH] 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
---
 srcpkgs/caddy/INSTALL.md                      |  3 +++
 srcpkgs/caddy/files/caddy/run                 |  6 ++---
 .../caddy/patches/fix_version_command.patch   | 17 ++++++++++++++
 srcpkgs/caddy/template                        | 22 ++++++++++++-------
 4 files changed, 37 insertions(+), 11 deletions(-)
 create mode 100644 srcpkgs/caddy/INSTALL.md
 create mode 100644 srcpkgs/caddy/patches/fix_version_command.patch

diff --git a/srcpkgs/caddy/INSTALL.md b/srcpkgs/caddy/INSTALL.md
new file mode 100644
index 000000000000..2b425ede6ea6
--- /dev/null
+++ b/srcpkgs/caddy/INSTALL.md
@@ -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!
diff --git a/srcpkgs/caddy/files/caddy/run b/srcpkgs/caddy/files/caddy/run
index ff0cc9c80306..c8670fa67b69 100644
--- a/srcpkgs/caddy/files/caddy/run
+++ b/srcpkgs/caddy/files/caddy/run
@@ -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}
diff --git a/srcpkgs/caddy/patches/fix_version_command.patch b/srcpkgs/caddy/patches/fix_version_command.patch
new file mode 100644
index 000000000000..4726054f48d7
--- /dev/null
+++ b/srcpkgs/caddy/patches/fix_version_command.patch
@@ -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
+-	}
diff --git a/srcpkgs/caddy/template b/srcpkgs/caddy/template
index 6fe986419c94..6a1fabf0fac3 100644
--- a/srcpkgs/caddy/template
+++ b/srcpkgs/caddy/template
@@ -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
 }

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [PR PATCH] [Updated] caddy: upgrade to 2.4.3
  2021-02-28 19:50 [PR PATCH] caddy: upgrade to 2.3.0 patrickpichler
                   ` (40 preceding siblings ...)
  2021-07-16 19:45 ` ericonr
@ 2021-07-16 19:48 ` ericonr
  2021-07-16 19:56 ` [PR PATCH] [Merged]: " ericonr
  2021-07-16 19:57 ` ericonr
  43 siblings, 0 replies; 45+ messages in thread
From: ericonr @ 2021-07-16 19:48 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1544 bytes --]

There is an updated pull request by ericonr against master on the void-packages repository

https://github.com/patrickpichler/void-packages upgrade-caddy-2.3.0
https://github.com/void-linux/void-packages/pull/29128

caddy: upgrade to 2.4.3
As there is currently a bug with go build info
(https://github.com/golang/go/issues/29228) a patch is needed to
fix printing the correct version number of the binary. Once the bug is
fixed, the patch can be dropped.

Fix for #22092

#### Have the results of the proposed changes been tested?
- [ x] I use the packages affected by the proposed changes on a regular basis and confirm this PR works for me

<!--
If GitHub CI cannot be used to validate the build result (for example, if the
build is likely to take several hours), make sure to
[skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration).
When skipping CI, uncomment and fill out the following section.
Note: for builds that are likely to complete in less than 2 hours, it is not
acceptable to skip CI.
-->
<!-- 
#### Does it build and run successfully? 
(Please choose at least one native build and, if supported, at least one cross build. More are better.)
- [ ] I built this PR locally for my native architecture, (ARCH-LIBC)
- [ ] I built this PR locally for these architectures (if supported. mark crossbuilds):
  - [ ] aarch64-musl
  - [ ] armv7l
  - [ ] armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/29128.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-upgrade-caddy-2.3.0-29128.patch --]
[-- Type: text/x-diff, Size: 3781 bytes --]

From 7a5fb5fc03cc4d303da0a30fed8beae746e4c552 Mon Sep 17 00:00:00 2001
From: Patrick Pichler <git@patrickpichler.dev>
Date: Thu, 15 Apr 2021 15:44:37 +0200
Subject: [PATCH] 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
---
 srcpkgs/caddy/INSTALL.msg                     |  3 +++
 srcpkgs/caddy/files/caddy/run                 |  6 ++---
 .../caddy/patches/fix_version_command.patch   | 17 ++++++++++++++
 srcpkgs/caddy/template                        | 22 ++++++++++++-------
 4 files changed, 37 insertions(+), 11 deletions(-)
 create mode 100644 srcpkgs/caddy/INSTALL.msg
 create mode 100644 srcpkgs/caddy/patches/fix_version_command.patch

diff --git a/srcpkgs/caddy/INSTALL.msg b/srcpkgs/caddy/INSTALL.msg
new file mode 100644
index 000000000000..2b425ede6ea6
--- /dev/null
+++ b/srcpkgs/caddy/INSTALL.msg
@@ -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!
diff --git a/srcpkgs/caddy/files/caddy/run b/srcpkgs/caddy/files/caddy/run
index ff0cc9c80306..c8670fa67b69 100644
--- a/srcpkgs/caddy/files/caddy/run
+++ b/srcpkgs/caddy/files/caddy/run
@@ -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}
diff --git a/srcpkgs/caddy/patches/fix_version_command.patch b/srcpkgs/caddy/patches/fix_version_command.patch
new file mode 100644
index 000000000000..4726054f48d7
--- /dev/null
+++ b/srcpkgs/caddy/patches/fix_version_command.patch
@@ -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
+-	}
diff --git a/srcpkgs/caddy/template b/srcpkgs/caddy/template
index 6fe986419c94..6a1fabf0fac3 100644
--- a/srcpkgs/caddy/template
+++ b/srcpkgs/caddy/template
@@ -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
 }

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [PR PATCH] [Merged]: caddy: upgrade to 2.4.3
  2021-02-28 19:50 [PR PATCH] caddy: upgrade to 2.3.0 patrickpichler
                   ` (41 preceding siblings ...)
  2021-07-16 19:48 ` ericonr
@ 2021-07-16 19:56 ` ericonr
  2021-07-16 19:57 ` ericonr
  43 siblings, 0 replies; 45+ messages in thread
From: ericonr @ 2021-07-16 19:56 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1369 bytes --]

There's a merged pull request on the void-packages repository

caddy: upgrade to 2.4.3
https://github.com/void-linux/void-packages/pull/29128

Description:
As there is currently a bug with go build info
(https://github.com/golang/go/issues/29228) a patch is needed to
fix printing the correct version number of the binary. Once the bug is
fixed, the patch can be dropped.

Fix for #22092

#### Have the results of the proposed changes been tested?
- [ x] I use the packages affected by the proposed changes on a regular basis and confirm this PR works for me

<!--
If GitHub CI cannot be used to validate the build result (for example, if the
build is likely to take several hours), make sure to
[skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration).
When skipping CI, uncomment and fill out the following section.
Note: for builds that are likely to complete in less than 2 hours, it is not
acceptable to skip CI.
-->
<!-- 
#### Does it build and run successfully? 
(Please choose at least one native build and, if supported, at least one cross build. More are better.)
- [ ] I built this PR locally for my native architecture, (ARCH-LIBC)
- [ ] I built this PR locally for these architectures (if supported. mark crossbuilds):
  - [ ] aarch64-musl
  - [ ] armv7l
  - [ ] armv6l-musl
-->


^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: caddy: upgrade to 2.4.3
  2021-02-28 19:50 [PR PATCH] caddy: upgrade to 2.3.0 patrickpichler
                   ` (42 preceding siblings ...)
  2021-07-16 19:56 ` [PR PATCH] [Merged]: " ericonr
@ 2021-07-16 19:57 ` ericonr
  43 siblings, 0 replies; 45+ messages in thread
From: ericonr @ 2021-07-16 19:57 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 263 bytes --]

New comment by ericonr on void-packages repository

https://github.com/void-linux/void-packages/pull/29128#issuecomment-881684002

Comment:
I had to fix some tiny stuff; `INSTALL.md` wasn't the correct file name, and there was an unnecessary change to `INSTALL`.

^ permalink raw reply	[flat|nested] 45+ messages in thread

end of thread, other threads:[~2021-07-16 19:57 UTC | newest]

Thread overview: 45+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-28 19:50 [PR PATCH] caddy: upgrade to 2.3.0 patrickpichler
2021-02-28 19:51 ` [PR PATCH] [Updated] " patrickpichler
2021-03-01  5:00 ` patrickpichler
2021-03-01  9:14 ` the-maldridge
2021-03-01  9:40 ` patrickpichler
2021-03-01  9:41 ` patrickpichler
2021-03-01  9:41 ` patrickpichler
2021-03-01  9:43 ` patrickpichler
2021-03-01 19:56 ` [PR REVIEW] " ericonr
2021-03-02  5:22 ` [PR PATCH] [Updated] " patrickpichler
2021-03-02  5:55 ` patrickpichler
2021-03-02  6:58 ` patrickpichler
2021-03-03  5:03 ` [PR PATCH] [Updated] " patrickpichler
2021-03-08  4:04 ` ericonr
2021-03-16 16:53 ` patrickpichler
2021-03-17 11:06 ` lemmi
2021-04-11  4:10 ` [PR REVIEW] " ericonr
2021-04-14 17:53 ` [PR PATCH] [Updated] " patrickpichler
2021-04-14 17:58 ` [PR REVIEW] " patrickpichler
2021-04-14 18:36 ` lemmi
2021-04-14 18:41 ` [PR PATCH] [Updated] " patrickpichler
2021-04-14 18:42 ` [PR REVIEW] " patrickpichler
2021-04-14 19:27 ` ericonr
2021-04-14 19:27 ` ericonr
2021-04-15  4:01 ` patrickpichler
2021-04-15 13:44 ` [PR PATCH] [Updated] " patrickpichler
2021-05-14 19:58 ` mkreu
2021-06-25 15:42 ` [PR REVIEW] " steinex
2021-06-25 15:42 ` steinex
2021-06-25 15:42 ` steinex
2021-06-25 15:44 ` steinex
2021-06-25 16:13 ` steinex
2021-06-30 18:16 ` [PR PATCH] [Updated] " patrickpichler
2021-06-30 18:18 ` caddy: upgrade to 2.4.3 patrickpichler
2021-06-30 18:39 ` [PR PATCH] [Updated] " patrickpichler
2021-06-30 18:39 ` patrickpichler
2021-06-30 18:40 ` [PR PATCH] [Updated] " patrickpichler
2021-06-30 18:44 ` steinex
2021-06-30 18:45 ` [PR PATCH] [Updated] " patrickpichler
2021-06-30 18:50 ` patrickpichler
2021-06-30 18:56 ` [PR PATCH] [Updated] " patrickpichler
2021-07-16 19:45 ` ericonr
2021-07-16 19:48 ` ericonr
2021-07-16 19:56 ` [PR PATCH] [Merged]: " ericonr
2021-07-16 19:57 ` ericonr

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).