]> Cypherpunks.ru repositories - govpn.git/blob - doc/server.texi
a9ce065ddbfeb45ca1afcb5de1241dda3eb148a0
[govpn.git] / doc / server.texi
1 @node Server
2 @section Server part
3
4 Except for common @code{-mtu}, @code{-stats}, @code{-egd} options server
5 has the following ones:
6
7 @table @code
8
9 @item -proto
10 @ref{Network, network protocol} to use. Can be @emph{udp},
11 @emph{tcp} or @emph{all}.
12
13 @item -bind
14 Address (@code{host:port} format) we must bind to.
15
16 @item -peers
17 Path to the directory containing peers information, database.
18
19 @item -proxy
20 Start trivial HTTP @ref{Proxy} server on specified @emph{host:port}.
21
22 @end table
23
24 Peers directory must contain subdirectories with the names of client's
25 identities in hexadecimal notation. Each subdirectory has the following
26 files:
27
28 @table @code
29
30 @item verifier
31 @strong{Required}. Contains corresponding verifier used to authenticate
32 the client in hexadecimal notation. See @ref{Verifier} for how
33 to create it.
34
35 @item up.sh
36 @strong{Required}. up-script executes each time connection with the
37 client is established. It's @emph{stdout} output must contain TAP
38 interface name on the first string. This script can be simple
39 @code{echo tap10}, or maybe more advanced like this:
40     @example
41     #!/bin/sh
42     $tap=$(ifconfig tap create)
43     ifconfig $tap inet6 fc00::1/96 mtu 1412 up
44     echo $tap
45     @end example
46
47 @item down.sh
48 Optional. Same as @code{up.sh} above, but executes when connection is
49 lost.
50
51 @item name
52 Optional. Contains human readable username. Used to beauty output of
53 @ref{Stats}.
54
55 @item timeout
56 Optional. Contains @ref{Timeout} setting (decimal notation) in seconds.
57 Otherwise default minute timeout will be used.
58
59 @item noise
60 Optional. Contains either "1" (enable @ref{Noise} adding), or "0".
61
62 @item cpr
63 Optional. Contains @ref{CPR} setting (decimal notation) in KiB/sec.
64
65 @end table
66
67 Each minute server refreshes peers directory contents and adds newly
68 appeared identities, deletes an obsolete ones.
69
70 You can use convenient @code{utils/newclient.sh} script for new client
71 creation:
72
73 @example
74 % ./utils/newclient.sh Alice
75 Place verifier to peers/9b40701bdaf522f2b291cb039490312/verifier
76 @end example
77
78 @code{9b40701bdaf522f2b291cb039490312} is client's identification.
79 @code{peers/9b40701bdaf522f2b291cb039490312/name} contains @emph{Alice},
80 @code{peers/9b40701bdaf522f2b291cb039490312/verifier} contains dummy
81 verifier and @code{peers/9b40701bdaf522f2b291cb039490312/up.sh} contains
82 currently dummy empty up-script.