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"
53 listen on $lan_addr tls auth <users>
56 Additional configuration files can be included with the
59 .Bd -literal -offset indent
60 include "/etc/kamid.conf.local"
67 .It Ic listen Op Ar options...
68 The options are as follows:
70 .It Ic on Ar address Ic port Ar number
73 for incoming connection on the given port
76 can be an IP address or a domain name.
77 .It Ic tls Ic pki Ar name
78 Use the tls certificate
80 previously defined with the
83 .It Ic auth Pf < Ar table Ns >
84 Use the given authentication
86 to authorize the clients.
87 .It Ic userdata Pf < Ar table Ns >
90 to their exported tree.
91 By default the user home directory obtained with
94 .It Ic virtual Pf < Ar table Ns >
95 Maps virtual users to local user.
97 .It Ic pki Ar pkiname Ic cert Ar certfile
98 Associate certificate file
102 The pki entry defines a keypair configuration that can be referenced in
104 .It Ic pki Ar pkiname Ic key Ar keyfile
105 Associate the key located in
109 .\" TODO: document the other syntax for the table
110 .It Ic table Ar name Brq Ar value Cm => Ar value Oo , Ar ... Oc
111 Tables provide additional configuration information for
113 in the form of key-value mappings.
115 Declare a mapping table containing the given static
116 .Ar key Ns Pf - Ar value
120 A sample configuration file:
121 .Bd -literal -offset indent
122 pki localhost cert "/etc/ssl/localhost.crt"
123 pki localhost key "/etc/ssl/private/localhost.key"
125 table users { "SHA256:..." => "op" }
127 listen on localhost port 1337 tls pki localhost auth <users>