Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

You need tender loving care once a week - so that I can slap you into shape. -- Ellyn Mustard


computers / news.software.nntp / Re: What methods can throttle INN connections?

SubjectAuthor
* What methods can throttle INN connections?711 Spooky Mart
+- Re: What methods can throttle INN connections?Russ Allbery
+* Re: What methods can throttle INN connections?bje
|`* Re: What methods can throttle INN connections?711 Spooky Mart
| `- Re: What methods can throttle INN connections?Julien ÉLIE
+* Re: What methods can throttle INN connections?Aioe
|+* Re: What methods can throttle INN connections?711 Spooky Mart
||`- Re: What methods can throttle INN connections?Matija Nalis
|`- Re: What methods can throttle INN connections?Russ Allbery
+- Re: What methods can throttle INN connections?Etian
`- Re: What methods can throttle INN connections?Julien ÉLIE

1
What methods can throttle INN connections?

<sl1nqc$1j4c$1@gioia.aioe.org>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=282&group=news.software.nntp#282

  copy link   Newsgroups: news.software.nntp
Path: i2pn2.org!i2pn.org!aioe.org!vVCcVbr8AMXh9slTBfoogQ.user.46.165.242.75.POSTED!not-for-mail
From: 711...@spooky.mart (711 Spooky Mart)
Newsgroups: news.software.nntp
Subject: What methods can throttle INN connections?
Date: Sat, 23 Oct 2021 14:30:42 -0500
Organization: Aioe.org NNTP Server
Message-ID: <sl1nqc$1j4c$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Info: gioia.aioe.org; logging-data="52364"; posting-host="vVCcVbr8AMXh9slTBfoogQ.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Secret Agent Man
X-Notice: Filtered by postfilter v. 0.9.2
Content-Language: en-US
X-Mozilla-News-Host: snews://news.neodome.net:563
 by: 711 Spooky Mart - Sat, 23 Oct 2021 19:30 UTC

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.

[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 think this would make it reasonably frustrating for spammers and
binary hogs, and not be too onerous for legitimate participants.

Please propose your thoughts on how to proceed with these strange
requirements.

--
──┏━━━━┓──┏━━┓───┏━━┓── ┌────────────────────────┐ ┌────────┐
──┗━━┓─┃──┗┓─┃───┗┓─┃── │ Spooky Mart [chan] 711 │ │ always │
─────┃─┃──┏┛─┗┓──┏┛─┗┓─ │ https://bitmessage.org │ │ open │
─────┗━┛──┗━━━┛──┗━━━┛─ └────────────────────────┘ └────────┘

Re: What methods can throttle INN connections?

<87v91nttv6.fsf@hope.eyrie.org>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=283&group=news.software.nntp#283

  copy link   Newsgroups: news.software.nntp
Path: i2pn2.org!i2pn.org!paganini.bofh.team!news.killfile.org!news.eyrie.org!.POSTED!not-for-mail
From: eag...@eyrie.org (Russ Allbery)
Newsgroups: news.software.nntp
Subject: Re: What methods can throttle INN connections?
Date: Sat, 23 Oct 2021 12:37:49 -0700
Organization: The Eyrie
Message-ID: <87v91nttv6.fsf@hope.eyrie.org>
References: <sl1nqc$1j4c$1@gioia.aioe.org>
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=
 by: Russ Allbery - Sat, 23 Oct 2021 19:37 UTC

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.

Re: What methods can throttle INN connections?

<sl3r7q$blk$1@remote6hme0.ripco.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=284&group=news.software.nntp#284

  copy link   Newsgroups: news.software.nntp
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!tncsrv06.tnetconsulting.net!news.ripco.com!.POSTED.shell3.ripco.com!not-for-mail
From: bje...@ripco.com
Newsgroups: news.software.nntp
Subject: Re: What methods can throttle INN connections?
Date: Sun, 24 Oct 2021 14:39:54 -0000 (UTC)
Organization: Ripco Communications Inc.
Message-ID: <sl3r7q$blk$1@remote6hme0.ripco.com>
References: <sl1nqc$1j4c$1@gioia.aioe.org>
Injection-Date: Sun, 24 Oct 2021 14:39:54 -0000 (UTC)
Injection-Info: remote6hme0.ripco.com; posting-host="shell3.ripco.com:66.146.219.74";
logging-data="11956"; mail-complaints-to="usenet@remote6hme0.ripco.com"
User-Agent: tin/2.4.2-20171224 ("Lochhead") (UNIX) (SunOS/5.10 (i86pc))
 by: bje...@ripco.com - Sun, 24 Oct 2021 14:39 UTC

711 Spooky Mart <711@spooky.mart> wrote:
> 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.

Give up now, you don't know what you are doing and obivously don't know INN
and how the nntp protocol works.

You don't UPLOAD to an INN server, people use an NNTP client to publish
articles. These articles come from a newsreader.

I kind of find it hard to beleive whatever you are trying to accomplish has
an audience. Who are these pdf's coming from? Is this something common now?

Are they going to just know about this service or are you providing a link
to the server? Do they know they have to have a newsreader?

Binary articles are not normally part of the scene. You can't just UPLOAD a
binary file to a server without converting it to plain text. Do a search for
uuencode/uudecode or txt2bin/bin2txt. Some newsreaders can do this on the
fly, small ones anyway. Larger ones need to be broken into several parts.

Are your users aware of this?

I think you are better off looking at setting up an ftp server with the
anonymous stuff turned on. Bandwidth control would probably be easier using
a Pi with some kind of firewall software on it.

> [1] Firstly I want to throttle all client connections to max 64kB/s.

Why? Using your moms internet from your room?

> Please propose your thoughts on how to proceed with these strange
> requirements.

Like I said, give up now and do more research.

-bruce
bje@ripco.com

Re: What methods can throttle INN connections?

<bada55$Pig$Milk$Machines@711.spooky.mart>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=285&group=news.software.nntp#285

  copy link   Newsgroups: news.software.nntp
Path: i2pn2.org!i2pn.org!aioe.org!1j+asb6X25ddi2FOZ+fpWA.user.46.165.242.91.POSTED!not-for-mail
From: 711...@spooky.mart (711 Spooky Mart)
Newsgroups: news.software.nntp
Subject: Re: What methods can throttle INN connections?
Date: Sun, 24 Oct 2021 18:43:24 -0000 (UTC)
Organization: Aioe.org NNTP Server
Message-ID: <bada55$Pig$Milk$Machines@711.spooky.mart>
References: <sl1nqc$1j4c$1@gioia.aioe.org>
<sl3r7q$blk$1@remote6hme0.ripco.com>
Mime-Version: 1.0
Content-Type: text/plain;
boundary="------------81B965787CBC763148A7DF02"
Injection-Info: gioia.aioe.org; logging-data="49229"; posting-host="1j+asb6X25ddi2FOZ+fpWA.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Terminal Milkman (711 Spooky Mart)
Content-Language: Pig-Latin
X-Notice: Filtered by postfilter v. 0.9.2
ASCII-ART: Milk ye a young sow. I will show thee how.
__ _ __ _____ _ _
| _| ___| |__ __ _ _ __ |_ | |___ | / | / |
| | / __| '_ \ / _` | '_ \ | | / / | | | |
| | | (__| | | | (_| | | | | | | / / | | | |
| | \___|_| |_|\__,_|_| |_| | | /_/ |_| |_|
|__| |__|
_
 by: 711 Spooky Mart - Sun, 24 Oct 2021 18:43 UTC

This is a multi-part message in MIME format.
--------------81B965787CBC763148A7DF02
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit

On 10/24/21 9:39 AM, bje@ripco.com wrote:
> 711 Spooky Mart <711@spooky.mart> wrote:
>> 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.
>
> Give up now, you don't know what you are doing and obivously don't know INN
> and how the nntp protocol works.

Oh, really? I found a friend like Job had. I will not denounce my own
integrity in this matter.

> You don't UPLOAD to an INN server, people use an NNTP client to publish
> articles. These articles come from a newsreader.

Yes, Captain Obvious! How do you think I posted the opening to this thread?

The NNTP client formats the attachment binaries in MIME format with a
mime boundary marker, usually as base64, which comes after the ASCII or
UTF-8 headers and text body of the NNTP formatted article. Then the
client uploads the formatted message with the POST command and a final
line with a period and linefeed. The reader downloads the message, grabs
the MIME data, and converts attachments back into binary files. I do
this from the command line without a news reader using openssl s_client
requests. Here's an example.

$ openssl s_client -ign_eof -connect news.aioe.org:563

I can read articles this way, and cat text files up with header data to
post new articles, which is how this response to you is posted. You can
examine the headers to see how I formatted it and added an attachment.

This is what I meant by 'uploading' a PDF file. People 'upload' split
binaries to paid Usenet providers, and 'download' them with NZB Get or
similar clients. I've known about this for over two decades. I just
never bothered to run my own news server, since I never saw the need of
it until now, for this documentation project. I already know how to set
up INN. I just don't know how to configure it for throttling and
stripping of MIME data for a outgoing feed.

I can attach PostScript since it allows pure text output, but fonts and
MathJax cannot be embedded to ensure proper document rendering on other
machines.

I am very comfortable with manually querying NNTP servers with openssl
s_client. The knowledge I am lacking here is INN configuration knowledge
to do the things outlined in the enumerated points.

> I kind of find it hard to beleive whatever you are trying to accomplish has
> an audience. Who are these pdf's coming from? Is this something common now?

YGBSM. Every graphical newsreader I know of has a 'Attachment' button
with a paperclip in the composer.

> Are they going to just know about this service or are you providing a link
> to the server? Do they know they have to have a newsreader?

Of course they are going to know about the service. It's a workgroup
setup for a documentation project. PDF is necessary because of LATEX
maths, and math fonts must be embedded for proper document formatting. I
want the text parts of the feed available to the big world since others
might benefit from it or contribute useful information in the comment
threads, even if they are not drafting the documents.

> Binary articles are not normally part of the scene. You can't just UPLOAD a
> binary file to a server without converting it to plain text. Do a search for
> uuencode/uudecode or txt2bin/bin2txt. Some newsreaders can do this on the
> fly, small ones anyway. Larger ones need to be broken into several parts.

I already know this. Most NNTP servers appear to reject base64 / binary,
and don't even carry binary groups. I have tested a few servers before
posting this query thread, and they all rejected the test messages
because they are configured to reject binaries. The servers scan the base64
encoding for binary content, or something to that effect.

> Are your users aware of this?
>
> I think you are better off looking at setting up an ftp server with the
> anonymous stuff turned on. Bandwidth control would probably be easier using
> a Pi with some kind of firewall software on it.

No, I am better off with a threaded newsgroup since building the
documentation will be a collaborative effort and switching over to FTP
for every draft exchange is too much friction. Usenet threading is the
simplest and most productive way to proceed. I already know my own work
domain very well, and I am just trying to set up a tool chain to
eliminate friction, and make the work and the process publicly
available. Isn't this the original intent behind distributed big world
networks?

>> [1] Firstly I want to throttle all client connections to max 64kB/s.
>
> Why? Using your moms internet from your room?

I moved out of my mother's house on my 18th birthday over 3 decades ago.
I moved 2000 miles away from my mother. Today I live about 1200 miles
from mom. Her house didn't have a basement, either, so don't bother
going there.

Just because I didn't come in here with a typical nerd attitude of
superior rationale wearing my genius attitude on my shirt sleeve, it
does not follow that I am some dumb kid in his mom's basement. My
questions are cogent, well-worded questions and show the spirit of
ingenuity and of trying to solve a problem to achieve a good workflow
for a project for which I am devoting unpaid time, to benefit other
people's research, when I could be out right now making extra money.

If my objectives can't be achieved via the INN software, that is one
thing. But it is not a cause to insult and belittle me.

>> Please propose your thoughts on how to proceed with these strange
>> requirements.
>
> Like I said, give up now and do more research.

No, I am not giving up. My questions here _are_ research. Research
consists of finding answers to questions until the answers satisfy
requirements or solve a problem, or generate new, interesting problems
to research.

--
──┏━━━━┓──┏━━┓───┏━━┓── ┌────────────────────────┐ ┌────────┐
──┗━━┓─┃──┗┓─┃───┗┓─┃── │ Spooky Mart [chan] 711 │ │ always │
─────┃─┃──┏┛─┗┓──┏┛─┗┓─ │ https://bitmessage.org │ │ open │
─────┗━┛──┗━━━┛──┗━━━┛─ └────────────────────────┘ └────────┘

--------------81B965787CBC763148A7DF02
Content-Type: text/plain; charset=UTF-8;
name="711 Spooky Mart.txt"
Content-Transfer-Encoding: 7-bit
Content-Disposition: attachment;
filename="711 Spooky Mart.txt"

_ _ _____ ________ __ _ _ _ ____ _ _______ ____
| | | |/ _ \ \ / / _ \ \ / / | | | | / \ / ___| |/ / ____| _ \
| |_| | | | \ \ /\ / /| | | \ V / | |_| | / _ \| | | ' /| _| | |_) |
| _ | |_| |\ V V / | |_| || | _ | _ |/ ___ \ |___| . \| |___| _ <
|_| |_|\___/ \_/\_/ |____/ |_| ( ) |_| |_/_/ \_\____|_|\_\_____|_| \_\
|/

⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣀⣀⣀⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⣶⠟⠛⠛⠛⠛⠛⣛⣻⣿⣿⣿⣿⣿⣟⣛⣛⣛⠛⠒⠲⠶⠦⣤⣤⣤⣀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣼⠏⠁⠀⠀⢀⣤⠶⣛⣩⣥⠤⠤⠤⠤⢤⣤⣤⣭⣭⣉⣉⣛⣛⣻⣭⣥⠬⡍⠛⢶⣄⡀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⢠⣾⠃⠀⠀⣠⡶⢋⡵⢛⡩⠵⠒⠒⠒⠒⠢⡀⠀⠀⠀⠀⠀⢀⣠⠤⠤⠤⢤⣄⠀⠀⠀⠉⠻⣆⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⢀⣿⠃⠀⠀⠘⢁⡴⢋⣴⢿⠒⠈⠉⣏⠉⠐⠒⡾⣄⠀⠀⠀⠀⠀⡠⠀⠀⢀⣀⣈⣙⣆⡀⠀⠀⢹⡆⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⣠⣾⠃⠀⠀⠀⠀⠀⢀⠟⣁⠀⠁⢀⣤⣦⣤⡀⠘⠀⢈⣷⡄⠀⠀⠀⣇⠖⠉⠙⠅⠀⠀⠉⠉⠑⢦⡈⣷⡀⠀⠀⠀⠀
⠀⠀⠀⠀⢠⣾⢿⣧⠤⠤⠤⠄⠀⠖⣿⠀⠃⠀⠀⣿⣿⣿⣿⡗⠀⠐⠁⢸⡇⠀⣀⣰⠉⠠⠀⠀⣰⣶⣷⣶⠀⠀⠀⢱⡈⢻⣦⠀⠀⠀
⠀⠀⠀⣠⡿⣱⠋⢀⣴⠶⠚⠻⢶⣤⡘⢧⣄⠆⠂⠀⡉⠉⣉⣀⣀⠉⣠⡟⠁⠀⠉⢻⣆⠀⠀⠀⠘⠛⠟⠛⠀⠀⢈⡿⢍⢢⢹⡇⠀⠀
⠀⠀⢠⣿⠁⡇⢠⣿⠁⠀⢰⣦⡀⠉⠉⠀⠈⠙⠲⠾⠾⠶⠶⠶⠚⠋⠉⠀⠀⠀⠀⢸⣯⡑⠢⢤⣀⣂⣀⣨⠤⠒⠛⠃⠘⡆⡇⡧⠀⠀
⠀⠀⢸⣿⠀⡇⢸⡇⢠⣴⣾⠋⠛⢷⣦⣀⠀⠀⠀⠠⠤⠤⠴⢠⠶⠒⠀⠀⠀⠀⠀⠀⠉⢿⣦⡀⠀⠀⠀⠀⢸⣷⠀⠀⡼⢡⢣⡇⠀⠀
⠀⠀⠀⢿⡇⣧⠘⠿⠀⠀⠸⣧⡀⠀⠈⢻⡿⢶⣦⣄⡀⠀⠀⠸⣆⠐⠟⠻⠷⠀⠀⠀⢀⣾⠛⠃⠑⠤⠀⢀⣼⣿⡇⢀⠤⢂⣾⠃⠀⠀
⠀⠀⠀⠈⢻⣌⠑⠦⠀⠀⠀⢿⣿⣷⣤⣸⣷⡀⠀⠈⠙⠻⢿⣶⣤⣄⣀⡀⠀⠀⠙⠿⠟⠁⠀⠀⢀⣠⡴⣿⠉⣿⣿⠀⠀⣼⠁⠀⠀⠀
⠀⠀⠀⠀⠀⠙⣷⡀⠀⠀⠀⢸⣿⣿⣿⣿⣿⣿⣶⣤⣀⣀⣼⠁⠀⠈⠉⠙⣿⠛⠛⠻⢿⠿⠛⠛⢻⡇⠀⢸⡀⣹⣿⠀⠀⡏⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠈⢿⡀⠀⠀⢸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣶⣤⣤⣄⣀⣿⣄⣀⣀⣸⣄⣀⣠⣴⣿⣶⣿⣿⣿⣿⡇⠀⡇⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠈⢷⡄⠀⠀⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡇⠀⡇⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠈⢿⣦⠀⠘⣿⠛⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡇⠀⣷⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠙⢷⣄⠘⢷⡀⠘⡟⠿⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡇⠀⣿⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠹⣧⡀⠻⣾⡃⠀⠀⠈⠙⢿⡿⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡇⠀⣿⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠘⢿⣄⠈⠻⣦⡀⠀⠀⡼⠀⠀⠈⠙⠻⣿⠿⠿⠿⢿⣿⣿⣿⣿⣿⣿⣿⢿⡿⣹⠇⠀⣿⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠹⣷⣄⠈⠛⠷⣼⣇⡀⠀⠀⠀⠀⣿⠀⠀⠀⢸⡇⠀⠀⡿⠀⢸⠇⣘⣧⠟⠀⢀⡿⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠛⢷⣄⡀⠀⠙⠻⠷⠶⣶⣾⣿⣤⣀⣠⣿⣄⣀⣴⠷⠶⠿⠿⠟⠋⠀⢀⣾⠃⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠛⠿⣶⣤⣤⣀⣀⡀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣀⣀⣀⣀⣤⡤⠞⠁⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠉⠙⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠋⠉⠀⠀⠀⠀⠀⠀⠀⠀


Click here to read the complete article
Re: What methods can throttle INN connections?

<sl4cln$11h6$1@gioia.aioe.org>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=286&group=news.software.nntp#286

  copy link   Newsgroups: news.software.nntp
Path: i2pn2.org!i2pn.org!aioe.org!9WxlgsACiSVNgeZD4+dK5A.user.46.165.242.75.POSTED!not-for-mail
From: est...@aioe.org (Aioe)
Newsgroups: news.software.nntp
Subject: Re: What methods can throttle INN connections?
Date: Sun, 24 Oct 2021 21:37:27 +0200
Organization: Aioe.org NNTP Server
Message-ID: <sl4cln$11h6$1@gioia.aioe.org>
References: <sl1nqc$1j4c$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="34342"; posting-host="9WxlgsACiSVNgeZD4+dK5A.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101
Thunderbird/78.13.0
Content-Language: en-US
X-Notice: Filtered by postfilter v. 0.9.2
 by: Aioe - Sun, 24 Oct 2021 19:37 UTC

Il 23/10/21 21:30, 711 Spooky Mart ha scritto:
> 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.

if you need a limit for all users, iptables does this
if you need a limit for each user, max_rate does this (see man readers.con)

>
> [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.

imho it isn't a good strategy
you have to set some thresholds in the system resources used by each IP,
if one exceeds them you ban it for a certain time
it is not difficult to write a script that reads the logs, builds a
database of the resources used by each client then bans and unbans it

> [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.

iptables does this

> [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.

you've to patch idd to do this

Re: What methods can throttle INN connections?

<sl4efh$1smi$1@gioia.aioe.org>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=287&group=news.software.nntp#287

  copy link   Newsgroups: news.software.nntp
Path: i2pn2.org!i2pn.org!aioe.org!tMKeRVXpyDcsnWhpMgMuCw.user.46.165.242.75.POSTED!not-for-mail
From: 711...@spooky.mart (711 Spooky Mart)
Newsgroups: news.software.nntp
Subject: Re: What methods can throttle INN connections?
Date: Sun, 24 Oct 2021 15:09:44 -0500
Organization: Aioe.org NNTP Server
Message-ID: <sl4efh$1smi$1@gioia.aioe.org>
References: <sl1nqc$1j4c$1@gioia.aioe.org> <sl4cln$11h6$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Info: gioia.aioe.org; logging-data="62162"; posting-host="tMKeRVXpyDcsnWhpMgMuCw.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Secret Agent Man
Content-Language: en-US
X-Notice: Filtered by postfilter v. 0.9.2
 by: 711 Spooky Mart - Sun, 24 Oct 2021 20:09 UTC

On 10/24/21 2:37 PM, Aioe wrote:

> imho it isn't a good strategy
> you have to set some thresholds in the system resources used by each IP,
> if one exceeds them you ban it for a certain time
> it is not difficult to write a script that reads the logs, builds a
> database of the resources used by each client then bans and unbans it

What I'm gathering then, is I got some hacking to do. Maybe I'll post a
followup explaining how it all turns out so we can have a cheat sheet.

Thanks all for your advice.

--
──┏━━━━┓──┏━━┓───┏━━┓── ┌────────────────────────┐ ┌────────┐
──┗━━┓─┃──┗┓─┃───┗┓─┃── │ Spooky Mart [chan] 711 │ │ always │
─────┃─┃──┏┛─┗┓──┏┛─┗┓─ │ https://bitmessage.org │ │ open │
─────┗━┛──┗━━━┛──┗━━━┛─ └────────────────────────┘ └────────┘

Re: What methods can throttle INN connections?

<b210$6175c12e$a6b0b90a$23199@news.sonic-news.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=288&group=news.software.nntp#288

  copy link   Newsgroups: news.software.nntp
Path: i2pn2.org!i2pn.org!aioe.org!feeder1.feed.usenet.farm!feed.usenet.farm!news-out.usenetmax.com!news.sonic-news.com!not-for-mail
Subject: Re: What methods can throttle INN connections?
Newsgroups: news.software.nntp
References: <sl1nqc$1j4c$1@gioia.aioe.org>
From: eti...@sonic-news.com (Etian)
Date: Sun, 24 Oct 2021 13:25:15 -0700
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101
Thunderbird/68.10.0
MIME-Version: 1.0
In-Reply-To: <sl1nqc$1j4c$1@gioia.aioe.org>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 7bit
Message-ID: <b210$6175c12e$a6b0b90a$23199@news.sonic-news.com>
X-Complaints-To: abuse@sonic-news.com
Organization: www.sonic-news.com
Lines: 21
NNTP-Posting-Date: Sun, 24 Oct 2021 16:25:18 -0400
X-Trace: 0b2106175c12e3151caf23199
 by: Etian - Sun, 24 Oct 2021 20:25 UTC

On 10/23/21 12:30 PM, 711 Spooky Mart wrote:
> 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.
>
You can use tc to limit outgoing bandwidth per IP. inn has it's
exponential backoff parameters for posting, but it is otherwise
difficult to limit incoming bandwidth.

https://duckduckgo.com/?t=ffsb&q=use+tc+to+limit+bandwidth&ia=web

You would need to tweak the inn source code to put a delay before
commands--I can't imagine why you would want to. To have two different
versions of an article, you would need two different spools. You would
need to write your own news forwarder to strip the attachment and send
it to your second spool, but it wouldn't be difficult using Perl Net::NNTP.

Re: What methods can throttle INN connections?

<87pmrugoaq.fsf@hope.eyrie.org>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=289&group=news.software.nntp#289

  copy link   Newsgroups: news.software.nntp
Path: i2pn2.org!i2pn.org!paganini.bofh.team!news.killfile.org!news.eyrie.org!.POSTED!not-for-mail
From: eag...@eyrie.org (Russ Allbery)
Newsgroups: news.software.nntp
Subject: Re: What methods can throttle INN connections?
Date: Sun, 24 Oct 2021 13:28:45 -0700
Organization: The Eyrie
Message-ID: <87pmrugoaq.fsf@hope.eyrie.org>
References: <sl1nqc$1j4c$1@gioia.aioe.org> <sl4cln$11h6$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain
Injection-Info: hope.eyrie.org;
logging-data="29966"; mail-complaints-to="news@eyrie.org"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)
Cancel-Lock: sha1:ocKmpuxS3ByaFeDmVJ5PEMQ1p8g=
 by: Russ Allbery - Sun, 24 Oct 2021 20:28 UTC

Aioe <estasi@aioe.org> writes:
> Il 23/10/21 21:30, 711 Spooky Mart ha scritto:

>> 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.

> if you need a limit for all users, iptables does this
> if you need a limit for each user, max_rate does this (see man readers.con)

Good call on max_rate; I'd forgotten about that.

>> [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.

> you've to patch idd to do this

The easiest place to do so would probably be to patch innxmit (or innfeed,
but for this sort of specialty use, the much simpler innxmit is probably
better) to strip the binary attachments out of the outgoing feed.

The hard part is going to be finding a good MIME parser in C. I'm sure
there are tons of them out there in all the different mail programs
written in C, but whether any of them is reusable for your purpose is
another question.

Or, hm, you could probably also do something fancy with a batch feed where
you rewrite the batch in some other program more suitable to doing
parsing, like Python.

--
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.

Re: What methods can throttle INN connections?

<slrnsncafo.aph.mnalis-news@leia.home.lan>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=293&group=news.software.nntp#293

  copy link   Newsgroups: news.software.nntp
Path: i2pn2.org!i2pn.org!aioe.org!newsfeed.CARNet.hr!.POSTED.2001:470:26:148:847e:52f6:c4b6:6238!not-for-mail
From: mnalis-n...@voyager.hr (Matija Nalis)
Newsgroups: news.software.nntp
Subject: Re: What methods can throttle INN connections?
Date: Mon, 25 Oct 2021 05:52:24 +0200
Organization: CARNet, Croatia
Sender: mnalis@public.hr
Message-ID: <slrnsncafo.aph.mnalis-news@leia.home.lan>
References: <sl1nqc$1j4c$1@gioia.aioe.org> <sl4cln$11h6$1@gioia.aioe.org>
<sl4efh$1smi$1@gioia.aioe.org>
Injection-Info: news1.carnet.hr; posting-host="2001:470:26:148:847e:52f6:c4b6:6238";
logging-data="10498"; mail-complaints-to="abuse@CARNet.hr"
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:E3U3gpQG+VM7sEgCCY0VDjJ7rmE=
 by: Matija Nalis - Mon, 25 Oct 2021 03:52 UTC

On Sun, 24 Oct 2021 15:09:44 -0500, 711 Spooky Mart <711@spooky.mart> wrote:
> On 10/24/21 2:37 PM, Aioe wrote:
>> imho it isn't a good strategy
>> you have to set some thresholds in the system resources used by each IP,
>> if one exceeds them you ban it for a certain time
>> it is not difficult to write a script that reads the logs, builds a
>> database of the resources used by each client then bans and unbans it
>
> What I'm gathering then, is I got some hacking to do. Maybe I'll post a
> followup explaining how it all turns out so we can have a cheat sheet.

Actually, there is fairly popular "fail2ban" program (included in many
GNU/Linux distros, if you happen to use that), which does exactly that sort
of job (parses logs and firewalls IPs unless they are in whitelist CIDRs,
and later unbans them etc.), so it could be reused and only a matching rule
written for it instead of doing it from scratch.

Perhaps it would be good enough for you use case.

--
Opinions above are GNU-copylefted.

Re: What methods can throttle INN connections?

<slcctf$1ph4o$1@news.trigofacile.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=328&group=news.software.nntp#328

  copy link   Newsgroups: news.software.nntp
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!news.trigofacile.com!.POSTED.176-143-2-105.abo.bbox.fr!not-for-mail
From: iul...@nom-de-mon-site.com.invalid (Julien ÉLIE)
Newsgroups: news.software.nntp
Subject: Re: What methods can throttle INN connections?
Date: Wed, 27 Oct 2021 22:30:39 +0200
Organization: Groupes francophones par TrigoFACILE
Message-ID: <slcctf$1ph4o$1@news.trigofacile.com>
References: <sl1nqc$1j4c$1@gioia.aioe.org>
<sl3r7q$blk$1@remote6hme0.ripco.com>
<bada55$Pig$Milk$Machines@711.spooky.mart>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 27 Oct 2021 20:30:39 -0000 (UTC)
Injection-Info: news.trigofacile.com; posting-account="julien"; posting-host="176-143-2-105.abo.bbox.fr:176.143.2.105";
logging-data="1885336"; mail-complaints-to="abuse@trigofacile.com"
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0)
Gecko/20100101 Thunderbird/78.14.0
In-Reply-To: <bada55$Pig$Milk$Machines@711.spooky.mart>
Content-Language: fr
 by: Julien ÉLIE - Wed, 27 Oct 2021 20:30 UTC

Hi Spooky Mart,

> It's a workgroup
> setup for a documentation project. PDF is necessary because of LATEX
> maths, and math fonts must be embedded for proper document formatting.

Oh, interesting.
I ran my first INN when I was student, and used the Perl posting hook
(mentioned by Russ -
https://www.eyrie.org/~eagle/software/inn/docs/hook-perl.html) to
convert plain text articles to HTML on the fly with embedded LaTeX images.
Basically, the hook transformed things like $\frac{1}{2}$ to an <img
src="mimetex.cgi?..."> call.

Just an idea if you have such a use case in a local newsgroup.
Students could exchange articles with embedded formulae very easily this
way.

Of course if your need is only exchanging existing PDF, it doesn't
answer it.

--
Julien ÉLIE

« – Ils s'arrêtaient tous les jours à 5 heures, pour boire de l'eau
chaude…
– Je prendrai un nuage de lait, je vous prie. » (Astérix)

Re: What methods can throttle INN connections?

<slcdug$1phhs$1@news.trigofacile.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=329&group=news.software.nntp#329

  copy link   Newsgroups: news.software.nntp
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!news.trigofacile.com!.POSTED.176.143-2-105.abo.bbox.fr!not-for-mail
From: iul...@nom-de-mon-site.com.invalid (Julien ÉLIE)
Newsgroups: news.software.nntp
Subject: Re: What methods can throttle INN connections?
Date: Wed, 27 Oct 2021 22:48:16 +0200
Organization: Groupes francophones par TrigoFACILE
Message-ID: <slcdug$1phhs$1@news.trigofacile.com>
References: <sl1nqc$1j4c$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 27 Oct 2021 20:48:16 -0000 (UTC)
Injection-Info: news.trigofacile.com; posting-account="julien"; posting-host="176.143-2-105.abo.bbox.fr:176.143.2.105";
logging-data="1885756"; mail-complaints-to="abuse@trigofacile.com"
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0)
Gecko/20100101 Thunderbird/78.14.0
In-Reply-To: <sl1nqc$1j4c$1@gioia.aioe.org>
Content-Language: fr
 by: Julien ÉLIE - Wed, 27 Oct 2021 20:48 UTC

Hi Spooky Mart,

> [1] Firstly I want to throttle all client connections to max 64kB/s.
[...]
> [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.

What would prevent me from running a program like pullnews or suck at
64kB/s and then provide the big world network the same full articles as
what can be found in your news server? (and feed them to whom is interested)

--
Julien ÉLIE

« – Ils s'arrêtaient tous les jours à 5 heures, pour boire de l'eau
chaude…
– Je prendrai un nuage de lait, je vous prie. » (Astérix)

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor