From: patrickpichler <patrickpichler@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: Re: [PR PATCH] [Updated] caddy: upgrade to 2.3.0
Date: Sun, 28 Feb 2021 20:51:11 +0100 [thread overview]
Message-ID: <20210228195111.p20-3yxgzCgdEcAjl92bvX7ImxY2wHfPlqlwD_Tv41w@z> (raw)
In-Reply-To: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-29128@inbox.vuxu.org>
[-- 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() {
next prev parent reply other threads:[~2021-02-28 19:51 UTC|newest]
Thread overview: 45+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-28 19:50 [PR PATCH] " patrickpichler
2021-02-28 19:51 ` patrickpichler [this message]
2021-03-01 5:00 ` [PR PATCH] [Updated] " 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210228195111.p20-3yxgzCgdEcAjl92bvX7ImxY2wHfPlqlwD_Tv41w@z \
--to=patrickpichler@users.noreply.github.com \
--cc=ml@inbox.vuxu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).