summaryrefslogtreecommitdiff
path: root/net-irc/soju
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2023-04-10 05:36:05 +0100
committerV3n3RiX <venerix@koprulu.sector>2023-04-10 05:36:05 +0100
commit4bbcd26e7cb1908fb98bb318bfaa13ea9e32d860 (patch)
tree39e9258a61ef296b0e5afba0c7dc2557891487c4 /net-irc/soju
parent47d5e233005d470dbd431a280e64ce6073fc7149 (diff)
gentoo auto-resync : 10:04:2023 - 05:36:05
Diffstat (limited to 'net-irc/soju')
-rw-r--r--net-irc/soju/Manifest6
-rw-r--r--net-irc/soju/files/soju-0.6.0-fix-dup-upstream-connections.patch69
-rw-r--r--net-irc/soju/soju-0.5.2.ebuild7
-rw-r--r--net-irc/soju/soju-0.6.0.ebuild60
4 files changed, 137 insertions, 5 deletions
diff --git a/net-irc/soju/Manifest b/net-irc/soju/Manifest
index b52acf967f48..053956c698cf 100644
--- a/net-irc/soju/Manifest
+++ b/net-irc/soju/Manifest
@@ -1,5 +1,9 @@
+AUX soju-0.6.0-fix-dup-upstream-connections.patch 1719 BLAKE2B 5046c883c828deb7fc97b73091e4cb185f83c96e31731806820e7fce82738c5b95d1eec22effbda1d1f249dc8b443e44f5c73f87a1771027ebef22633db36a74 SHA512 4a97368524bdaa66d2250cbc75db5e82e23de54e02d1daf3886e9ec9c376d5962210913de2e7e9358dba702869afdbc99026b2480d523be6ac107564488dd725
AUX soju.initd 574 BLAKE2B 4f80e6b9e5bb004477be832e5b9123cd0b68c1432434aa142a0c083300e778f414207951949e58e08fb061fc49d8e03adc91979b4b74d1bf46012ad8fc1e6678 SHA512 abb615ea1b406bc1c9a4dc3712740be9b95945bdff2ddb6200551b540b426befe3d3a6b4d5b42a796c6282edc2b692adf2ede4d259822de6611685122693bcdc
DIST soju-0.5.2-deps.tar.xz 144017976 BLAKE2B 09be5c159d8c5a12bef9fe52e1d7d4883e3a3ebc8f1131fadd33808588413db9d318eb4be589f9e088d4d6257b47b8c5fa61373a872bae3b9f6570a390312972 SHA512 4f33185ee8fb7a1969ea5c2de82d9ecd7f5f7795f890ec35d87c557e973a53f93c22ecccc1b02ba47dc52d1d6528b7e18fe43fc88cb77ab4615bafe5c70ae8bd
DIST soju-0.5.2.tar.gz 141911 BLAKE2B 3fb9455a55d8fc0a1da17303156f43cc989f601d0dc837b795a32fa4be14a45571edbc2067159990fd72c75a44c71b52a579ed01572aae43c39ebaf143d502e1 SHA512 2ee9abf9d989a6cc361350bcaa94ff78bf45119c507142d6200684c79c4e1418d0f895931d0889a6f9f15f07d7b5969e2d34ae235034f3a53f04e2bf997dc85f
-EBUILD soju-0.5.2.ebuild 1206 BLAKE2B e623f0690cb31b86d81b2bde5fed95e621f84ef96d0c178e47895e3ffa75cb3f2cf8aa03f0717d41a7a6217015da79834d0a576c427bd195f2f3037e5a36037a SHA512 0b9f84b7cd150da99a43c5bc84b2fdb4a9d0143560c8cc62dd6120134a24744e058f73dd4087908737afb99f0a4bccfdd790c372616e36ca8ba4432df4bdcea2
+DIST soju-0.6.0-deps.tar.xz 146900140 BLAKE2B 0ecf3844694a6d2dbb8f90fbb44c87e6918c4502960356cbf7c7f12103ba2134257b9d0bfcce673352c256b9aa367368c280991069913f3764f916af731d4d21 SHA512 ccaf6cde616114a8afb9f7c2f41a816c458f685d7895cbb47a36135e5f1b12e39580ce81973ee9a5d61f3efb603e71f40820abd515dfb9bbbb539163f140cd25
+DIST soju-0.6.0.tar.gz 161364 BLAKE2B c8dcf2d8355f90e362f5f1cd5f5f2bb2ab84dce0dbbd07be3d3b492d944f5d8aa35d93038e2d1134f285e248c8bd8b4e83eab27a959bcefcc38198a3de24a4cd SHA512 99e80a82c3ceda6567524bb4b7aab74095b0c4b18d1f268b84e4173770f3ded26bba5092f3adf105c90c28bffd86001801c0bad9f57fd2a3302bb816b77ac423
+EBUILD soju-0.5.2.ebuild 1138 BLAKE2B 0df0955221e399dcd6be6e5a879b24248d4e19bc506264ab773a0157495821d3ef93fe7d034add51ad52fece451158d982487079dd1120d299b612065f9abb39 SHA512 e0b2e472a88c6c1ed73a97f1e05c2a4e953134ff51c902bf5f44b36c0ffb8be33d70e548eb2281448902c25667dcef1a4ce66eefddde0ec0f3a156dcafcd7d30
+EBUILD soju-0.6.0.ebuild 1300 BLAKE2B 5fa2a135b40ff43953cca17a3e93abe2c6e8498dda6f58ef518e944c75c48365a062520b889c4dff7f7713f271e0aebf64c340422ef153ac0fcafc100d2c76d0 SHA512 209606a16721b47096e0b771cee7cca9011ea9bc990f363c6f8cd3886012ddf659e0cab29cd9820cdcc7c340e26701647dba8e8a2fcca43a33373999b254ceae
MISC metadata.xml 514 BLAKE2B 4c6429dfb045fe512fe8972fa8818782e946e066a162e78dddac4c0941990837978f88fcba84f8e452c5813cbaa63406d2740da714fd1129ec7b3bef1114ca50 SHA512 a3ec0be51131755fda583df4bfb02aee058b83d347d41b526e728f2bae859c5100df8fdb20f694407c8da581aabb31e7497c596680125ff12e58983e6499950c
diff --git a/net-irc/soju/files/soju-0.6.0-fix-dup-upstream-connections.patch b/net-irc/soju/files/soju-0.6.0-fix-dup-upstream-connections.patch
new file mode 100644
index 000000000000..ca1f0fdf41c7
--- /dev/null
+++ b/net-irc/soju/files/soju-0.6.0-fix-dup-upstream-connections.patch
@@ -0,0 +1,69 @@
+https://todo.sr.ht/~emersion/soju/207
+
+diff -u b/user.go b/user.go
+--- b/user.go
++++ b/user.go
+@@ -218,6 +218,7 @@
+ net.user.srv.metrics.upstreams.Add(1)
+ defer net.user.srv.metrics.upstreams.Add(-1)
+
++ done := ctx.Done()
+ ctx, cancel := context.WithTimeout(ctx, time.Minute)
+ defer cancel()
+
+@@ -227,6 +228,12 @@
+ }
+ defer uc.Close()
+
++ // The context is cancelled by the caller when the network is stopped.
++ go func() {
++ <-done
++ uc.Close()
++ }()
++
+ if net.user.srv.Identd != nil {
+ net.user.srv.Identd.Store(uc.RemoteAddr().String(), uc.LocalAddr().String(), userIdent(&net.user.User))
+ defer net.user.srv.Identd.Delete(uc.RemoteAddr().String(), uc.LocalAddr().String())
+@@ -239,9 +246,6 @@
+ return fmt.Errorf("failed to register: %w", err)
+ }
+
+- // TODO: this is racy with net.stopped. If the network is stopped
+- // before the user goroutine receives eventUpstreamConnected, the
+- // connection won't be closed.
+ net.user.events <- eventUpstreamConnected{uc}
+ defer func() {
+ net.user.events <- eventUpstreamDisconnected{uc}
+@@ -259,6 +263,12 @@
+ return
+ }
+
++ ctx, cancel := context.WithCancel(context.TODO())
++ go func() {
++ <-net.stopped
++ cancel()
++ }()
++
+ var lastTry time.Time
+ backoff := newBackoffer(retryConnectMinDelay, retryConnectMaxDelay, retryConnectJitter)
+ for {
+@@ -273,7 +283,7 @@
+ }
+ lastTry = time.Now()
+
+- if err := net.runConn(context.TODO()); err != nil {
++ if err := net.runConn(ctx); err != nil {
+ text := err.Error()
+ temp := true
+ var regErr registrationError
+@@ -299,10 +309,6 @@
+ if !net.isStopped() {
+ close(net.stopped)
+ }
+-
+- if net.conn != nil {
+- net.conn.Close()
+- }
+ }
+
+ func (net *network) detach(ch *database.Channel) {
diff --git a/net-irc/soju/soju-0.5.2.ebuild b/net-irc/soju/soju-0.5.2.ebuild
index 0bd379808496..08e925cb0a65 100644
--- a/net-irc/soju/soju-0.5.2.ebuild
+++ b/net-irc/soju/soju-0.5.2.ebuild
@@ -47,8 +47,7 @@ src_install() {
}
pkg_postinst() {
- elog "${PN} requires a user database for authenticating bouncer users,"
- elog "please create a user using:"
- elog "# sojuctl -config ${EROOT}/etc/soju/config create-user <username> [-admin]"
- elog "then set ${EROOT}/var/lib/soju/main.db owner and group to soju:soju."
+ elog "${PN} requires a user database for authenticating clients."
+ elog "As the soju user, create a database using:"
+ elog "$ sojuctl -config ${EROOT}/etc/soju/config create-user <username> [-admin]"
}
diff --git a/net-irc/soju/soju-0.6.0.ebuild b/net-irc/soju/soju-0.6.0.ebuild
new file mode 100644
index 000000000000..a233f27ef458
--- /dev/null
+++ b/net-irc/soju/soju-0.6.0.ebuild
@@ -0,0 +1,60 @@
+# Copyright 2022-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit go-module systemd
+
+DESCRIPTION="soju is a user-friendly IRC bouncer"
+HOMEPAGE="https://soju.im/"
+SRC_URI="https://git.sr.ht/~emersion/${PN}/refs/download/v${PV}/${P}.tar.gz"
+SRC_URI+=" https://github.com/alfredfo/${PN}-deps/raw/master/${P}-deps.tar.xz"
+
+LICENSE="AGPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~arm64 ~riscv"
+IUSE="pam"
+
+BDEPEND="
+ app-text/scdoc
+"
+RDEPEND="
+ acct-user/soju
+ acct-group/soju
+"
+DEPEND="${RDEPEND}"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-0.6.0-fix-dup-upstream-connections.patch
+)
+
+src_compile() {
+ GOFLAGS+=" -tags=moderncsqlite"
+ use pam && GOFLAGS+=" -tags=pam"
+
+ ego build ${GOFLAGS} ./cmd/soju
+ ego build ${GOFLAGS} ./cmd/sojudb
+ ego build ${GOFLAGS} ./cmd/sojuctl
+
+ scdoc <doc/soju.1.scd >doc/soju.1 || die
+}
+
+src_install() {
+ dobin soju
+ dobin sojudb
+ dobin sojuctl
+
+ doman doc/soju.1
+ systemd_dounit contrib/soju.service
+ keepdir /etc/soju
+ insinto /etc/soju
+ newins config.in config
+ newinitd "${FILESDIR}"/soju.initd soju
+ einstalldocs
+}
+
+pkg_postinst() {
+ elog "${PN} requires a user database for authenticating clients."
+ elog "As the soju user, create a database using:"
+ elog "$ sojudb -config ${EROOT}/etc/soju/config create-user <username> [-admin]"
+}