Blob


1 .\" Copyright (c) 2021 Omar Polo <op@omarpolo.com>
2 .\"
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.
6 .\"
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.
14 .\"
15 .Dd $Mdocdate: December 14 2021 $
16 .Dt KAMID.CONF 5
17 .Os
18 .Sh NAME
19 .Nm kamid.conf
20 .Nd 9p file server daemon configuration file
21 .Sh DESCRIPTION
22 .Nm
23 is the configuration file for the 9p file server daemon
24 .Xr kamid 8 .
25 .Pp
26 The format of the configuration file is fairly flexible.
27 The current line can be extended over multiple lines using a backslash
28 .Pq Sq \e .
29 Comments can be put anywhere in the file using a hash mark
30 .Pq Sq # ,
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
36 (such as
37 .Ic listen ,
38 .Ic pki
39 and
40 .Ic table )
41 must be quoted.
42 Arguments containing whitespace should be surrounded by double quotes
43 .Pq \&" .
44 .Pp
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.
49 For example:
50 .Bd -literal -offset indent
51 lan_addr = "192.168.0.1"
52 listen on $lan_addr
53 listen on $lan_addr tls auth <users>
54 .Ed
55 .Pp
56 Additional configuration files can be included with the
57 .Ic include
58 keyword, for example:
59 .Bd -literal -offset indent
60 include "/etc/kamid.conf.local"
61 .Ed
62 .Pp
63 The syntax of
64 .Nm
65 is described below.
66 .Bl -tag -width Ds
67 .It Ic listen Op Ar options...
68 The options are as follows:
69 .Bl -tag -width Ds
70 .It Ic on Ar address Ic port Ar number
71 Listen on the
72 .Ar address
73 for incoming connection on the given port
74 .Ar number .
75 .Ar address
76 can be an IP address or a domain name.
77 .It Ic tls Ic pki Ar name
78 Use the tls certificate
79 .Ar name
80 previously defined with the
81 .Ic pki
82 rule.
83 .It Ic auth Pf < Ar table Ns >
84 Use the given authentication
85 .Ar table
86 to authorize the clients.
87 .El
88 .It Ic pki Ar pkiname Ic cert Ar certfile
89 Associate certificate file
90 .Ar certfile
91 with pki entry
92 .Ar pkiname .
93 The pki entry defines a keypair configuration that can be referenced in
94 listener rules.
95 .It Ic pki Ar pkiname Ic key Ar keyfile
96 Associate the key located in
97 .Ar keyfile
98 with pki entry
99 .Ar pkiname .
100 .\" TODO: document the other syntax for the table
101 .It Ic table Ar name Brq Ar value Cm => Ar value Oo , Ar ... Oc
102 Tables provide additional configuration information for
103 .Xr kamid 8
104 in the form of key-value mappings.
105 .Pp
106 Declare a mapping table containing the given static
107 .Ar key Ns Pf - Ar value
108 pairs.
109 .El
110 .Sh EXAMPLES
111 A sample configuration file:
112 .Bd -literal -offset indent
113 pki localhost cert "/etc/ssl/localhost.crt"
114 pki localhost key "/etc/ssl/private/localhost.key"
116 table users { "SHA256:..." => "op" }
118 listen on localhost port 1337 tls pki localhost auth <users>
119 .Ed
120 .Sh SEE ALSO
121 .Xr kamictl 8 ,
122 .Xr kamid 8