Change raddbdir to confdir for consistency.
[freeradius.git] / raddb / experimental.conf
1 #
2 #  This file contains the configuration for experimental modules.
3 #
4 #  By default, it is NOT included in the build.
5 #
6 #  $Id$
7 #
8
9         # Configuration for the Python module.
10         #
11         # Where radiusd is a Python module, radiusd.py, and the
12         # function 'authorize' is called.  Here is a dummy piece
13         # of code:
14         # 
15         #       def authorize(params):
16         #           print params
17         #           return (5, ('Reply-Message', 'banned'))
18         #
19         # The RADIUS value-pairs are passed as a tuple of tuple
20         # pairs as the first argument, e.g. (('attribute1',
21         # 'value1'), ('attribute2', 'value2'))
22         #
23         # The function return is a tuple with the first element
24         # being the return value of the function.
25         # The 5 corresponds to RLM_MODULE_USERLOCK. I plan to
26         # write the return values as Python symbols to avoid
27         # confusion.
28         #
29         # The remaining tuple members are the string form of
30         # value-pairs which are passed on to pairmake().
31         #
32         python {
33                 mod_instantiate = radiusd_test
34                 func_instantiate = instantiate
35
36                 mod_authorize = radiusd_test
37                 func_authorize = authorize
38
39                 mod_accounting = radiusd_test
40                 func_accounting = accounting
41
42                 mod_preacct = radiusd_test
43                 func_preacct = preacct
44
45                 mod_detach = radiusd_test
46                 func_detach = detach
47         }
48
49         
50         # Configuration for the example module.  Uncommenting it will cause it
51         # to get loaded and initialized, but should have no real effect as long
52         # it is not referencened in one of the autz/auth/preacct/acct sections
53         example {
54                 #  Boolean variable.
55                 # allowed values: {no, yes}
56                 boolean = yes
57
58                 #  An integer, of any value.
59                 integer = 16
60
61                 #  A string.
62                 string = "This is an example configuration string"
63
64                 # An IP address, either in dotted quad (1.2.3.4) or hostname
65                 # (example.com)
66                 ipaddr = 127.0.0.1
67
68                 # A subsection
69                 mysubsection {
70                         anotherinteger = 1000
71                         # They nest
72                         deeply nested {
73                                 string = "This is a different string"
74                         }
75                 }
76         }
77
78         #
79         #  To create a dbm users file, do:
80         #
81         #   cat test.users | rlm_dbm_parser -f /etc/raddb/users_db
82         #
83         #  Then add 'dbm' in 'authorize' section.
84         #
85         #  Note that even if the file has a ".db" or ".dbm" extension,
86         #  you may have to specify it here without that extension.  This
87         #  is because the DBM libraries "helpfully" add a ".db" to the
88         #  filename, but don't check if it's already there.
89         #
90         dbm {
91                 usersfile = ${confdir}/users_db
92         }
93
94         #
95         #  Persistent, embedded Perl interpreter.
96         #
97         perl {
98                 #
99                 #  The Perl script to execute on authorize, authenticate,
100                 #  accounting, xlat, etc.  This is very similar to using
101                 #  'rlm_exec' module, but it is persistent, and therefore
102                 #  faster.
103                 #
104                 module = /path/to/your/perl_module.pm
105
106                 #
107                 #  The following hashes are given to the module and
108                 #  filled with value-pairs (Attribute names and values)
109                 #
110                 #  %RAD_CHECK           Read-only       Check items
111                 #  %RAD_REQUEST         Read-only       Attributes from the request
112                 #  %RAD_REPLY           Read-write      Attributes for the reply
113                 # 
114                 #  The return codes from functions in the perl_script
115                 #  are passed directly back to the server.  These
116                 #  codes are defined in doc/configurable_failover,
117                 #  src/include/modules.h (RLM_MODULE_REJECT, etc),
118                 #  and are pre-defined in the 'example.pl' program
119                 #  which is included.
120                 #               
121
122                 #
123                 #  List of functions in the module to call.
124                 #  Uncomment and change if you want to use function
125                 #  names other than the defaults.
126                 #
127                 #func_authenticate = authenticate
128                 #func_authorize = authorize
129                 #func_preacct = preacct
130                 #func_accounting = accounting
131                 #func_checksimul = checksimul
132                 #func_pre_proxy = pre_proxy
133                 #func_post_proxy = post_proxy
134                 #func_post_auth = post_auth
135                 #func_xlat = xlat
136                 #func_detach = detach
137
138                 #
139                 #  Uncomment the following lines if you wish
140                 #  to use separate functions for Start and Stop
141                 #  accounting packets. In that case, the 
142                 #  func_accounting function is not called.
143                 #
144                 #func_start_accounting = accounting_start
145                 #func_stop_accounting = accounting_stop
146                 
147                 #  Uncomment the following lines if your perl is 
148                 #  compiled with threads support.
149                 #  The settings below are the defaults.
150                 #
151                 #max_clones = 32
152                 #start_clones = 32
153                 #min_spare_clones = 0
154                 #max_spare_clones = 32
155                 #cleanup_delay = 5
156                 #max_request_per_clone = 0
157
158         }
159
160         #
161         #  Perform NT-Domain authentication.  This only works
162         #  with PAP authentication.  That is, Authentication-Request
163         #  packets containing a User-Password attribute.
164         #
165         #  To use it, add 'smb' into the 'authenticate' section,
166         #  and then in another module (usually the 'users' file),
167         #  set 'Auth-Type := SMB'
168         #
169         #  WARNING: this module is not only experimental, it's also
170         #  a security threat. It's not recommended to use it until
171         #  it gets fixed.
172         #
173         smb {
174                 server = ntdomain.server.example.com
175                 backup = backup.server.example.com
176                 domain = NTDOMAIN
177         }
178
179         # See doc/rlm_fastusers before using this
180         # module or changing these values.
181         #
182         fastusers {
183                 usersfile = ${confdir}/users_fast
184                 hashsize = 1000
185                 compat = no
186                 # Reload the hash every 600 seconds (10mins)
187                 hash_reload = 600
188         }
189
190         # Caching module
191         #
192         # Should be added in the post-auth section (after all other modules)
193         # and in the authorize section (before any other modules)
194         #
195         # authorize {
196         #       caching {
197         #               ok = return
198         #       }
199         #       [... other modules ...]
200         # }
201         # post-auth {
202         #       [... other modules ...]
203         #       caching
204         # }
205         #
206         # The caching module will cache the Auth-Type and reply items
207         # and send them back on any subsequent requests for the same key
208         #
209         # Configuration:
210         #
211         # filename: The gdbm file to use for the cache database
212         #               (can be memory mapped for more speed)
213         #
214         # key: A string to xlat and use as a key. For instance,
215         #       "%{Acct-Unique-Session-Id}"
216         #
217         # post-auth: If we find a cached entry, set the post-auth to that value
218         #
219         # cache-ttl: The time to cache the entry. The same time format
220         #               as the counter module apply here.
221         #         num[hdwm] where:
222         #       h: hours, d: days, w: weeks, m: months
223         #       If the letter is ommited days will be assumed.
224         #       e.g. 1d == one day
225         #
226         # cache-size: The gdbm cache size to request (default 1000)
227         #
228         # hit-ratio: If set to non-zero we print out statistical
229         #       information after so many cache requests
230         #
231         # cache-rejects: Do we also cache rejects, or not? (default 'yes')
232         #
233         caching {
234                 filename = ${confdir}/db.cache
235                 cache-ttl = 1d
236                 hit-ratio = 1000
237                 key = "%{Acct-Unique-Session-Id}"
238                 #post-auth = ""
239                 # cache-size = 2000
240                 # cache-rejects = yes
241         }
242
243
244         # Simple module for logging of Account packets to radiusd.log
245         # You need to declare it in the accounting section for it to work
246         acctlog {
247                 acctlog_update = ""
248                 acctlog_start = "Connect: [%{User-Name}] (did %{Called-Station-Id} cli %{Calling-Station-Id} port %{NAS-Port} ip %{Framed-IP-Address})"
249                 acctlog_stop = "Disconnect: [%{User-Name}] (did %{Called-Station-Id} cli %{Calling-Station-Id} port %{NAS-Port} ip %{Framed-IP-Address}) %{Acct-Session-Time} seconds"
250                 acctlog_on = "NAS %C (%{NAS-IP-Address}) just came online"
251                 acctlog_off = "NAS %C (%{NAS-IP-Address}) just went offline"
252         }