]> Cypherpunks.ru repositories - govpn.git/blob - doc/server.texi
[DOC] User manual refactoring
[govpn.git] / doc / server.texi
1 @node Server part
2 @section Server part
3
4 Except for common @code{-mtu}, @code{-noncediff}, @code{-timeout},
5 @code{-stats} options server has the 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 identities
15 in hexadecimal notation. Each of those subdirectories must have
16 @strong{key} file with the corresponding authentication key,
17 @strong{up.sh} script that executes each time connection with the client
18 establishes, optional @code{name} file containing human readable
19 client's name and optional @code{down.sh} that executes during
20 connection lost.
21
22 @code{up.sh} script @strong{must} print on the first stdout line the
23 name of TAP interface. This script can be simple @code{echo tap10},
24 maybe more advanced with dynamic interface creation:
25
26 @example
27 #!/bin/sh
28 $tap=$(ifconfig tap create)
29 ifconfig $tap inet6 fc00::1/96 mtu 1412 up
30 echo $tap
31 @end example
32
33 Each minute server refreshes peers directory contents and adds newly
34 appeared identities, deletes an obsolete ones.
35
36 You can use convenient @code{utils/newclient.sh} script for new client
37 creation:
38
39 @example
40 % ./utils/newclient.sh Alice
41 9b40701bdaf522f2b291cb039490312
42 @end example
43
44 @code{9b40701bdaf522f2b291cb039490312} is client's identification.
45 @code{peers/9b40701bdaf522f2b291cb039490312/name} contains @emph{Alice},
46 @code{peers/9b40701bdaf522f2b291cb039490312/key} contains authentication key and
47 @code{peers/9b40701bdaf522f2b291cb039490312/up.sh} contains currently
48 dummy empty up-script.