]> Cypherpunks.ru repositories - nncp.git/blob - doc/admin.texi
Merge branch 'develop'
[nncp.git] / doc / admin.texi
1 @node Administration
2 @unnumbered Administration
3
4 NNCP uses following files/directories you should be aware of:
5
6 @itemize
7
8 @item
9     @ref{Configuration} file, for example @file{/usr/local/etc/nncp.hjson}.
10     Should not be globally readable, because it contains private keys.
11
12 @item
13     @ref{Spool} directory with inbound/outbound encrypted packets, for
14     example @file{/var/spool/nncp}.
15
16     It also contains temporary files (in @file{tmp/} directory),
17     possibly left alone, if some of the commands failed and prematurely
18     exited and that should be cleaned from time to time.
19
20     Partly transferred files are stored with @file{.part} suffix. And
21     possibly they also require cleanup if they are completely lost.
22
23     Also it can contain @file{.seen} files, that should be cleaned too
24     from time to time.
25
26     All of that cleaning tasks can be done with @ref{nncp-rm} utility.
27
28     @anchor{Shared spool}
29     If you want to share single spool directory with multiple grouped
30     Unix users, then you can @command{setgid} it and assure that umask
31     is group friendly. For convenience you can set @option{umask}
32     globally for invoked NNCP commands in the configuration file. For
33     example:
34
35 @example
36 $ chgrp nncp /usr/local/etc/nncp.hjson /var/spool/nncp
37 $ chmod g+r /usr/local/etc/nncp.hjson
38 $ chmod g+rwxs /var/spool/nncp
39 $ echo 'umask: "007"' >> /usr/local/etc/nncp.hjson
40 @end example
41
42 @item
43     @ref{Log} file, for example @file{/var/spool/nncp/log}. It should be
44     rotated. Choose you own preferable way to do it.
45
46     Example @url{https://www.newsyslog.org/manual.html, newsyslog}'s entry:
47 @example
48 /var/spool/nncp/log             644     7       100     *       BCYN
49 @end example
50
51 @item
52     Optional @ref{CfgIncoming, incoming} directories where uploaded
53     files are stored. Probably you want to run @ref{nncp-reass} from
54     time to time to reassemble all chunked uploads. Example crontab
55     entry:
56
57 @example
58 */1     *       *       *       *       nncp-reass -all -noprogress
59 @end example
60
61 @item
62     Possibly long running @ref{nncp-daemon}, @ref{nncp-caller},
63     @ref{nncp-toss} daemons. As all software, they can fail and you
64     should place them under some supervisor control.
65
66     For example you can use @url{http://cr.yp.to/daemontools.html,
67     daemontools} for that task to run them under probably existing
68     @verb{|uucp|} user:
69
70 @example
71 # mkdir -p /var/service/nncp-toss/log
72 # chmod 755 /var/service/nncp-toss/log /var/service/nncp-toss
73 # cd /var/service/nncp-toss
74
75 # cat > run_ <<EOF
76 #!/bin/sh -e
77 exec 2>&1
78 exec setuidgid uucp /usr/local/bin/nncp-toss -cycle 10
79 EOF
80 # chmod 755 run_
81
82 # cat > log/run_ <<EOF
83 #!/bin/sh -e
84 exec setuidgid uucp multilog t ./main
85 EOF
86 # chmod 755 log/run_
87
88 # mv log/run_ log/run ; mv run_ run
89 @end example
90
91 @item
92     @ref{nncp-daemon} can also be run as
93     @url{https://en.wikipedia.org/wiki/Inetd, inetd} service on UUCP's port:
94
95 @example
96 uucp    stream  tcp6    nowait  nncpuser        /usr/local/bin/nncp-daemon      nncp-daemon -quiet -inetd
97 @end example
98
99 @end itemize