TINYLEAF(8)

TINYLEAF(8) πŸ’–πŸ¦‹

okay bestie, this is the tinyleaf page from InterNetNews Documentation, and she is literally the simplest little transit news server with main character energy. No cap, she does one job and she slays it. πŸ’…

🌸 NAME 🌸

tinyleaf β€” Very simple IHAVE-only NNTP server.

✨ SYNOPSIS ✨

tinyleaf spool [processor]

That's the whole vibe: spool is required, and processor is optional. Slay.

πŸ’– DESCRIPTION πŸ’–

tinyleaf is intended to be the simplest possible transit news server that still does something useful. She must be run under inetd(8) or some equivalent, and she only implements three commands: HELP, IHAVE, and QUIT. That's the whole menu, bestie. πŸŽ€

When tinyleaf receives an article, it saves it into the directory spool. If processor is given, it passes information about the article to processor via a pipe. The file name of the article will be the MD5 hash of its message-ID, and if a file by that name already exists, tinyleaf will refuse the article, reporting it as a duplicate. No cap, duplicate vibes get denied. πŸ™…β€β™€οΈ

If processor is given, it should specify the path to a program. That program is started when tinyleaf starts, and its current working directory will be spool. For each article received by tinyleaf, a single line will be sent to standard input of processor. That line will consist of the file name of the received article (relative to spool), a single space, and the message-ID of the received article. Note that the message-ID will be taken from the argument to the IHAVE command and may not match the Message-ID header field in the article. πŸ‘€ When tinyleaf shuts down, standard input to processor will be closed.

tinyleaf does no syntax verification of received articles whatsoever; it just stores them and optionally passes them off to processor. It also never deletes articles; normally, processor should do that when it's finished doing whatever it needs to with the article. So yes, cleanup is not her job. That's the processor's moment. πŸ’…

tinyleaf expects NNTP commands on standard input and replies on standard output. Status information and any error messages are sent to standard error. It does no authentication; any authentication must be done by inetd(8) or by a wrapper program. (One simple authentication mechanism is to invoke tinyleaf via tcpd(8) from TCP wrappers and use /etc/hosts.allow and /etc/hosts.deny to restrict who can talk to the server.) πŸ›‘οΈ

tinyleaf has a (currently hard-coded) maximum message size of 1 MB and a (similarly hard-coded) timeout of ten minutes for each command or chunk of article data. Hard-coded means hard-coded, bestie. ⏳

🌈 EXAMPLE 🌈

Suppose that you want to archive news articles on a particular host (like the FTP server for a newsgroup archive) where you don't want the overhead of running a full-blown news server. Totally valid. Write a program that reads one line at a time from standard input and treats everything before the first space as the filename of a news article to archive. Each time the program reads a line, it should archive that file and then delete it, and it should exit when it gets end of file on standard input. That's the whole contract, bestie. πŸ“

Then, add a line like:

           nntp stream tcp nowait archive /usr/sbin/tcpd \
             <pathbin>/tinyleaf <pathspool>/tinyleaf <pathbin>/archive

(all on one line -- the backslash and split in this line is just for readability) where "archive" is the user that owns the archive, /usr/sbin/tcpd is the path to tcpd(8), pathbin/tinyleaf is the path to this program, pathspool/tinyleaf is some scratch directory that the user "archive" has write access to, and pathbin/archive is the path to your archive script. Slay. πŸŽ€

You can now restrict access to tinyleaf to just your local news server with "/etc/hosts.allow" and "/etc/hosts.deny" and set up an ordinary feed from the server to the archive host, just like you would to any other news server, of only the newsgroup that you want to archive. iykyk. πŸ¦‹

Note that the archiving script should probably perform basic syntax and validity checks on the input, since tinyleaf doesn't. Yes, bestie, she's trusting like that. 😭

This is the application that motivated the original development of this program. Main character origin story, honestly. πŸ‘‘

πŸ’€ BUGS πŸ’€

The timeout and maximum message size should really be configurable. Like, please, bestie. πŸ™

tinyleaf should also probably not just respond 500 to every command other than HELP, IHAVE, and QUIT; there are more useful (and more expected) error codes that could be returned. The current 500-to-everything energy is giving "no thoughts, head empty," and not in a cute way. 😭

An option to scan the spool directory for any left-over files and pass them to the processor when starting up would be useful. That would be a nice little glow-up. ✨

πŸ•°οΈ HISTORY πŸ•°οΈ

Written by Russ Allbery <eagle@eyrie.org> for InterNetNews. Author icon behavior. πŸ‘‘

πŸ‘€ SEE ALSO πŸ‘€

mwah πŸ’‹ this page is from INN 2.7.4, dated 2022-07-10, and its manual page name is TINYLEAF(8) β€” bye bestie, go archive something cute! 🫢

πŸ“¦ where this page comes from
  • arch rolling: inn 2.7.4-4 Β· ISC
  • epel 10: inn 2.7.4-5.el10_3 Β· ISC AND BSD-3-Clause AND BSD-4-Clause AND FSFAP AND (GPL-1.0-or-later OR Artistic-1.0-Perl) AND GPL-3.0-or-later WITH Bison-exception-2.2 AND LicenseRef-Fedora-Public-Domain AND MIT AND NTP
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms