]> 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 # cd /var/service/.nncp-toss
73
74 # cat > run <<EOF
75 #!/bin/sh -e
76 exec 2>&1
77 exec setuidgid uucp /usr/local/bin/nncp-toss -cycle 10
78 EOF
79
80 # cat > log/run <<EOF
81 #!/bin/sh -e
82 exec setuidgid uucp multilog t ./main
83 EOF
84
85 # chmod -R 755 /var/service/.nncp-toss
86 # mv /var/service/.nncp-toss /var/service/nncp-toss
87 @end example
88
89 @item
90     @ref{nncp-daemon} can also be run as
91     @url{https://en.wikipedia.org/wiki/Inetd, inetd} service on UUCP's port:
92
93 @example
94 uucp    stream  tcp6    nowait  nncpuser        /usr/local/bin/nncp-daemon      nncp-daemon -quiet -inetd
95 @end example
96
97 @item
98     Or it can be also run as a @command{daemontools} daemon under
99     @url{http://cr.yp.to/ucspi-tcp.html, UCSPI-TCP}:
100
101 @example
102 # mkdir -p /var/service/.nncp-daemon/log
103 # cd /var/service/.nncp-daemon
104
105 # cat > run <<EOF
106 #!/bin/sh -e
107 exec envuidgid nncpuser tcpserver -DRHU -l 0 0 uucp \
108         /usr/local/bin/nncp-daemon -quiet -inetd
109 EOF
110
111 # cat > log/run <<EOF
112 #!/bin/sh -e
113 exec setuidgid uucp multilog t ./main
114 EOF
115
116 # chmod -R 755 /var/service/.nncp-daemon
117 # mv /var/service/.nncp-daemon /var/service/nncp-daemon
118 @end example
119
120 @end itemize