Re: Request additions to qbittorrent-nox port README

2022-04-14 Thread Stuart Henderson
+cc ports@ & maintainer

On 2022/04/14 21:11, u...@mailo.com wrote:
> > 127.0.0.1 is probably the best thing to suggest
> > for listening to localhost.
> The thing is - I need it accessible from another machine over network.
> With `localhost` it DOES work over network,
> this is how I have used it for months.
> (With `127.0.0.1` it doesn't.)
> 
> > For listening to connections from any v4 address use 0.0.0.0
> Thank you for this tip, it does work and I leave it set to `0.0.0.0`.
> 
> > the ideal fix for qbittorrent-nox would be if it created
> > separate socket bindings, one for IPv4, one for IPv6.
> I can't help with that, hope someone will address it.
> 
> > Java is a different situation
> My point is that `qbittorrent-nox` suffers either,
> even though the details may grossly differ.
> And `jdk` README has it described
> whereas `qbittorrent-nox` README has not.

This issue does affect various software in packages, it is a common
thing you need to deal with if you're using various software on OpenBSD.
It doesn't really feel right to me to mention it in a pkg-readme for
one specific package when it affects a wide range of them. Perhaps an
FAQ section might be a better idea.

In qbittorrent-nox case, Qt5's network socket listener, when told to
listen for connections to "Any" address, binds only a v6 socket. To
have it do something different, software using this API would need
to listen for "AnyIPv6" and/or "AnyIPv4" instead.

> I feel such intricacies would be welcome in the README.
> Again, my main question to openbsd-misc is:
> whom and how to contact if the maintainer seems not to reply?

Generally the ports@ mailing list is the best place for ports-specific
questions. Also if a maintainer is not responding to your mail, it is
possible that they did not receive it - if that's the case there is a
higher chance they'll see a re-post on ports@ than misc@ (ports devs
are more likely to read ports@ than misc@)

In this case perhaps the diff below might be the least surprising
approach i.e. have it listen to v4 by default. Maybe the pkg-readme
isn't needed any more then too.

Index: Makefile
===
RCS file: /cvs/ports/net/qbittorrent/qbittorrent-nox/Makefile,v
retrieving revision 1.9
diff -u -p -r1.9 Makefile
--- Makefile11 Mar 2022 19:47:15 -  1.9
+++ Makefile14 Apr 2022 20:42:55 -
@@ -1,5 +1,6 @@
 COMMENT =  BitTorrent client with web interface
 PKGNAME =  qbittorrent-nox-${VER}
+REVISION = 0
 
 WANTLIB += ${COMPILER_LIBCXX} Qt5Core Qt5Network Qt5Xml boost_system
 WANTLIB += boost_system-mt c crypto execinfo m ssl torrent-rasterbar z
Index: patches/patch-src_base_bittorrent_tracker_cpp
===
RCS file: patches/patch-src_base_bittorrent_tracker_cpp
diff -N patches/patch-src_base_bittorrent_tracker_cpp
--- /dev/null   1 Jan 1970 00:00:00 -
+++ patches/patch-src_base_bittorrent_tracker_cpp   14 Apr 2022 20:42:55 
-
@@ -0,0 +1,15 @@
+qt's "Any" listener binds the socket to AF_INET6 which doesn't accept v4
+connections on OpenBSD. Change this to "AnyIPv4".
+
+Index: src/base/bittorrent/tracker.cpp
+--- src/base/bittorrent/tracker.cpp.orig
 src/base/bittorrent/tracker.cpp
+@@ -199,7 +199,7 @@ Tracker::Tracker(QObject *parent)
+ 
+ bool Tracker::start()
+ {
+-const QHostAddress ip = QHostAddress::Any;
++const QHostAddress ip = QHostAddress::AnyIPv4;
+ const int port = Preferences::instance()->getTrackerPort();
+ 
+ if (m_server->isListening())
Index: patches/patch-src_webui_webui_cpp
===
RCS file: patches/patch-src_webui_webui_cpp
diff -N patches/patch-src_webui_webui_cpp
--- /dev/null   1 Jan 1970 00:00:00 -
+++ patches/patch-src_webui_webui_cpp   14 Apr 2022 20:42:55 -
@@ -0,0 +1,16 @@
+qt's "Any" listener binds the socket to AF_INET6 which doesn't accept v4
+connections on OpenBSD. Change this to "AnyIPv4". If you specifically
+want v6 then set config to listen to :: instead
+
+Index: src/webui/webui.cpp
+--- src/webui/webui.cpp.orig
 src/webui/webui.cpp
+@@ -112,7 +112,7 @@ void WebUI::configure()
+ if (!m_httpServer->isListening())
+ {
+ const auto address = (serverAddressString == "*" || 
serverAddressString.isEmpty())
+-? QHostAddress::Any : QHostAddress(serverAddressString);
++? QHostAddress::AnyIPv4 : QHostAddress(serverAddressString);
+ bool success = m_httpServer->listen(address, m_port);
+ if (success)
+ {



Re: Request additions to qbittorrent-nox port README

2022-04-13 Thread Stuart Henderson
On 2022-04-13,   wrote:
> I have had 2 issues with `qbittorrent-nox`, both are OpenBSD-specific
> and IMHO it would be appropriate if README described them.
> http://cvsweb.openbsd.org/cgi-bin/cvsweb/ports/net/qbittorrent/qbittorrent-nox/pkg/README?rev=1.3&content-type=text/x-cvsweb-markup
>
> I emailed Elias M. Mariani (package maintainer) and
> Rafael Sadowski (who edited the README),
> 2 times each one, with no reply and the readme has not changed.
> I emailed Christian Weisgerber (who edited the README),
> who replied he is not in charge and agreed I'd better ask at misc list.
>
> So, how can my plea on `qbittorrent-nox` README
> be delivered to the right person?
>
>
> The issues were:
>
> 1. `qbittorrent-nox` connection refused
>Discussed here:
>https://www.unitedbsd.com/d/634-qbittorrent-nox-connection-refused
>
>apparent cause: `IPV6_V6ONLY`
>http://man.openbsd.org/amd64/ip6#IPV6_V6ONLY
>
>READMEs for `jdk` do mention the issue:
>
> http://cvsweb.openbsd.org/cgi-bin/cvsweb/ports/devel/jdk/1.8/pkg/README?rev=1.3&content-type=text/x-cvsweb-markup
>
> http://cvsweb.openbsd.org/cgi-bin/cvsweb/ports/devel/jdk/11/pkg/README?rev=1.3&content-type=text/x-cvsweb-markup
>
> http://cvsweb.openbsd.org/cgi-bin/cvsweb/ports/devel/jdk/17/pkg/README?rev=1.2&content-type=text/x-cvsweb-markup
>
>```
>ipv4 and v6 networking
>==
>  ipv4 to ipv6 address mapping is disabled on OpenBSD. This means the
>  jdk can only use ipv4 addresses or ipv6 addresses but not both at
>  the same time. By default ipv4 addresses are enabled. To use ipv6
>  addresses set the following properties when you start java:
>
>  -Djava.net.preferIPv4Stack=false
>  -Djava.net.preferIPv6Stack=true
>  -Djava.net.preferIPv6Addresses=true
>```
>
>I personally have set `WebUI\Address=localhost`
>in `~/.config/qBittorrent/qBittorrent.conf`
>which works for my setup,
>yet I don't know what good defaults the README should suggest.

127.0.0.1 is probably the best thing to suggest for listening to localhost.
For listening to connections from any v4 address use 0.0.0.0. Though, the
ideal fix for qbittorrent-nox would be if it created separate socket
bindings, one for IPv4, one for IPv6.

Java is a different situation as the *entire process* is restricted to
either IPv4 or IPv6 connections depending on the setting of these variables.
It *may* be possible to work around this by setting it as v6-only, pointing
at a DNS resolver doing DNS64, and nat-pt NAT translations ("af-to" in PF).
But it is a mess.


-- 
Please keep replies on the mailing list.



Request additions to qbittorrent-nox port README

2022-04-13 Thread uxer
I have had 2 issues with `qbittorrent-nox`, both are OpenBSD-specific
and IMHO it would be appropriate if README described them.
http://cvsweb.openbsd.org/cgi-bin/cvsweb/ports/net/qbittorrent/qbittorrent-nox/pkg/README?rev=1.3&content-type=text/x-cvsweb-markup

I emailed Elias M. Mariani (package maintainer) and
Rafael Sadowski (who edited the README),
2 times each one, with no reply and the readme has not changed.
I emailed Christian Weisgerber (who edited the README),
who replied he is not in charge and agreed I'd better ask at misc list.

So, how can my plea on `qbittorrent-nox` README
be delivered to the right person?


The issues were:

1. `qbittorrent-nox` connection refused
   Discussed here:
   https://www.unitedbsd.com/d/634-qbittorrent-nox-connection-refused
   
   apparent cause: `IPV6_V6ONLY`
   http://man.openbsd.org/amd64/ip6#IPV6_V6ONLY
   
   READMEs for `jdk` do mention the issue:
   
http://cvsweb.openbsd.org/cgi-bin/cvsweb/ports/devel/jdk/1.8/pkg/README?rev=1.3&content-type=text/x-cvsweb-markup
   
http://cvsweb.openbsd.org/cgi-bin/cvsweb/ports/devel/jdk/11/pkg/README?rev=1.3&content-type=text/x-cvsweb-markup
   
http://cvsweb.openbsd.org/cgi-bin/cvsweb/ports/devel/jdk/17/pkg/README?rev=1.2&content-type=text/x-cvsweb-markup
   
   ```
   ipv4 and v6 networking
   ==
 ipv4 to ipv6 address mapping is disabled on OpenBSD. This means the
 jdk can only use ipv4 addresses or ipv6 addresses but not both at
 the same time. By default ipv4 addresses are enabled. To use ipv6
 addresses set the following properties when you start java:
   
 -Djava.net.preferIPv4Stack=false
 -Djava.net.preferIPv6Stack=true
 -Djava.net.preferIPv6Addresses=true
   ```
   
   I personally have set `WebUI\Address=localhost`
   in `~/.config/qBittorrent/qBittorrent.conf`
   which works for my setup,
   yet I don't know what good defaults the README should suggest.

2. Couldn't access WebUI of `qbittorrent-nox` under load,
   and terminal output contained:
   QNetworkInterface: could not create IPv6 socket (Too many open files)
   
   `sysctl kern.nfiles` was lower than `openfiles` in `login.conf`
   Dunno, yet raising resource limits according to
   https://www.c0ffee.net/blog/openbsd-on-a-laptop/
   seems to have resolved the issue.
   https://man.openbsd.org/login.conf.5
   https://man.openbsd.org/sysctl.conf.5
   
   As with the 1st issue, I am far from understanding
   open files, kern.seminfo, kern.shminfo, stacksize-cur etc.
   thus can't provide suggestions for README.

So, as a user I feel the README lacks notes on these 2 issues:
IPV6_V6ONLY and resource limits,
but I can't help with new README text.