]> Cypherpunks.ru repositories - govpn.git/blobdiff - doc/server.texi
Configure MTU on per-user basis
[govpn.git] / doc / server.texi
index 4fd074c0d391d220a6b1b328994c733e1fd3bbb4..b785be21e8c31f38d8c35127329cb63cd32d796c 100644 (file)
@@ -1,75 +1,78 @@
-@node Server part
+@node Server
 @section Server part
 
-Except for common @code{-mtu}, @code{-stats}, options server has the
+Except for common @code{-stats}, @code{-egd} options server has the
 following ones:
 
 @table @code
-@item -bind
-Address (@code{host:port} format) we must bind to.
-@item -peers
-Path to the directory containing peers information, database.
-@end table
 
-Peers directory must contain subdirectories with the names of client's
-identities in hexadecimal notation. Each subdirectory has the following
-files:
-
-@table @code
+@item -proto
+@ref{Network, network protocol} to use. Can be @emph{udp} (default),
+@emph{tcp} or @emph{all}.
 
-@item key
-@strong{Required}. Contains corresponding authentication PSK key in
-hexadecimal notation.
-
-@item up.sh
-@strong{Required}. up-script executes each time connection with the
-client is established. It's @emph{stdout} output must contain TAP
-interface name on the first string. This script can be simple
-@code{echo tap10}, or maybe more advanced like this:
-    @example
-    #!/bin/sh
-    $tap=$(ifconfig tap create)
-    ifconfig $tap inet6 fc00::1/96 mtu 1412 up
-    echo $tap
-    @end example
-
-@item down.sh
-Optional. Same as @code{up.sh} above, but executes when connection is
-lost.
-
-@item name
-Optional. Contains human readable username. Used to beauty output of
-@ref{Stats}.
+@item -bind
+Address (@code{host:port} format) we must bind to.
 
-@item timeout
-Optional. Contains @ref{Timeout} setting (decimal notation) in seconds.
-Otherwise default minute timeout will be used.
+@item -conf
+Path to JSON file with the configuration.
 
-@item noncediff
-Optional. Contains allowable @ref{Nonce difference} setting (decimal
-notation).
+@item -proxy
+Start trivial HTTP @ref{Proxy} server on specified @emph{host:port}.
 
-@item noise
-Optional. Contains either "1" (enable @ref{Noise} adding), or "0".
+@end table
 
-@item cpr
-Optional. Contains @ref{CPR} setting (decimal notation) in KiB/sec.
+Configuration file is JSON file with following example structure:
+
+@verbatim
+{
+  "stargrave": {                        <-- Peer human readable name
+    "iface": "tap10",                   <-- OPTIONAL TAP interface name
+    "mtu": 1514,                        <-- OPTIONAL overriden MTU
+    "up": "./stargrave-up.sh",          <-- OPTIONAL up-script
+    "down": "./stargrave-down.sh",      <-- OPTIONAL down-script
+    "timeout": 60,                      <-- OPTIONAL overriden timeout
+    "noise": true,                      <-- OPTIONAL noise enabler
+                                            (default: false)
+    "cpr": 64,                          <-- OPTIONAL constant packet
+                                            rate in KiB/sec
+    "verifier": "$argon2d..."           <-- verifier received from client
+  },
+  [...]
+}
+@end verbatim
+
+At least one of either @code{iface} or @code{up} must be specified. If
+you specify @code{iface}, then it will be forcefully used to determine
+what TAP interface will be used. If it is not specified, then up-script
+must output interface's name to stdout (first output line).
+
+For example up-script can be just @code{echo tap10}, or more advanced
+like the following one:
 
-@end table
+@example
+#!/bin/sh
+$tap=$(ifconfig tap create)
+ifconfig $tap inet6 fc00::1/96 mtu 1412 up
+echo $tap
+@end example
 
-Each minute server refreshes peers directory contents and adds newly
-appeared identities, deletes an obsolete ones.
+Each minute server rereads and refreshes peers configuration and adds
+newly appeared identities, deletes an obsolete ones.
 
 You can use convenient @code{utils/newclient.sh} script for new client
 creation:
 
-@example
+@verbatim
 % ./utils/newclient.sh Alice
-9b40701bdaf522f2b291cb039490312
-@end example
-
-@code{9b40701bdaf522f2b291cb039490312} is client's identification.
-@code{peers/9b40701bdaf522f2b291cb039490312/name} contains @emph{Alice},
-@code{peers/9b40701bdaf522f2b291cb039490312/key} contains authentication key and
-@code{peers/9b40701bdaf522f2b291cb039490312/up.sh} contains currently
-dummy empty up-script.
+[...]
+Your client verifier is: $argon2d$m=4096,t=128,p=1$bwR5VjeCYIQaa8SeaI3rqg
+
+Place the following JSON configuration entry on the server's side:
+
+    "Alice": {
+        "up": "/path/to/up.sh",
+        "iface": "or TAP interface name",
+        "verifier": "$argon2d$m=4096,t=128,p=1$bwR5VjeCYIQaa8SeaI3rqg$KCNIqfS4DGsBTtVytamAzcISgrlEWvNxan1UfBrFu10"
+    }
+[...]
+@end verbatim