Date: Thu, 11 Apr 2024 06:17:07 GMT From: Fernando =?utf-8?Q?Apestegu=C3=ADa?= <fernape@FreeBSD.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org Subject: git: fd3628b9b43b - main - net/xapsd: update to g20240326 Message-ID: <202404110617.43B6H7bY016506@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch main has been updated by fernape: URL: https://cgit.FreeBSD.org/ports/commit/?id=fd3628b9b43b151c4505fd54a6aea1e9d0a428ff commit fd3628b9b43b151c4505fd54a6aea1e9d0a428ff Author: Henry <PopularMoment@protonmail.com> AuthorDate: 2024-04-08 17:04:03 +0000 Commit: Fernando ApesteguĂa <fernape@FreeBSD.org> CommitDate: 2024-04-11 06:16:33 +0000 net/xapsd: update to g20240326 ChangeLog: https://github.com/freswa/dovecot-xaps-daemon/compare/836a75b..1e589be PR: 278199 Reported by: PopularMoment@protonmail.com (maintainer) --- net/xapsd/Makefile | 13 ++- net/xapsd/distinfo | 6 +- ...1-fix-apple-ignore-malformed-HTTP-headers.patch | 99 ++++++++++++++++++++++ 3 files changed, 107 insertions(+), 11 deletions(-) diff --git a/net/xapsd/Makefile b/net/xapsd/Makefile index 9ccc74440115..fb9abe292ffd 100644 --- a/net/xapsd/Makefile +++ b/net/xapsd/Makefile @@ -1,6 +1,5 @@ PORTNAME= xapsd -DISTVERSION= g20231019 -PORTREVISION= 1 +DISTVERSION= g20240326 CATEGORIES= net MAINTAINER= PopularMoment@protonmail.com @@ -10,16 +9,12 @@ WWW= https://github.com/freswa/dovecot-xaps-daemon LICENSE= MIT LICENSE_FILE= ${WRKSRC}/LICENSE -DEPRECATED= Requires deprecated lang/go19 -EXPIRATION_DATE= 2024-04-24 - -# must use 1.19 due to https://github.com/freswa/dovecot-xaps-daemon/issues/24 -USES= go:1.19,modules +USES= go:modules USE_RC_SUBR= xapsd USE_GITHUB= yes GH_ACCOUNT= freswa GH_PROJECT= dovecot-xaps-daemon -GH_TAGNAME= 836a75b +GH_TAGNAME= 1e589be GH_TUPLE= freswa:go-plist:900e8a7d907d:freswa_go_plist/vendor/github.com/freswa/go-plist \ fsnotify:fsnotify:v1.6.0:fsnotify_fsnotify/vendor/github.com/fsnotify/fsnotify \ @@ -54,6 +49,8 @@ GO_TARGET= ./cmd/xapsd:${PREFIX}/sbin/xapsd USERS= ${PORTNAME} GROUPS= ${PORTNAME} +PORTSCOUT= ignore:1 + post-install: ${MKDIR} ${STAGEDIR}${PREFIX}/etc/xapsd ${INSTALL_DATA} ${WRKSRC}/configs/xapsd/xapsd.yaml ${STAGEDIR}${PREFIX}/etc/xapsd/xapsd.yaml.sample diff --git a/net/xapsd/distinfo b/net/xapsd/distinfo index 220616037c02..741a85ef7df7 100644 --- a/net/xapsd/distinfo +++ b/net/xapsd/distinfo @@ -1,6 +1,6 @@ -TIMESTAMP = 1698718840 -SHA256 (freswa-dovecot-xaps-daemon-g20231019-836a75b_GH0.tar.gz) = 806a6b32a7b872a140c68421719c93c65bc3205e6e86800dd36c2e5ade2954d0 -SIZE (freswa-dovecot-xaps-daemon-g20231019-836a75b_GH0.tar.gz) = 109537 +TIMESTAMP = 1712416748 +SHA256 (freswa-dovecot-xaps-daemon-g20240326-1e589be_GH0.tar.gz) = 1e6c019df01f9c54e4499537678fbebf83270a39570c24677b41b93ed2022e17 +SIZE (freswa-dovecot-xaps-daemon-g20240326-1e589be_GH0.tar.gz) = 110569 SHA256 (freswa-go-plist-900e8a7d907d_GH0.tar.gz) = 2b4a06b8805bc1436ab8f34d6fd140645a0a01ccaf9f4b3a7dc3e0e35f5a2e88 SIZE (freswa-go-plist-900e8a7d907d_GH0.tar.gz) = 47675 SHA256 (fsnotify-fsnotify-v1.6.0_GH0.tar.gz) = 583b2b399709d04807c5c3185e7d4dc0543d532af91fdeb85eeaf803a0b7703b diff --git a/net/xapsd/files/0001-fix-apple-ignore-malformed-HTTP-headers.patch b/net/xapsd/files/0001-fix-apple-ignore-malformed-HTTP-headers.patch new file mode 100644 index 000000000000..60ffc0dfb039 --- /dev/null +++ b/net/xapsd/files/0001-fix-apple-ignore-malformed-HTTP-headers.patch @@ -0,0 +1,99 @@ +From 1c52af3a7cc168cec089a810c32e861ab988840c Mon Sep 17 00:00:00 2001 +From: Leon Klingele <git@leonklingele.de> +Date: Wed, 13 Mar 2024 22:12:25 +0100 +Subject: [PATCH] fix(apple): ignore malformed HTTP headers + +See also https://github.com/golang/go/issues/21290. + +Fixes https://github.com/freswa/dovecot-xaps-daemon/issues/24. +--- + pkg/apple_xserver_certs/http.go | 51 ++++++++++++++++++++++++++++++--- + 1 file changed, 47 insertions(+), 4 deletions(-) + +diff --git a/pkg/apple_xserver_certs/http.go b/pkg/apple_xserver_certs/http.go +index d39a6fc..939fcf0 100644 +--- a/pkg/apple_xserver_certs/http.go ++++ b/pkg/apple_xserver_certs/http.go +@@ -1,11 +1,16 @@ + package apple_xserver_certs + + import ( ++ "bufio" + "bytes" ++ "context" ++ "crypto/tls" + "encoding/pem" ++ "io" + "io/ioutil" + "log" + "net/http" ++ "time" + ) + + func NewCerts(username string, passwordhash string) *Certificates { +@@ -50,7 +55,6 @@ func handleResponse(certs *Certificates, response []byte) *Certificates { + } + + func sendRequest(reqBody []byte, newCerts bool) (respBody []byte) { +- client := &http.Client{} + r := bytes.NewReader(reqBody) + url := "https://identity.apple.com/pushcert/caservice/renew" + if newCerts { +@@ -67,12 +71,51 @@ func sendRequest(reqBody []byte, newCerts bool) (respBody []byte) { + req.Header.Set("Accept", "*/*") + req.Header.Set("Accept-Language", "en-us") + +- resp, err := client.Do(req) ++ req.Close = true ++ ++ ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) ++ defer cancel() ++ ++ conn, err := new(tls.Dialer).DialContext( ++ ctx, ++ "tcp", ++ req.URL.Host+":443", ++ ) + if err != nil { +- log.Fatalln(err) ++ log.Fatalln(err) // TODO: Handle error properly ++ } ++ defer func() { ++ _ = conn.Close() //nolint:errcheck,gosec // Ignored on purpose ++ }() ++ ++ if err := req.Write(conn); err != nil { ++ log.Fatalln(err) // TODO: Handle error properly ++ } ++ ++ buf, err := io.ReadAll(io.LimitReader(conn, 1<<10)) ++ if err != nil { ++ log.Fatalln(err) // TODO: Handle error properly ++ } ++ ++ const ( ++ cr = "\r" ++ nl = "\n" ++ ) ++ for _, ign := range []string{ ++ "1;: mode=block", ++ "max-age=31536000;: includeSubdomains", ++ } { ++ buf = bytes.Replace(buf, []byte(nl+ign+cr+nl), []byte(nl), 1) ++ } ++ ++ resp, err := http.ReadResponse(bufio.NewReader(bytes.NewReader(buf)), req) ++ if err != nil { ++ log.Fatalln(err) // TODO: Handle error properly + } ++ defer func() { ++ _ = resp.Body.Close() //nolint:errcheck,gosec // Ignored on purpose ++ }() + +- defer resp.Body.Close() + respBody, err = ioutil.ReadAll(resp.Body) + if err != nil { + log.Fatalln(err) +-- +2.34.1 +
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202404110617.43B6H7bY016506>