1 .\" Copyright (c) 2021 Omar Polo <op@omarpolo.com>
3 .\" Permission to use, copy, modify, and distribute this software for any
4 .\" purpose with or without fee is hereby granted, provided that the above
5 .\" copyright notice and this permission notice appear in all copies.
7 .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
8 .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
9 .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
10 .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
11 .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
12 .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
13 .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15 .Dd $Mdocdate: December 14 2021 $
20 .Nd 9p file server daemon configuration file
23 is the configuration file for the 9p file server daemon
26 The format of the configuration file is fairly flexible.
27 The current line can be extended over multiple lines using a backslash
29 Comments can be put anywhere in the file using a hash mark
31 and extend to the end of the current line.
32 Care should be taken when commenting out multi-line text: the comment is
33 effective until the end of the entire block.
34 Arguments names not beginning with a letter, digit, or underscore, as
35 well as reserved words
42 Arguments containing whitespace should be surrounded by double quotes
45 Macros can be defined that are later expanded in context.
46 Macro names must start with a letter, digit, or underscore, and may
47 contain any of those characters, but may not be reserved words.
48 Macros are not expanded inside quotes.
50 .Bd -literal -offset indent
51 lan_addr = "192.168.0.1"
52 listen on $lan_addr prot 5640 tls auth <users>
55 Additional configuration files can be included with the
58 .Bd -literal -offset indent
59 include "/etc/kamid.conf.local"
66 .It Ic listen Op Ar options...
67 The options are as follows:
69 .It Ic on Ar address Ic port Ar number
72 for incoming connection on the given port
75 can be an IP address or a domain name.
76 .It Ic tls Ic pki Ar name
77 Use the tls certificate
79 previously defined with the
82 .It Ic auth Pf < Ar table Ns >
83 Use the given authentication
85 to authorize the clients.
86 .It Ic userdata Pf < Ar table Ns >
89 to their exported tree.
90 By default the user home directory obtained with
93 .It Ic virtual Pf < Ar table Ns >
94 Maps virtual users to local user.
96 .It Ic pki Ar pkiname Ic cert Ar certfile
97 Associate certificate file
101 The pki entry defines a keypair configuration that can be referenced in
103 .It Ic pki Ar pkiname Ic key Ar keyfile
104 Associate the key located in
108 .\" TODO: document the other syntax for the table
109 .It Ic table Ar name Brq Ar value Cm => Ar value Oo , Ar ... Oc
110 Tables provide additional configuration information for
112 in the form of key-value mappings.
114 Declare a mapping table containing the given static
115 .Ar key Ns Pf - Ar value
119 A sample configuration file:
120 .Bd -literal -offset indent
121 pki localhost cert "/etc/ssl/localhost.crt"
122 pki localhost key "/etc/ssl/private/localhost.key"
124 table users { "SHA256:..." => "op" }
126 listen on localhost port 5640 tls pki localhost auth <users>