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