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