From d5810b984fe683f9aaee63e7242a77bb0f831274 Mon Sep 17 00:00:00 2001 From: Shulhan Date: Sat, 4 Apr 2026 14:11:24 +0700 Subject: Release pakakeh.go v0.62.0 (2026-04-04) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit == cmd/httpdfs 🌱 Add option to set base path and shutdown idle duration The -base-path option set the URL prefix for serving HTTP request. The -shutdown-idle option set the duration when server will stop accepting new connections and shutting down. == lib/dns 🪵 lib/dns: refactoring DoT and DoH to use address instead of port Using port makes the IP address of DNS-over-TLS (DoT) and DNS-over-HTTPS (DoH) listen on the same address with UDP. If we set ListenAddress to 0.0.0.0 and TLS termination is handled by proxy, this cause DoT and DoH will also listen on all addresses (the ports open to public). == lib/http 🌱 Add BasePath to the ServerOptions The BasePath allow server to serve HTTP from custom prefix, other than "/". Each request that server received will remove the BasePath first from the [http.Request.URL.Path] before passing to the handler. Each redirect that server sent will add the BasePath as the prefix to redirect URL. Any trailing slash in the BasePath will be removed. 🌱 Implement server auto shutdown when idle In the ServerOptions, we add option ShutdownIdleDuration when set to non-zero value it will start a timer. When the timer expired, the server will stop accepting new connection and then shutting down. This allow de-activating HTTP server when no connections received after specific duration to reduce the system resources. 🌼 lib/http: fix possible data race in SSE connection When server’s handler call Write or WriteRaw, there is possibility that the worker for keeping the connection alive also call Write at the same time, which cause the data race. == lib/paseto 🪵 Move paseto v2 under sub directory "v2" There are new versions of paseto standard: version 3 and version 4. To minimize conflicts in the future, we move the old implementation of paseto v2 to sub directory "v2" with package name "pasetov2". 🌱 lib/paseto/v4: new package that implements Paseto version 4 paseto/v4 provides a simple, ready to use, opinionated implementation of Platform-Agnostic SEcurity TOkens (PASETO) version 4 as defined in [paseto-v4]. [paseto-v4]: https://github.com/paseto-standard/paseto-spec/blob/master/docs/01-Protocol-Versions/Version4.md == 🌱 lib/uuidv7 New package that implements UUID version 7. The uuidv7 package provides type UUIDv7 as the container for UUID version 7 that satisfy the [database/sql], [encoding/gob], and [encoding/json]. The implementation follow RFC 9562. --- CHANGELOG.adoc | 18 +++++++++++++++--- go.mod | 10 +++++----- go.sum | 16 ++++++++-------- 3 files changed, 28 insertions(+), 16 deletions(-) diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc index a73d2450..76aed912 100644 --- a/CHANGELOG.adoc +++ b/CHANGELOG.adoc @@ -39,7 +39,7 @@ Legend, [#v0_62_0] -== pakakeh.go v0.62.0 (2026-xx-xx) +== pakakeh.go v0.62.0 (2026-04-04) //{{{ [#v0_62_0__cmd_httpdfs] @@ -53,6 +53,18 @@ The `-shutdown-idle` option set the duration when server will stop accepting new connections and shutting down. +[#v0_62_0__lib_dns] +=== lib/dns + +==== 🪵 lib/dns: refactoring DoT and DoH to use address instead of port + +Using port makes the IP address of DNS-over-TLS (DoT) and DNS-over-HTTPS +(DoH) listen on the same address with UDP. +If we set `ListenAddress` to `0.0.0.0` and TLS termination is handled +by proxy, this cause DoT and DoH will also listen on all +addresses (the ports open to public). + + [#v0_62_0__lib_http] === lib/http @@ -97,9 +109,9 @@ paseto v2 to sub directory "v2" with package name "pasetov2". paseto/v4 provides a simple, ready to use, opinionated implementation of Platform-Agnostic SEcurity TOkens (PASETO) version 4 -as defined in [paseto-v4]. +as defined in +https://github.com/paseto-standard/paseto-spec/blob/master/docs/01-Protocol-Versions/Version4.md[paseto-v4]. -[paseto-v4]: https://github.com/paseto-standard/paseto-spec/blob/master/docs/01-Protocol-Versions/Version4.md [#v0_62_0__lib_uuidv7] === 🌱 lib/uuidv7 diff --git a/go.mod b/go.mod index 2971b242..e1d613e7 100644 --- a/go.mod +++ b/go.mod @@ -6,17 +6,17 @@ module git.sr.ht/~shulhan/pakakeh.go go 1.26.0 require ( - golang.org/x/crypto v0.48.0 - golang.org/x/exp v0.0.0-20260218203240-3dfff04db8fa - golang.org/x/net v0.51.0 + golang.org/x/crypto v0.49.0 + golang.org/x/exp v0.0.0-20260312153236-7ab1446f8b90 + golang.org/x/net v0.52.0 golang.org/x/sys v0.42.0 golang.org/x/term v0.41.0 - golang.org/x/tools v0.42.0 + golang.org/x/tools v0.43.0 ) require ( github.com/google/go-cmp v0.7.0 // indirect - golang.org/x/mod v0.33.0 // indirect + golang.org/x/mod v0.34.0 // indirect golang.org/x/sync v0.20.0 // indirect ) diff --git a/go.sum b/go.sum index 4d66498d..b38fab4d 100644 --- a/go.sum +++ b/go.sum @@ -2,17 +2,17 @@ git.sr.ht/~shulhan/go-x-crypto v0.49.1-0.20260326231004-e6291d138282 h1:tiv3enye git.sr.ht/~shulhan/go-x-crypto v0.49.1-0.20260326231004-e6291d138282/go.mod h1:ErX4dUh2UM+CFYiXZRTcMpEcN8b/1gxEuv3nODoYtCA= github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= -golang.org/x/exp v0.0.0-20260218203240-3dfff04db8fa h1:Zt3DZoOFFYkKhDT3v7Lm9FDMEV06GpzjG2jrqW+QTE0= -golang.org/x/exp v0.0.0-20260218203240-3dfff04db8fa/go.mod h1:K79w1Vqn7PoiZn+TkNpx3BUWUQksGO3JcVX6qIjytmA= -golang.org/x/mod v0.33.0 h1:tHFzIWbBifEmbwtGz65eaWyGiGZatSrT9prnU8DbVL8= -golang.org/x/mod v0.33.0/go.mod h1:swjeQEj+6r7fODbD2cqrnje9PnziFuw4bmLbBZFrQ5w= -golang.org/x/net v0.51.0 h1:94R/GTO7mt3/4wIKpcR5gkGmRLOuE/2hNGeWq/GBIFo= -golang.org/x/net v0.51.0/go.mod h1:aamm+2QF5ogm02fjy5Bb7CQ0WMt1/WVM7FtyaTLlA9Y= +golang.org/x/exp v0.0.0-20260312153236-7ab1446f8b90 h1:jiDhWWeC7jfWqR9c/uplMOqJ0sbNlNWv0UkzE0vX1MA= +golang.org/x/exp v0.0.0-20260312153236-7ab1446f8b90/go.mod h1:xE1HEv6b+1SCZ5/uscMRjUBKtIxworgEcEi+/n9NQDQ= +golang.org/x/mod v0.34.0 h1:xIHgNUUnW6sYkcM5Jleh05DvLOtwc6RitGHbDk4akRI= +golang.org/x/mod v0.34.0/go.mod h1:ykgH52iCZe79kzLLMhyCUzhMci+nQj+0XkbXpNYtVjY= +golang.org/x/net v0.52.0 h1:He/TN1l0e4mmR3QqHMT2Xab3Aj3L9qjbhRm78/6jrW0= +golang.org/x/net v0.52.0/go.mod h1:R1MAz7uMZxVMualyPXb+VaqGSa3LIaUqk0eEt3w36Sw= golang.org/x/sync v0.20.0 h1:e0PTpb7pjO8GAtTs2dQ6jYa5BWYlMuX047Dco/pItO4= golang.org/x/sync v0.20.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0= golang.org/x/sys v0.42.0 h1:omrd2nAlyT5ESRdCLYdm3+fMfNFE/+Rf4bDIQImRJeo= golang.org/x/sys v0.42.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= golang.org/x/term v0.41.0 h1:QCgPso/Q3RTJx2Th4bDLqML4W6iJiaXFq2/ftQF13YU= golang.org/x/term v0.41.0/go.mod h1:3pfBgksrReYfZ5lvYM0kSO0LIkAl4Yl2bXOkKP7Ec2A= -golang.org/x/tools v0.42.0 h1:uNgphsn75Tdz5Ji2q36v/nsFSfR/9BRFvqhGBaJGd5k= -golang.org/x/tools v0.42.0/go.mod h1:Ma6lCIwGZvHK6XtgbswSoWroEkhugApmsXyrUmBhfr0= +golang.org/x/tools v0.43.0 h1:12BdW9CeB3Z+J/I/wj34VMl8X+fEXBxVR90JeMX5E7s= +golang.org/x/tools v0.43.0/go.mod h1:uHkMso649BX2cZK6+RpuIPXS3ho2hZo4FVwfoy1vIk0= -- cgit v1.3