Article View: news.software.nntp
Article #88836Re: What methods can throttle INN connections?
From: Russ Allbery
Date: Sat, 23 Oct 2021 19:37
Date: Sat, 23 Oct 2021 19:37
57 lines
3724 bytes
3724 bytes
711 Spooky Mart <711@spooky.mart> writes:
> Hello NNTP gurus. I want to host a binary local newsgroup. I want to
> discourage spammers from trying to push up irrelevant big binaries,
> vids, pr0n, etc. The purpose of the binary group is for uploading PDF
> and ZIP/XZ/7Z files < 4MB.
> I am seeking ideas on different ways to throttle INN connections.
> [1] Firstly I want to throttle all client connections to max 64kB/s.
> [2] Secondly I want to maintain a timing throttle to all client
> connections so that the server does not respond for several seconds
> since the last connection from same client / IP, so that there is always
> a short delay between the completion of one client command or connect to
> the next. I really don't want to differentiate between a client command
> and a client connection session--there should be a delay between every
> command operation during a connect session and a delay between end of a
> session and the next connection from the same client.
> [3] Thirdly, if multiple client connections are detected from the same
> IP, I want to throttle bandwidth down to 32kB/s per client and cycle
> their access by alternating the delays. This is mainly aimed at
> preventing scripted hog connections from Tor exit nodes, although I
> don't wish to completely block Tor because anonymity will be one of the
> group topics.
I would use iptables (or nftables, which is the new thing) for [1] and [3]
these. It's designed to do exactly this kind of work.
I'm not sure off-hand how to do [2] without modifying the source code. I
don't think we have a delay mechanism like that built in. There's support
for doing exponential backoff for posts (see under Posting in the inn.conf
manual page), but that's not quite the same thing.
> [4] Fourthly, I want to offer the newsgroup to the big world network if
> anyone wants to sync it, with all the binary mimetypes stripped, so the
> outgoing feed would only contain body text without the binary content.
> If clients want to download the binaries they would need to use my local
> INN server.
I'm afraid INN doesn't support this or anything like it. It goes to a lot
of effort to have one and only one article corresponding to a given
message ID and serve exactly the same article through whatever path. It
also has no understanding at all of MIME structure, so doesn't have even
the infrastructure to remove specific parts of a message.
There are hooks to invoke arbitrary Perl or Python code when an article is
posted, so you could parse the article there and post a copy (with a
different message ID) to a different group that you then feed to other
servers, but that's as close as I think INN would let you get.
--
Russ Allbery (eagle@eyrie.org) <https://www.eyrie.org/~eagle/>
Please post questions rather than mailing me directly.
<https://www.eyrie.org/~eagle/faqs/questions.html> explains why.
Technical Details
Message-ID:
<87v91nttv6.fsf@hope.eyrie.org>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!apf1.newsdeef.eu!not-for-mailReferences:
<sl1nqc$1j4c$1@gioia.aioe.org>Show Full Headers
Complete Article Headers
Message-ID: <87v91nttv6.fsf@hope.eyrie.org> Subject: Re: What methods can throttle INN connections? Date: Sat, 23 Oct 2021 12:37:49 -0700 From: Russ Allbery <eagle@eyrie.org> References: <sl1nqc$1j4c$1@gioia.aioe.org> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!apf1.newsdeef.eu!not-for-mail Newsgroups: news.software.nntp Organization: The Eyrie Mime-Version: 1.0 Content-Type: text/plain Injection-Info: hope.eyrie.org; logging-data="7656"; mail-complaints-to="news@eyrie.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) Cancel-Lock: sha1:SZNAvP9gxci7z5SiEdNlOLTt8FI= Lines: 56