]> Cypherpunks.ru repositories - govpn.git/blob - doc/server.texi
49a09fb990438998a7a939d354e650c800761120
[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   "9b40701bdaf522f2b291cb039490312": {  <-- Peer identifier
29     "name": "stargrave",                <-- OPTIONAL human readable name
30     "up": "./stargrave-up.sh",          <-- up-script
31     "down": "./stargrave-down.sh",      <-- OPTIONAL down-script
32     "timeout": 60,                      <-- OPTIONAL overriden timeout
33     "noise": true,                      <-- OPTIONAL noise enabler
34                                             (default: false)
35     "cpr": 64,                          <-- OPTIONAL constant packet
36                                             rate in KiB/sec
37     "verifier": "2c15bbdffc73193bea56db412bce1143c68ccbdaa9e2eade53a684497646a685"
38   },
39   [...]
40 }
41 @end verbatim
42
43 See @ref{Verifier} for its description.
44
45 up-script executes each time connection with the client is established.
46 Its @emph{stdout} output must contain TAP interface name as the first
47 line. This script can be simple @code{echo tap10}, or maybe more
48 advanced like this:
49 @example
50 #!/bin/sh
51 $tap=$(ifconfig tap create)
52 ifconfig $tap inet6 fc00::1/96 mtu 1412 up
53 echo $tap
54 @end example
55
56 Each minute server rereads and refreshes peers configuration and adds
57 newly appeared identities, deletes an obsolete ones.
58
59 You can use convenient @code{utils/newclient.sh} script for new client
60 creation:
61
62 @verbatim
63 % ./utils/newclient.sh Alice
64 [...]
65 Your id is: 7012df29deee2170594119df5091d4a2
66
67 Place the following JSON configuration entry on the server's side:
68
69     "906e34b98750c4f686d6c5489508763c": {
70         "name": "Alice",
71         "up": "/path/to/up.sh",
72         "verifier": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
73     }
74 [...]
75 @end verbatim