Move debug warning from setup to load
[mudpy.git] / doc / source / configuration.rst
1 ===============
2  configuration
3 ===============
4
5 .. Copyright (c) 2004-2020 mudpy authors. Permission to use, copy,
6    modify, and distribute this software is granted under terms
7    provided in the LICENSE file distributed with this software.
8
9 .mudpy.filing
10 -------------
11
12 .mudpy.filing.groups
13 ~~~~~~~~~~~~~~~~~~~~
14
15 dict, optional
16
17 Each item in the dict identifies options for the default backing
18 file of the group named in its key. The value is itself a dict with
19 its keys and values corresponding to those options (for now, only
20 ``flags`` is implemented, with a value of ``private`` indicating it
21 should be readable only by the system user under which the mudpy
22 process is running).
23
24 Example::
25
26   .mudpy.filing.groups:
27       account:
28           flags:
29               - private
30
31 .mudpy.filing.prefix
32 ~~~~~~~~~~~~~~~~~~~~
33
34 string, optional
35
36 This is the root path beneath which all relative file references,
37 including directories comprising the search path, are assumed to be
38 found. The default value of ``.`` indicates the current working
39 directory at the time the service was initially started.
40
41 Example::
42
43   .mudpy.filing.prefix: .
44
45 .mudpy.filing.search
46 ~~~~~~~~~~~~~~~~~~~~
47
48 list, required
49
50 Directories to search for expected data files. If not a fully
51 canonical path, this is assumed to be relative to the ``prefix``.
52
53 Example::
54
55   .mudpy.filing.search:
56       - ""
57       - etc
58       - share
59       - data
60
61 .mudpy.filing.stash
62 ~~~~~~~~~~~~~~~~~~~
63
64 string, required
65
66 This is the default directory where new data files will be written
67 if their full paths are not specified and they aren't already found
68 in the ``search`` list. If not a fully canonical path, this is
69 assumed to be relative to the ``prefix``.
70
71 Example::
72
73   .mudpy.filing.stash: data
74
75 .mudpy.linguistic
76 -----------------
77
78 .mudpy.linguistic.actions
79 ~~~~~~~~~~~~~~~~~~~~~~~~~
80
81 dict, optional
82
83 This is used to tailor the appearance of output generated by the
84 ``say`` command and its relatives, so as to add some readability and
85 flavor. It matches a visible action to punctuation (ask, exclaim, et
86 cetera).
87
88 Example::
89
90   .mudpy.linguistic.actions:
91       ?: ask
92       ",": begin
93       -: begin
94       :: begin
95       ;: begin
96       "!": exclaim
97       ...: muse
98       .: say
99
100 .mudpy.linguistic.default_punctuation
101 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
102
103 string, optional
104
105 Unpunctuated statements made by actors should be assumed to
106 terminate with this value.
107
108 Example::
109
110   .mudpy.linguistic.default_punctuation: .
111
112 .mudpy.linguistic.typos
113 ~~~~~~~~~~~~~~~~~~~~~~~
114
115 dict, optional
116
117 Replacements for common typographical and capitalization errors.
118
119 Example::
120
121   .mudpy.linguistic.typos:
122       i: I
123       i'd: I'd
124       i'll: I'll
125       i'm: I'm
126       teh: the
127       theyre: they're
128       youre: you're
129
130 .mudpy.limit
131 ------------
132
133 .mudpy.limit.admins
134 ~~~~~~~~~~~~~~~~~~~
135
136 list, optional
137
138 The first users to create accounts with names in this list will
139 automatically be given full administrative privileges.
140
141 Example::
142
143   .mudpy.limit.admins:
144       - admin
145
146 .mudpy.limit.avatars
147 ~~~~~~~~~~~~~~~~~~~~
148
149 int, required
150
151 This is the maximum number of avatars allowed for each account.
152
153 Example::
154
155   .mudpy.limit.avatars: 7
156
157 .mudpy.limit.backups
158 ~~~~~~~~~~~~~~~~~~~~
159
160 int, optional
161
162 This is the number of backups to keep and rotate when overwriting
163 data files. If unspecified or set to 0, no backup copies will be
164 made.
165
166 Example::
167
168   .mudpy.limit.backups: 10
169
170 .mudpy.limit.debug
171 ~~~~~~~~~~~~~~~~~~
172
173 bool, optional
174
175 Whether unsafe debugging functionality is enabled. If unspecified or
176 set to false, unsafe debugging functions will be disabled. Be very
177 careful enabling this feature, as debugging commands may allow service
178 administrators to run arbitrary shell commands or modify files
179 accessible to the system user under which the service is running.
180
181 Example::
182
183   .mudpy.limit.debug: true
184
185 .mudpy.limit.password_tries
186 ~~~~~~~~~~~~~~~~~~~~~~~~~~~
187
188 int, required
189
190 This is the maximum number of password failures allowed during the
191 login process. Once exceeded, the user will be disconnected.
192
193 Example::
194
195   .mudpy.limit.password_tries: 3
196
197 .mudpy.log
198 ----------
199
200 .mudpy.log.file
201 ~~~~~~~~~~~~~~~
202
203 string, optional
204
205 If set, log messages will be recorded to this file.
206
207 Example::
208
209   .mudpy.log.file: var/mudpy.log
210
211 .mudpy.log.lines
212 ~~~~~~~~~~~~~~~~
213
214 int, optional
215
216 Number of log entries to keep in memory (the oldest are
217 discarded)... If unset or 0, none will be written to mudpy's
218 internal memory.
219
220 Example::
221
222   .mudpy.log.lines: 1000
223
224 .mudpy.log.stdout
225 ~~~~~~~~~~~~~~~~~
226
227 bool, optional
228
229 If set to ``yes``, messages will be logged to the standard output of
230 the mudpy process. If unspecified, the default is ``no``.
231
232 Example::
233
234   .mudpy.log.stdout: true
235
236 .mudpy.log.syslog
237 ~~~~~~~~~~~~~~~~~
238
239 string, optional
240
241 If set, mudpy will send messages to the system log, and under the
242 name specified by this value (Unix derivatives only).
243
244 Example::
245
246   .mudpy.log.syslog: mudpy
247
248 .mudpy.movement
249 ---------------
250
251 .mudpy.movement.*.enter_term
252 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
253
254 string, multiple
255
256 Word or words describing the direction from where you are seen to
257 enter the next room when moving.
258
259 Example::
260
261   .mudpy.movement.down.enter_term: above
262   .mudpy.movement.east.enter_term: the west
263   .mudpy.movement.north.enter_term: the south
264   .mudpy.movement.south.enter_term: the north
265   .mudpy.movement.up.enter_term: below
266   .mudpy.movement.west.enter_term: the east
267
268 .mudpy.movement.*.exit_term
269 ~~~~~~~~~~~~~~~~~~~~~~~~~~~
270
271 string, multiple
272
273 Word or words describing the direction where you are seen to exit
274 the current room when moving.
275
276 Example::
277
278   .mudpy.movement.down.exit_term: downward
279   .mudpy.movement.east.exit_term: to the east
280   .mudpy.movement.north.exit_term: to the north
281   .mudpy.movement.south.exit_term: to the south
282   .mudpy.movement.up.exit_term: upward
283   .mudpy.movement.west.exit_term: to the west
284
285 .mudpy.movement.*.vector
286 ~~~~~~~~~~~~~~~~~~~~~~~~
287
288 triplet, multiple
289
290 Vector of signed integer units for use in vector addition to derive
291 the destination coordinates from the current coordinates when moving
292 through a gridlink exit. The example coordinate system used is left
293 handed (east, north and up are positive, west, south and down are
294 negative) and three-dimensional with a tuple component order of
295 (longitude, latitude, altitude).
296
297 Example::
298
299   .mudpy.movement.down.vector: [0, 0, -1]
300   .mudpy.movement.east.vector: [1, 0, 0]
301   .mudpy.movement.north.vector: [0, 1, 0]
302   .mudpy.movement.south.vector: [0, -1, 0]
303   .mudpy.movement.up.vector: [0, 0, 1]
304   .mudpy.movement.west.vector: [-1, 0, 0]
305
306 .mudpy.network
307 --------------
308
309 .mudpy.network.host
310 ~~~~~~~~~~~~~~~~~~~
311
312 string, optional
313
314 The IP address on which to listen. If unspecified, the default is
315 all available addresses.
316
317 Example::
318
319   .mudpy.network.host: ::1
320
321 .mudpy.network.port
322 ~~~~~~~~~~~~~~~~~~~
323
324 int, required
325
326 The TCP port on which to listen.
327
328 Example::
329
330   .mudpy.network.port: 4000
331
332 .mudpy.process
333 --------------
334
335 .mudpy.process.daemon
336 ~~~~~~~~~~~~~~~~~~~~~
337
338 bool, optional
339
340 If set to ``yes``, mudpy will immediately fork and detach a child to
341 become a daemon process, then close all open file descriptors and
342 terminate the parent process (Unix derivatives only). The default
343 value is ``no``.
344
345 Example::
346
347   .mudpy.process.daemon: true
348
349 .mudpy.process.pidfile
350 ~~~~~~~~~~~~~~~~~~~~~~
351
352 string, optional
353
354 If set, this filename will contain the daemon's process ID (Unix
355 derivatives only).
356
357 Example::
358
359   .mudpy.process.pidfile: var/mudpy.pid
360
361 .mudpy.timing
362 -------------
363
364 .mudpy.timing.idle.disconnect.*
365 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
366
367 int, multiple
368
369 This value indicates the number of increments allowed to pass
370 without input on a socket connection before it is terminated. This
371 avoids accumulation of dead sockets which could otherwise max out
372 allowed file descriptors. The differentiators are either ``default``
373 or a state name used to override the default value for that specific
374 state (``active``, ``entering_account_name``, et cetera).
375
376 Example::
377
378   .mudpy.timing.idle.disconnect.active: 6048000
379   .mudpy.timing.idle.disconnect.default: 6000
380   .mudpy.timing.idle.disconnect.entering_account_name: 600
381
382 .mudpy.timing.idle.warn.*
383 ~~~~~~~~~~~~~~~~~~~~~~~~~
384
385 int, multiple
386
387 This value indicates the number of increments allowed to pass
388 without input on a socket connection before it is warned that
389 termination is imminent. The differentiators are either
390 ``default`` or a state name used to override the default value
391 for that specific state. It is recommended that this be less than
392 the corresponding ``.mudpy.timing.idle.disconnect.*`` value.
393
394 Example::
395
396   .mudpy.timing.idle.warn.active: 5040000
397   .mudpy.timing.idle.warn.default: 5000
398   .mudpy.timing.idle.warn.entering_account_name: 500
399
400 .mudpy.timing.increment
401 ~~~~~~~~~~~~~~~~~~~~~~~
402
403 float, required
404
405 This value indicates the number of real system clock seconds (or
406 more commonly, fraction thereof) each pass through the main loop is
407 intended to take. This roughly sets the frequency with which queued
408 socket I/O operations are performed, pending events are triggered,
409 and directly impacts the speed at which virtual time passes within
410 the simulation.
411
412 Example::
413
414   .mudpy.timing.increment: 0.1
415
416 .mudpy.timing.save
417 ~~~~~~~~~~~~~~~~~~
418
419 int, required
420
421 Number of increments between updates of changed persistent data
422 storage.
423
424 Example::
425
426   .mudpy.timing.save: 600
427
428 .mudpy.timing.status
429 ~~~~~~~~~~~~~~~~~~~~
430
431 int, optional
432
433 Number of increments to wait between logging mudpy status messages.
434 If unspecified or set to 0, no mudpy status messages will be
435 written.
436
437 Example::
438
439   .mudpy.timing.status: 6000
440
441 .mudpy.user
442 -----------
443
444 .mudpy.user.pref_admin
445 ~~~~~~~~~~~~~~~~~~~~~~
446
447 list, optional
448
449 This can be used to list facets an administrative user is allowed to
450 set or override on their own ``account`` element, in addition to any
451 in the `.mudpy.user.pref_allow`_ list. Note that this is merely a
452 convenience, as an administrator is already able to call the ``set``
453 command to set values for facets of any element.
454
455 Example::
456
457   .mudpy.user.pref_admin:
458       - loglevel
459
460 .mudpy.user.pref_allow
461 ~~~~~~~~~~~~~~~~~~~~~~
462
463 list, optional
464
465 This can be used to list facets any user is allowed to set or
466 override on their own ``account`` element with the ``preference``
467 command.
468
469 Example::
470
471   .mudpy.user.pref_allow:
472       - prompt