badvpn-server.8 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. .TH badvpn-server 8 "6 October 2010"
  2. .SH NAME
  3. badvpn-server \- chat server for the BadVPN peer-to-peer VPN system
  4. .SH SYNOPSIS
  5. .B badvpn-server
  6. .RS
  7. .RB "[" --help "]"
  8. .br
  9. .RB "[" --version "]"
  10. .br
  11. .RB "[" --logger " <stdout/syslog>]"
  12. .br
  13. (logger=syslog?
  14. .br
  15. .RS
  16. .br
  17. .RB "[" --syslog-facility " <string>]"
  18. .br
  19. .RB "[" --syslog-ident " <string>]"
  20. .br
  21. .RE
  22. )
  23. .br
  24. .RB "[" --loglevel " <0-5/none/error/warning/notice/info/debug>]"
  25. .br
  26. .RB "[" --channel-loglevel " <channel-name> <0-5/none/error/warning/notice/info/debug>] ..."
  27. .br
  28. .RB "[" --listen-addr " <addr>] ..."
  29. .br
  30. .RB "[" --ssl " " --nssdb " <string> " --server-cert-name " <string>]"
  31. .br
  32. .RB "[" --comm-predicate " <string>]"
  33. .br
  34. .RB "[" --relay-predicate " <string>]"
  35. .br
  36. .RE
  37. .SH INTRODUCTION
  38. .P
  39. This page documents the BadVPN server, which is used in a BadVPN VPN network by peers to
  40. talk to each other in order to establish data connections. For a general description of
  41. BadVPN, see
  42. .BR badvpn (7).
  43. .SH DESCRIPTION
  44. .P
  45. The BadVPN server is a chat server used by nodes in the VPN network to talk to each other
  46. in order to establish data connections. Once it initializes, the server only terminates
  47. if a signal is received.
  48. .SH OPTIONS
  49. .P
  50. The BadVPN server is configured entirely from command line.
  51. .TP
  52. .BR --help
  53. Print version and command line syntax and exit.
  54. .TP
  55. .BR --version
  56. Print version and exit.
  57. .TP
  58. .BR --logger " <stdout/syslog>"
  59. Select where to log messages. Default is stdout. Syslog is not available on Windows.
  60. .TP
  61. .BR --syslog-facility " <string>"
  62. When logging to syslog, set the logging facility. The facility name must be in lower case.
  63. .TP
  64. .BR --syslog-ident " <string>"
  65. When logging to syslog, set the ident.
  66. .TP
  67. .BR --loglevel " <0-5/none/error/warning/notice/info/debug>"
  68. Set the default logging level.
  69. .TP
  70. .BR --channel-loglevel " <channel-name> <0-5/none/error/warning/notice/info/debug>"
  71. Set the logging level for a specific logging channel.
  72. .TP
  73. .BR --listen-addr " <addr>"
  74. Add an address for the server to listen on. See below for address format.
  75. .TP
  76. .BR --ssl
  77. Use TLS. Requires --nssdb and --server-cert-name.
  78. .TP
  79. .BR --nssdb " <string>"
  80. When using TLS, the NSS database to use. Probably something like sql:/some/folder.
  81. .TP
  82. .BR --server-cert-name " <string>"
  83. When using TLS, the name of the certificate to use. The certificate must be readily accessible.
  84. .TP
  85. .BR --comm-predicate " <string>"
  86. Set a predicate to define which pairs of clients are allowed to commnicate. The predicate is a
  87. logical expression; see below for details. Available functions:
  88. .br
  89. .BR p1name "(string)"
  90. - true if the TLS common name of peer 1 equals the given string. If TLS is not used, the common
  91. name is assumed to be an empty string.
  92. .br
  93. .BR p1addr "(string)"
  94. - true if the IP address of peer 1 equals the given string. The string must not be a name.
  95. .br
  96. .BR p2name "(string)"
  97. - true if the TLS common name of peer 2 equals the given string. If TLS is not used, the common
  98. name is assumed to be an empty string.
  99. .br
  100. .BR p2addr "(string)"
  101. - true if the IP address of peer 2 equals the given string. The string must not be a name.
  102. .br
  103. There is no rule as to which is peer 1 and which peer 2. When the server needs to determine
  104. whether to allow two peers to communicate, it evaluates the predicate once and in no specific order.
  105. .TP
  106. .BR --relay-predicate " <string>"
  107. Set a predicate to define how peers can relay data through other peers. The predicate is a
  108. logical expression; see below for details. If the predicate evaluates to true, peer P can relay data
  109. through peer R. Available functions:
  110. .br
  111. .BR pname "(string)"
  112. - true if the TLS common name of peer P peer equals the given string. If TLS is not used, the common
  113. name is assumed to be an empty string.
  114. .br
  115. .BR paddr "(string)"
  116. - true if the IP address of peer P equals the given string. The string must not be a name.
  117. .br
  118. .BR rname "(string)"
  119. - true if the TLS common name of peer R peer equals the given string. If TLS is not used, the common
  120. name is assumed to be an empty string.
  121. .br
  122. .BR raddr "(string)"
  123. - true if the IP address of peer R equals the given string. The string must not be a name.
  124. .br
  125. .SH "EXIT CODE"
  126. .P
  127. If initialization fails, exits with code 1. Otherwise runs until termination is requested and exits with code 1.
  128. .SH "ADDRESS FORMAT"
  129. .P
  130. Addresses have the form ipaddr:port, where ipaddr is either an IPv4 address (name or numeric), or an
  131. IPv6 address enclosed in brackets [] (name or numeric again).
  132. .SH PREDICATES
  133. .P
  134. The BadVPN server includes a small predicate language used to define certain policies.
  135. Syntax and semantics of the language are described here.
  136. .TP
  137. .BR true
  138. Logical true constant. Evaluates to 1.
  139. .TP
  140. .BR false
  141. Logical false constant. Evaluates to 0.
  142. .TP
  143. .BR NOT " expression"
  144. Logical negation. If the expression evaluates to error, the
  145. negation evaluates to error.
  146. .TP
  147. .RB "expression " OR " expression"
  148. Logical disjunction. The second expression is only evaluated
  149. if the first expression evaluates to false. If a sub-expression
  150. evaluates to error, the disjunction evaluates to error.
  151. .TP
  152. .RB "expression " AND " expression"
  153. Logical conjunction. The second expression is only evaluated
  154. if the first expression evaluates to true. If a sub-expression
  155. evaluates to error, the conjunction evaluates to error.
  156. .TP
  157. .RB function "(" "arg" "," " ..." "," " arg" ")"
  158. Evaluation of a user-provided function (function is the name of the
  159. function, [a-zA-Z0-9_]+).
  160. If the function with the given name does not exist, it evaluates to
  161. error.
  162. Arguments are evaluated from left to right. Each argument can either
  163. be a logical expression or a string (characters enclosed in double
  164. quotes, without any double quote).
  165. If an argument is encountered, but all needed arguments have already
  166. been evaluated, the function evaluates to error.
  167. If an argument is of wrong type, it is not evaluated and the function
  168. evaluates to error.
  169. If an argument evaluates to error, the function evaluates to error.
  170. If after all arguments have been evaluated, the function needs more
  171. arguments, it evaluates to error.
  172. Then the handler function is called. If it returns anything other
  173. than 1 and 0, the function evaluates to error. Otherwise it evaluates
  174. to what the handler function returned.
  175. .SH "EXAMPLES"
  176. .P
  177. For examples of using BadVPN, see
  178. .BR badvpn (7).
  179. .SH "SEE ALSO"
  180. .BR badvpn-client (8),
  181. .BR badvpn (7)
  182. .SH COPYRIGHT
  183. Copyright (C) 2010 Ambroz Bizjak. BadVPN is free software; you can redistribute it and/or
  184. modify it under the terms of the GNU General Public License version 2 as published by the
  185. Free Software Foundation.
  186. .SH AUTHORS
  187. Ambroz Bizjak <ambrop7@gmail.com>