.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35) .\" .\" 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 .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . 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 .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "TINYLEAF 8" .TH TINYLEAF 8 "2015-09-12" "INN 2.6.4" "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 \fBinetd\fR\|(8) or some equivalent, and only implements three commands (\s-1HELP, IHAVE,\s0 and \s-1QUIT\s0). 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 \s-1MD5\s0 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 \s-1IHAVE\s0 command and may not match the Message-ID: header 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 \s-1NNTP\s0 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 \fBinetd\fR\|(8) or by a wrapper program. (One simple authentication mechanism is to invoke \fBtinyleaf\fR via \fBtcpd\fR\|(8) from \s-1TCP\s0 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\ \s-1MB\s0 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 \s-1FTP\s0 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 \fBtcpd\fR\|(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 \s-1HELP, IHAVE,\s0 and \s-1QUIT\s0; 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. .PP \&\f(CW$Id:\fR tinyleaf.pod 9767 2014\-12\-07 21:13:43Z iulius $ .SH "SEE ALSO" .IX Header "SEE ALSO" \&\fBhosts_access\fR\|(5), \fBinetd\fR\|(8), \fBtcpd\fR\|(8).