.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "TINYLEAF 8" .TH TINYLEAF 8 2024-04-01 "INN 2.7.2" "InterNetNews Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME tinyleaf \- Very simple IHAVE\-only NNTP server .SH SYNOPSIS .IX Header "SYNOPSIS" \&\fBtinyleaf\fR \fIspool\fR [\fIprocessor\fR] .SH DESCRIPTION .IX Header "DESCRIPTION" \&\fBtinyleaf\fR is intended to be the simplest possible transit news server that still does something useful. It must be run under inetd(8) or some equivalent, and only implements three commands (HELP, IHAVE, and QUIT). When it receives an article, it saves it into the directory \fIspool\fR and, if \fIprocessor\fR is given, passes information about the article to \&\fIprocessor\fR 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, \&\fBtinyleaf\fR will refuse the article, reporting it as a duplicate. .PP If \fIprocessor\fR is given, it should specify the path to a program. That program is started when \fBtinyleaf\fR starts, and its current working directory will be \fIspool\fR. For each article received by \fBtinyleaf\fR, a single line will be sent to standard input of \fIprocessor\fR. That line will consist of the file name of the received article (relative to \&\fIspool\fR), 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 \&\fBtinyleaf\fR shuts down, standard input to \fIprocessor\fR will be closed. .PP \&\fBtinyleaf\fR does no syntax verification of received articles whatsoever; it just stores them and optionally passes them off to \fIprocessor\fR. It also never deletes articles; normally, \fIprocessor\fR should do that when it's finished doing whatever it needs to with the article. .PP \&\fBtinyleaf\fR 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 \fBtinyleaf\fR via tcpd(8) from TCP wrappers and use \&\fI/etc/hosts.allow\fR and \fI/etc/hosts.deny\fR to restrict who can talk to the server.) .PP \&\fBtinyleaf\fR 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. .SH EXAMPLE .IX Header "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. 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. .PP Then, add a line like: .PP .Vb 2 \& nntp stream tcp nowait archive /usr/sbin/tcpd \e \& /tinyleaf /tinyleaf /archive .Ve .PP (all on one line \-\-\ the backslash and split in this line is just for readability) where \f(CW\*(C`archive\*(C'\fR is the user that owns the archive, \&\fI/usr/sbin/tcpd\fR is the path to tcpd(8), \fIpathbin\fR/tinyleaf is the path to this program, \fIpathspool\fR/tinyleaf is some scratch directory that the user \f(CW\*(C`archive\*(C'\fR has write access to, and \&\fIpathbin\fR/archive is the path to your \fBarchive\fR script. .PP You can now restrict access to \fBtinyleaf\fR to just your local news server with \f(CW\*(C`/etc/hosts.allow\*(C'\fR and \f(CW\*(C`/etc/hosts.deny\*(C'\fR 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. .PP Note that the archiving script should probably perform basic syntax and validity checks on the input, since \fBtinyleaf\fR doesn't. .PP This is the application that motivated the original development of this program. .SH BUGS .IX Header "BUGS" The timeout and maximum message size should really be configurable. \&\fBtinyleaf\fR 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. .PP An option to scan the spool directory for any left-over files and pass them to the processor when starting up would be useful. .SH HISTORY .IX Header "HISTORY" Written by Russ Allbery for InterNetNews. .SH "SEE ALSO" .IX Header "SEE ALSO" hosts_access(5), inetd(8), tcpd(8).