]> Cypherpunks.ru repositories - govpn.git/blob - doc/server.texi
a00c45219329c0bc460deb2f712e92d6656f3776
[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} (default),
11 @emph{tcp} or @emph{all}.
12
13 @item -bind
14 Address (@code{host:port} format) we must bind to.
15
16 @item -conf
17 Path to JSON file with the configuration.
18
19 @item -proxy
20 Start trivial HTTP @ref{Proxy} server on specified @emph{host:port}.
21
22 @end table
23
24 Configuration file is JSON file with following example structure:
25
26 @verbatim
27 {
28   "stargrave": {                        <-- Peer human readable name
29     "up": "./stargrave-up.sh",          <-- up-script
30     "down": "./stargrave-down.sh",      <-- OPTIONAL down-script
31     "timeout": 60,                      <-- OPTIONAL overriden timeout
32     "noise": true,                      <-- OPTIONAL noise enabler
33                                             (default: false)
34     "cpr": 64,                          <-- OPTIONAL constant packet
35                                             rate in KiB/sec
36     "verifier": "$argon2d..."           <-- verifier received from client
37   },
38   [...]
39 }
40 @end verbatim
41
42 up-script executes each time connection with the client is established.
43 Its @emph{stdout} output must contain TAP interface name as the first
44 line. This script can be simple @code{echo tap10}, or maybe more
45 advanced like this:
46 @example
47 #!/bin/sh
48 $tap=$(ifconfig tap create)
49 ifconfig $tap inet6 fc00::1/96 mtu 1412 up
50 echo $tap
51 @end example
52
53 Each minute server rereads and refreshes peers configuration and adds
54 newly appeared identities, deletes an obsolete ones.
55
56 You can use convenient @code{utils/newclient.sh} script for new client
57 creation:
58
59 @verbatim
60 % ./utils/newclient.sh Alice
61 [...]
62 Your client verifier is: $argon2d$m=4096,t=128,p=1$bwR5VjeCYIQaa8SeaI3rqg
63
64 Place the following JSON configuration entry on the server's side:
65
66     "Alice": {
67         "up": "/path/to/up.sh",
68         "verifier": "$argon2d$m=4096,t=128,p=1$bwR5VjeCYIQaa8SeaI3rqg$KCNIqfS4DGsBTtVytamAzcISgrlEWvNxan1UfBrFu10"
69     }
70 [...]
71 @end verbatim