chiark / gitweb /
Add New back to web interface (oops)
[disorder] / doc / disorder_config.5.in
1 .\"
2 .\" Copyright (C) 2004-2008 Richard Kettlewell
3 .\"
4 .\" This program is free software; you can redistribute it and/or modify
5 .\" it under the terms of the GNU General Public License as published by
6 .\" the Free Software Foundation; either version 2 of the License, or
7 .\" (at your option) any later version.
8 .\"
9 .\" This program is distributed in the hope that it will be useful, but
10 .\" WITHOUT ANY WARRANTY; without even the implied warranty of
11 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12 .\" General Public License for more details.
13 .\"
14 .\" You should have received a copy of the GNU General Public License
15 .\" along with this program; if not, write to the Free Software
16 .\" Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
17 .\" USA
18 .\"
19 .TH disorder_config 5
20 .SH NAME
21 pkgconfdir/config - DisOrder jukebox configuration
22 .SH DESCRIPTION
23 The purpose of DisOrder is to organize and play digital audio files, under the
24 control of multiple users.
25 \fIpkgconfdir/config\fR is the primary configuration file but this
26 man page currently documents all of its various configuration files.
27 .SS Tracks
28 DisOrder can be configured with multiple collections of tracks, indexing them
29 by their filename, and picking players on the basis of filename patterns (for
30 instance, "*.mp3").
31 .PP
32 Although the model is of filenames, it is not inherent that there are
33 corresponding real files - merely that they can be interpreted by the chosen
34 player.
35 See \fBdisorder\fR(3) for more details about this.
36 .PP
37 Each track can have a set of preferences associated with it.
38 These are simple key-value pairs; they can be used for anything you
39 like, but a number of keys have specific meanings.
40 See \fBdisorder\fR(1) for more details about these.
41 .SS "Track Names"
42 Track names are derived from filenames under the control of regular
43 expressions, rather than attempting to interpret format-specific embedded name
44 information.
45 They can be overridden by setting preferences.
46 .PP
47 Names for display are distinguished from names for sorting, so with the right
48 underlying filenames an album can be displayed in its original order even if
49 the displayed track titles are not lexically sorted.
50 .SS "Server State"
51 A collection of global preferences define various bits of server state: whether
52 random play is enabled, what tags to check for when picking at random, etc.
53 .SS "Users And Access Control"
54 DisOrder distinguishes between multiple users.
55 This is for access control and reporting, not to provide different
56 views of the world: i.e. preferences and so on are global.
57 .PP
58 Each user has an associated set of rights which contorl which commands they may
59 execute.
60 Normally you would give all users most rights, and expect them to
61 cooperate (they are after all presumed to be in a shared sound environment).
62 .PP
63 The full set of rights are:
64 .TP
65 .B read
66 User can perform read-only operations
67 .TP
68 .B play
69 User can add tracks to the queue
70 .TP
71 .B "move any"
72 User can move any track
73 .TP
74 .B "move mine"
75 User can move their own tracks
76 .TP
77 .B "move random"
78 User can move randomly chosen tracks
79 .TP
80 .B "remove any"
81 User can remove any track
82 .TP
83 .B "remove mine"
84 User can remove their own tracks
85 .TP
86 .B "remove random"
87 User can remove randomly chosen tracks
88 .TP
89 .B "scratch any"
90 User can scratch any track
91 .TP
92 .B "scratch mine"
93 User can scratch their own tracks
94 .TP
95 .B "scratch random"
96 User can scratch randomly chosen tracks
97 .TP
98 .B volume
99 User can change the volume
100 .TP
101 .B admin
102 User can perform admin operations
103 .TP
104 .B rescan
105 User can initiate a rescan
106 .TP
107 .B register
108 User can register new users.
109 Normally only the
110 .B guest
111 user would have this right.
112 .TP
113 .B userinfo
114 User can edit their own userinfo
115 .TP
116 .B prefs
117 User can modify track preferences
118 .TP
119 .B "global prefs"
120 User can modify global preferences
121 .TP
122 .B pause
123 User can pause/resume 
124 .PP
125 Access control is entirely used-based.
126 If you configure DisOrder to listen for TCP/IP connections then it will
127 accept a connection from anywhere provided the right password is
128 available.
129 Passwords are never transmitted over TCP/IP connections in clear,
130 but everything else is.
131 The expected model is that host-based access control is imposed at
132 the network layer.
133 .SS "Web Interface"
134 The web interface is controlled by a collection of template files, one for each
135 kind of page, and a collection of option files.
136 These are split up and separate from the main configuration file to
137 make it more convenient to override specific bits.
138 .PP
139 The web interface connects to the DisOrder server like any other user, though
140 it is given a special privilege to "become" any other user.
141 (Thus, any process with the same UID as the web interface is very
142 powerful as far as DisOrder goes.
143 This model will be changed in a future version.)
144 .PP
145 Access control to the web interface is (currently) separate from DisOrder's own
146 access control (HTTP authentication is required) but uses the same user
147 namespace.
148 .PP
149 See \fBdisorder.cgi\fR(8) for more information.
150 .SS "Searching And Tags"
151 Search strings contain a list of search terms separated by spaces.
152 A search term can either be a single word or a tag, prefixed with "tag:".
153 .PP
154 Search words are compared without regard to letter case or accents; thus, all
155 of the following will be considered to be equal to one another:
156 .PP
157 .nf
158   LATIN CAPITAL LETTER E
159   LATIN SMALL LETTER E
160   LATIN CAPITAL LETTER E WITH GRAVE
161   LATIN SMALL LETTER E WITH GRAVE
162   LATIN CAPITAL LETTER E plus COMBINING GRAVE ACCENT
163   LATIN SMALL LETTER E plus COMBINING GRAVE ACCENT
164 .fi
165 .PP
166 The same rules apply to tags but in addition leading and trailing whitespace is
167 disregarded and all whitespace sequences are treated as equal when they appear
168 as internal whitespace.
169 .PP
170 Where several tags are listed, for instance the tags preference for a track,
171 the tags are separated by commas.
172 Therefore tags may not contain commas.
173 .SH "CONFIGURATION FILE"
174 .SS "General Syntax"
175 Lines are split into fields separated by whitespace (space, tab, line
176 feed, carriage return, form feed).
177 Comments are started by the number sign ("#").
178 .PP
179 Fields may be unquoted (in which case they may not contain spaces and
180 may not start with a quotation mark or apostrophe) or quoted by either
181 quotation marks or apostrophes.
182 Inside quoted fields every character stands for itself, except that
183 a backslash can only appear as part of one of the following escape sequences:
184 .TP
185 .B \e\e
186 Backslash
187 .TP
188 .B \e"
189 Quotation mark
190 .\" "
191 .TP
192 .B \e'
193 Apostrophe
194 .TP
195 .B \en
196 Line feed
197 .PP
198 No other escape sequences are allowed.
199 .PP
200 Within any line the first field is a configuration command and any
201 further fields are parameters.
202 Lines with no fields are ignored.
203 .PP
204 After editing the config file use \fBdisorder reconfigure\fR to make
205 it re-read it.
206 If there is anything wrong with it the daemon will record a log
207 message and ignore the new config file.
208 (You should fix it before next terminating and restarting the daemon,
209 as it cannot start up without a valid config file.)
210 .SS "Configuration Files"
211 Configuration files are read in the following order:
212 .TP
213 .I pkgconfdir/config
214 .TP
215 .I pkgconfdir/config.private
216 Should be readable only by the jukebox group.
217 Not really useful any more and will be abolished in future.
218 .TP
219 .I ~\fRUSERNAME\fI/.disorder/passwd
220 Per-user client configuration.
221 Optional but if it exists must be readable only by the relevant user.
222 Would normally contain a \fBpassword\fR directive.
223 .TP
224 .I pkgconfdir/config.\fRUSERNAME
225 Per-user system-controlled client configuration.
226 Optional but if it exists must be readable only by the relevant user.
227 Would normally contain a \fBpassword\fR directive.
228 .IP
229 The prefererred location for per-user passwords is \fI~/.disorder/passwd\fR and
230 \fBdisorder authorize\fR writes there now.
231 .SS "Global Configuration"
232 .TP
233 .B home \fIDIRECTORY\fR
234 The home directory for state files.
235 Defaults to
236 .IR pkgstatedir .
237 The server will create this directory on startup if it does not exist.
238 .TP
239 .B plugins \fIPATH\fR
240 Adds a directory to the plugin path.
241 (This is also used by the web interface.)
242 .IP
243 Plugins are opened the first time they are required and never after,
244 so after changing a plugin you must restart the server before it is
245 guaranteed to take effect.
246 .IP
247 If
248 .B plugins
249 is used without arguments the plugin path is cleared.
250 .SS "Server Configuration"
251 .TP
252 .B alias \fIPATTERN\fR
253 Defines the pattern use construct virtual filenames from \fBtrackname_\fR
254 preferences.
255 .IP
256 Most characters stand for themselves, the exception being \fB{\fR which is used
257 to insert a track name part in the form \fB{\fIname\fB}\fR or
258 \fB{/\fIname\fB}\fR.
259 .IP
260 The difference is that the first form just inserts the name part while the
261 second prefixes it with a \fB/\fR if it is nonempty.
262 .IP
263 The pattern should not attempt to include the collection root, which is
264 automatically included, but should include the proper extension.
265 .IP
266 The default is \fB{/artist}{/album}{/title}{ext}\fR.
267 .TP
268 .B api \fINAME\fR
269 Selects the backend used to play sound and to set the volume.
270 The following options are available:
271 .RS
272 .TP
273 .B alsa
274 Use the ALSA API.
275 This is only available on Linux systems, on which it is the default.
276 .TP
277 .B coreaudio
278 Use Apple Core Audio.
279 This only available on OS X systems, on which it is the default.
280 .TP
281 .B oss
282 Use the OSS (/dev/dsp) API.
283 Not available on all platforms.
284 .TP
285 .B command
286 Execute a command.
287 This is the default if
288 .B speaker_command
289 is specified, or if no native is available.
290 .TP
291 .B network
292 Transmit audio over the network.
293 This is the default if \fBbroadcast\fR is specified.
294 You can use
295 .BR disorder-playrtp (1)
296 to receive and play the resulting stream on Linux and OS X.
297 .RE
298 .TP
299 .B authorization_algorithm \fIALGORITHM\fR
300 Defines the algorithm used to authenticate clients.
301 The valid options are sha1 (the default), sha256, sha384 and sha512.
302 See
303 .BR disorder_protocol (5)
304 for more details.
305 .TP
306 .B broadcast \fIADDRESS\fR \fIPORT\fR
307 Transmit sound data to \fIADDRESS\fR using UDP port \fIPORT\fR.
308 This implies \fBapi network\fR.
309 .IP
310 See also \fBmulticast_loop\fR and \fBmulticast_ttl\fR.
311 .TP
312 .B broadcast_from \fIADDRESS\fR \fIPORT\fR
313 Sets the (local) source address used by \fBbroadcast\fR.
314 .TP
315 .B channel \fICHANNEL\fR
316 The mixer channel that the volume control should use.
317 .IP
318 For \fBapi oss\fR the possible values are:
319 .RS
320 .TP 8
321 .B pcm
322 Output level for the audio device.
323 This is probably what you want and is the default.
324 .TP
325 .B speaker
326 Output level for the PC speaker, if that is connected to the sound card.
327 .TP
328 .B pcm2
329 Output level for alternative codec device.
330 .TP
331 .B vol
332 Master output level.
333 The OSS documentation recommends against using this, as it affects all
334 output devices.
335 .RE
336 .IP
337 You can also specify channels by number, if you know the right value.
338 .IP
339 For \fBapi alsa\fR, this is the name of the mixer control to use.
340 The default is \fBPCM\fR.
341 Use \fBamixer scontrols\fR or similar to get a full list.
342 .IP
343 For \fBapi coreaudio\fR, volume setting is not currently supported.
344 .TP
345 .B collection \fIMODULE\fR \fIENCODING\fR \fIROOT\fR
346 .TP
347 .B collection \fIMODULE\fR \fIROOT\fR
348 .TP
349 .B collection \fIROOT\fR
350 Define a collection of tracks.
351 .IP
352 \fIMODULE\fR defines which plugin module should be used for this
353 collection.
354 Use the supplied \fBfs\fR module for tracks that exist as ordinary
355 files in the filesystem.
356 If no \fIMODULE\fR is specified then \fBfs\fR is assumed.
357 .IP
358 \fIENCODING\fR defines the encoding of filenames in this collection.
359 For \fBfs\fR this would be the encoding you use for filenames.
360 Examples might be \fBiso\-8859\-1\fR or \fButf\-8\fR.
361 If no encoding is specified then the current locale's character encoding
362 is used.
363 .IP
364 NB that this default depends on the locale the server runs in, which is not
365 necessarily the same as that of ordinary users, depending how the system is
366 configured.
367 It's best to explicitly specify it to be certain.
368 .IP
369 \fIROOT\fR is the root in the filesystem of the filenames and is
370 passed to the plugin module.
371 It must be an absolute path and should not end with a "/".
372 .TP
373 .B cookie_key_lifetime \fISECONDS\fR
374 Lifetime of the signing key used in constructing cookies.  The default is one
375 week.
376 .TP
377 .B cookie_login_lifetime \fISECONDS\fR
378 Lifetime of a cookie enforced by the server.  When the cookie expires the user
379 will have to log in again even if their browser has remembered the cookie that
380 long.  The default is one day.
381 .TP
382 .B default_rights \fIRIGHTS\fR
383 Defines the set of rights given to new users.
384 The argument is a comma-separated list of rights.
385 For the possible values see
386 .B "Users And Access Control"
387 above.
388 .IP
389 The default is to allow everything except \fBadmin\fR and \fBregister\fR
390 (modified in legacy configurations by the obsolete \fBrestrict\fR directive).
391 .TP
392 .B device \fINAME\fR
393 Sound output device.
394 .IP
395 For \fBapi oss\fR this is the path to the device to use.
396 If it is set to \fBdefault\fR then \fI/dev/dsp\fR and \fI/dev/audio\fR
397 will be tried.
398 .IP
399 For \fBapi alsa\fR this is the device name to use.
400 .IP
401 For \fBapi coreaudio\fR this is currently ignored.
402 .IP
403 The default is \fBdefault\fR, which is intended to map to whatever the system's
404 default is.
405 .TP
406 .B gap \fISECONDS\fR
407 Specifies the number of seconds to leave between tracks.
408 The default is 0.
409 .IP
410 NB this option currently DOES NOT WORK.  If there is genuine demand it might be
411 reinstated.
412 .TP
413 .B history \fIINTEGER\fR
414 Specifies the number of recently played tracks to remember (including
415 failed tracks and scratches).
416 .TP
417 .B listen \fR[\fIHOST\fR] \fISERVICE\fR
418 Listen for connections on the address specified by \fIHOST\fR and port
419 specified by \fISERVICE\fR.
420 If \fIHOST\fR is omitted then listens on all local addresses.
421 .IP
422 Normally the server only listens on a UNIX domain socket.
423 .TP
424 .B lock yes\fR|\fBno
425 Determines whether the server locks against concurrent operation.
426 Default is \fByes\fR.
427 There is no good reason to set this to \fBno\fR and the option will
428 probably be removed in a future version.
429 .TP
430 .B mixer \fIDEVICE\fR
431 The mixer device name, if it needs to be specified separately from
432 \fBdevice\fR.
433 .IP
434 For \fBapi oss\fR this should be the path to the mixer device and the default
435 is \fI/dev/mixer\fR.
436 .IP
437 For \fBapi alsa\fR, this is the index of the mixer control to use.
438 The default is 0.
439 .IP
440 For \fBapi coreaudio\fR, volume setting is not currently supported.
441 .TP
442 .B multicast_loop yes\fR|\fBno
443 Determines whether multicast packets are loop backed to the sending host.
444 The default is \fByes\fR.
445 This only applies if \fBapi\fR is set to \fBnetwork\fR and \fBbroadcast\fR
446 is actually a multicast address.
447 .TP
448 .B multicast_ttl \fIHOPS\fR
449 Set the maximum number of hops to send multicast packets.
450 This only applies if \fBapi\fR is set to \fBnetwork\fR and
451 \fBbroadcast\fR is actually a multicast address.
452 The default is 1.
453 .TP
454 .B namepart \fIPART\fR \fIREGEXP\fR \fISUBST\fR [\fICONTEXT\fR [\fIREFLAGS\fR]]
455 Determines how to extract trackname part \fIPART\fR from a 
456 track name (with the collection root part removed).
457 Used in \fB@recent@\fR, \fB@playing@\fR and \fB@search@\fR.
458 .IP
459 Track names can be different in different contexts.
460 For instance the sort string might include an initial track number,
461 but this would be stripped for the display string.
462 \fICONTEXT\fR should be a glob pattern matching the
463 contexts in which this directive will be used.
464 .IP
465 Valid contexts are \fBsort\fR and \fBdisplay\fR.
466 .IP
467 All the \fBnamepart\fR directives are considered in order.
468 The first directive for the right part, that matches the desired context,
469 and with a \fIREGEXP\fR that
470 matches the track is used, and the value chosen is constructed from
471 \fISUBST\fR according to the substitution rules below.
472 .IP
473 Note that searches use the raw track name and \fBtrackname_\fR preferences but
474 not (currently) the results of \fBnamepart\fR, so generating words via this option
475 that aren't in the original track name will lead to confusing results.
476 .IP
477 If you supply no \fBnamepart\fR directives at all then a default set will be
478 supplied automatically.
479 But if you supply even one then you must supply all of them.
480 The defaults are equivalent to:
481 .PP
482 .nf
483 namepart title  "/([0-9]+ *[-:] *)?([^/]+)\\.[a-zA-Z0-9]+$" $2 display
484 namepart title  "/([^/]+)\\.[a-zA-Z0-9]+$"                  $1 sort
485 namepart album  "/([^/]+)/[^/]+$"                          $1 *
486 namepart artist "/([^/]+)/[^/]+/[^/]+$"                    $1 *
487 namepart ext    "(\\.[a-zA-Z0-9]+)$"                        $1 *
488 .fi
489 .TP
490 .B new_max \fIMAX\fR
491 The maximum number of tracks to list when reporting newly noticed tracks.
492 The default is 100.
493 .TP
494 .B nice_rescan \fIPRIORITY\fR
495 Set the recan subprocess priority.
496 The default is 10.
497 .IP
498 (Note that higher values mean the process gets less CPU time; UNIX priority
499 values are backwards.)
500 .TP
501 .B nice_server \fIPRIORITY\fR
502 Set the server priority.
503 This is applied to the server at startup time (and not when you reload
504 configuration).
505 The server does not use much CPU itself but this value is inherited
506 by programs it executes.
507 If you have limited CPU then it might help to set this to a small
508 negative value.
509 The default is 0.
510 .TP
511 .B nice_speaker \fIPRIORITY\fR
512 Set the speaker process priority.
513 This is applied to the speaker process at startup time (and not when
514 you reload the configuration).
515 The speaker process is not massively CPU intensive by today's
516 standards but depends on reasonably timely scheduling.
517 If you have limited CPU then it might help to set this to a small
518 negative value.
519 The default is 0.
520 .TP
521 .B noticed_history
522 The maximum days that a track can survive in the database of newly added
523 tracks.
524 The default is 31.
525 .TP
526 .B player \fIPATTERN\fR \fIMODULE\fR [\fIOPTIONS.. [\fB\-\-\fR]] \fIARGS\fR...
527 Specifies the player for files matching the glob \fIPATTERN\fR.
528 \fIMODULE\fR specifies which plugin module to use.
529 .IP
530 The following options are supported:
531 .RS
532 .TP
533 .B \-\-wait\-for\-device\fR[\fB=\fIDEVICE\fR]
534 Waits (for up to a couple of seconds) for the default, or specified, libao
535 device to become openable.
536 .TP
537 .B \-\-
538 Defines the end of the list of options.
539 Needed if the first argument to the plugin starts with a "\-".
540 .RE
541 .IP
542 The following are the standard modules:
543 .RS
544 .TP
545 .B exec \fICOMMAND\fR \fIARGS\fR...
546 The command is executed via \fBexecvp\fR(3), not via the shell.
547 The \fBPATH\fR environment variable is searched for the executable if it is not
548 an absolute path.
549 The command is expected to know how to open its own sound device.
550 .TP
551 .B execraw \fICOMMAND\fR \fIARGS\fR...
552 Identical to the \fBexec\fR except that the player is expected to use the
553 DisOrder raw player protocol.
554 .BR disorder-decode (8)
555 can decode several common audio file formats to this format.
556 If your favourite format is not supported, but you have a player
557 which uses libao, there is also a libao driver which supports this format;
558 see below for more information about this.
559 .TP
560 .B shell \fR[\fISHELL\fR] \fICOMMAND\fR
561 The command is executed using the shell.
562 If \fISHELL\fR is specified then that is used, otherwise \fBsh\fR will be used.
563 In either case the \fBPATH\fR environment variable is searched for the shell
564 executable if it is not an absolute path.
565 The track name is stored in the environment variable
566 \fBTRACK\fR.
567 .IP
568 Be careful of the interaction between the configuration file quoting rules and
569 the shell quoting rules.
570 .RE
571 .IP
572 If multiple player commands match a track then the first match is used.
573 .IP
574 For the server to be able to calculate track lengths, there should be a
575 .B tracklength
576 command corresponding to each
577 .B player
578 command.
579 .IP
580 If
581 .B player
582 is used without arguments, the list of players is cleared.
583 .TP
584 .B prefsync \fISECONDS\fR
585 The interval at which the preferences log file will be synchronised.
586 Defaults to 3600, i.e. one hour.
587 .TP
588 .B queue_pad \fICOUNT\fR
589 The target size of the queue.
590 If random play is enabled then randomly picked tracks will be added until
591 the queue is at least this big.
592 The default is 10.
593 .TP
594 .B reminder_interval \fISECONDS\fR
595 The minimum number of seconds that must elapse between password reminders.
596 The default is 600, i.e. 10 minutes.
597 .TP
598 .B remote_userman yes\fR|\fBno
599 User management over TCP connection is only allowed if this is set to
600 \fByes\fR.  By default it is set to \fBno\fR.
601 .TP
602 .B replay_min \fISECONDS\fR
603 The minimum number of seconds that must elapse after a track has been played
604 before it can be picked at random.  The default is 8 hours.  If this is set to
605 0 then there is no limit, though current \fBdisorder-choose\fR will not pick
606 anything currently listed in the recently-played list.
607 .TP
608 .B sample_format \fIBITS\fB/\fIRATE\fB/\fICHANNELS
609 Describes the sample format expected by the \fBspeaker_command\fR (below).
610 The components of the format specification are as follows:
611 .RS
612 .TP 10
613 .I BITS
614 The number of bits per sample.
615 Optionally, may be suffixed by \fBb\fR or \fBl\fR for big-endian and
616 little-endian words.
617 If neither is used the native byte order is assumed.
618 .TP
619 .I RATE
620 The number of samples per second.
621 .TP
622 .I CHANNELS
623 The number of channels.
624 .PP
625 The default is
626 .BR 16/44100/2 .
627 .PP
628 With the
629 .B network
630 backend the sample format is forced to
631 .B 16b/44100/2
632 and with the
633 .B coreaudio
634 backend it is forced to
635 .BR 16/44100/2 ,
636 in both cases regardless of what is specified in the configuration file.
637 .RE
638 .TP
639 .B signal \fINAME\fR
640 Defines the signal to be sent to track player process groups when tracks are
641 scratched.
642 The default is \fBSIGKILL\fR.
643 .IP
644 Signals are specified by their full C name, i.e. \fBSIGINT\fR and not \fBINT\fR
645 or \fBInterrupted\fR or whatever.
646 .TP
647 .B sox_generation \fB0\fR|\fB1
648 Determines whether calls to \fBsox\fR(1) should use \fB\-b\fR, \fB\-x\fR, etc (if
649 the generation is 0) or \fB\-\fIbits\fR, \fB\-L\fR etc (if it is 1).
650 See the documentation for your installed copy of \fBsox\fR to determine
651 which you need.
652 The default is 0.
653 .TP
654 .B speaker_backend \fINAME
655 This is an alias for \fBapi\fR; see above.
656 .TP
657 .B speaker_command \fICOMMAND
658 Causes the speaker subprocess to pipe audio data into shell command
659 \fICOMMAND\fR, rather than writing to a local sound card.
660 The sample format is determine by
661 .B sample_format
662 above.
663 .IP
664 Note that if the sample format is wrong then
665 .BR sox (1)
666 is invoked to translate it.
667 If
668 .B sox
669 is not installed then this will not work.
670 .TP
671 .B scratch \fIPATH\fR
672 Specifies a scratch.
673 When a track is scratched, a scratch track is played at random.
674 Scratches are played using the same logic as other tracks.
675 .IP
676 At least for the time being, path names of scratches must be encoded using
677 UTF-8 (which means that ASCII will do).
678 .IP
679 If \fBscratch\fR is used without arguments then the list of scratches is
680 cleared.
681 .TP
682 .B stopword \fIWORD\fR ...
683 Specifies one or more stopwords that should not take part in searches
684 over track names.
685 .IP
686 If \fBstopword\fR is used without arguments then the list of stopwords is
687 cleared.
688 .IP
689 There is a default set of stopwords built in, but this option can be used to
690 augment or replace that list.
691 .TP
692 .B tracklength \fIPATTERN\fR \fIMODULE\fR
693 Specifies the module used to calculate the length of files matching
694 \fIPATTERN\fR.
695 \fIMODULE\fR specifies which plugin module to use.
696 .IP
697 If \fBtracklength\fR is used without arguments then the list of modules is
698 cleared.
699 .TP
700 .B user \fIUSERNAME\fR
701 Specifies the user to run as.
702 Only makes sense if invoked as root (or the target user).
703 .SS "Client Configuration"
704 .TP
705 .B connect \fIHOST SERVICE\fR
706 Connect to the address specified by \fIHOST\fR and port specified by
707 \fISERVICE\fR.
708 .SS "Web Interface Configuration"
709 .TP
710 .B mail_sender \fIADDRESS\fR
711 The email address that appears in the From: field of any mail messages sent by
712 the web interface.
713 This must be set if you have online registration enabled.
714 .TP
715 .B refresh \fISECONDS\fR
716 Specifies the maximum refresh period in seconds.
717 Default 15.
718 .TP
719 .B short_display \fICHARACTERS\fR
720 Defines the maximum number of characters to include in a \fBshort\fR name
721 part.
722 Default 30.
723 .TP
724 .B smtp_server \fIHOSTNAME\fR
725 The hostname (or address) of the SMTP server to use for sending mail.
726 The default is 127.0.0.1.
727 .TP
728 .B templates \fIPATH\fR ...
729 Specifies the directory containing templates used by the web
730 interface.
731 If a template appears in more than one template directory
732 then the one in the earliest directory specified is chosen.
733 .IP
734 See below for further details.
735 .IP
736 If \fBtemplates\fR is used without arguments then the template path is cleared.
737 .TP
738 .B transform \fITYPE\fR \fIREGEXP\fR \fISUBST\fR [\fICONTEXT\fR [\fIREFLAGS\fR]]
739 Determines how names are sorted and displayed in track choice displays.
740 .IP
741 \fITYPE\fR is the type of transformation; usually \fBtrack\fR or
742 \fBdir\fR but you can define your own.
743 .IP
744 \fICONTEXT\fR is a glob pattern matching the context.
745 Standard contexts are \fBsort\fR (which determines how directory names
746 are sorted) and \fBdisplay\fR (which determines how they are displayed).
747 Again, you can define your own.
748 .IP
749 All the \fBtransform\fR directives are considered in order.
750 If the \fITYPE\fR, \fIREGEXP\fR and the \fICONTEXT\fR match
751 then a new track name is constructed from
752 \fISUBST\fR according to the substitution rules below.
753 If several match then each is executed in order.
754 .IP
755 If you supply no \fBtransform\fR directives at all then a default set will be
756 supplied automatically.
757 But if you supply even one then you must supply all of them.
758 The defaults are:
759 .PP
760 .nf
761 transform track "^.*/([0-9]+ *[-:] *)?([^/]+)\\.[a-zA-Z0-9]+$" $2 display
762 transform track "^.*/([^/]+)\\.[a-zA-Z0-9]+$"        $1 sort
763 transform dir   "^.*/([^/]+)$"                      $1 *
764 transform dir   "^(the) ([^/]*)"                    "$2 $1" sort i
765 transform dir   "[[:punct:]]"                       "" sort g
766 .fi
767 .TP
768 .B url \fIURL\fR
769 Specifies the URL of the web interface.
770 This URL will be used in generated web pages.
771 The default is inferred at runtime, so this option no
772 longer needs to be specified.
773 .IP
774 This must be the full URL, e.g. \fBhttp://myhost/cgi-bin/jukebox\fR and not
775 \fB/cgi-bin/jukebox\fR.
776 .SS "Authentication Configuration"
777 These options would normally be used in \fI~\fRUSERNAME\fI/.disorder/passwd\fR
778 or
779 \fIpkgconfdir/config.\fRUSERNAME.
780 .TP
781 .B password \fIPASSWORD\fR
782 Specify password.
783 .TP
784 .B username \fIUSERNAME\fR
785 Specify username.
786 The default is taken from the environment variable \fBLOGNAME\fR.
787 .SH "GLOBAL PREFERENCES"
788 These are the values set with \fBset\-global\fR.
789 .TP
790 .B required\-tags
791 If this is set an nonempty then randomly played tracks will always have at
792 least one of the listed tags.
793 .TP
794 .B prohibited\-tags
795 If this is set an nonempty then randomly played tracks will never have any of
796 the listed tags.
797 .TP
798 .B playing
799 If unset or \fByes\fR then play is enabled.
800 Otherwise it is disabled.
801 Use \fBdisable\fR rather than setting it directly.
802 .TP
803 .B random\-play
804 If unset or \fByes\fR then random play is enabled.
805 Otherwise it is disabled.
806 Use \fBdisable\fR rather than setting it directly.
807 .PP
808 Global preferences starting '_' are read-only (in the sense that you cannot
809 modify them; the server may modify them as part of its normal operation).
810 They are:
811 .TP
812 .B _dbversion
813 The database version string.
814 This is used by DisOrder to detect when it must
815 modify the database after an upgrade.
816 .SH "LIBAO DRIVER"
817 .SS "Raw Protocol Players"
818 Raw protocol players are expected to use the \fBdisorder\fR libao driver.
819 Programs that use libao generally have command line options to select the
820 driver and pass options to it.
821 .SS "Driver Options"
822 The known driver options are:
823 .TP
824 .B fd
825 The file descriptor to write to.
826 If this is not specified then the driver looks like the environment
827 variable \fBDISORDER_RAW_FD\fR.
828 If that is not set then the default is 1 (i.e. standard output).
829 .TP
830 .B fragile
831 If this is set to a nonzero value then the driver will call \fB_exit\fR(2) if a
832 write to the output file descriptor fails.
833 This is a workaround for buggy players such as \fBogg123\fR that ignore
834 write errors.
835 .SH "REGEXP SUBSTITUTION RULES"
836 Regexps are PCRE regexps, as defined in \fBpcrepattern\fR(3).
837 The only option used is \fBPCRE_UTF8\fR.
838 Remember that the configuration file syntax means you have to
839 escape backslashes and quotes inside quoted strings.
840 .PP
841 In a \fISUBST\fR string the following sequences are interpreted
842 specially:
843 .TP
844 .B $1 \fR... \fB$9
845 These expand to the first to ninth bracketed subexpression.
846 .TP
847 .B $&
848 This expands to the matched part of the subject string.
849 .TP
850 .B $$
851 This expands to a single \fB$\fR symbol.
852 .PP
853 All other pairs starting with \fB$\fR are undefined (and might be used
854 for something else in the future, so don't rely on the current
855 behaviour.)
856 .PP
857 If \fBi\fR is present in \fIREFLAGS\fR then the match is case-independent.
858 If \fBg\fR is present then all matches are replaced, otherwise only the first
859 match is replaced.
860 .SH "TRACK NAME PARTS"
861 The traditional track name parts are \fBartist\fR, \fBalbum\fR and \fBtitle\fR,
862 with the obvious intended meaning.
863 These are controlled by configuration and by \fBtrackname_\fR preferences.
864 .PP
865 In addition there are two built-in parts, \fBpath\fR which is the whole path
866 name and \fBext\fR which is the filename extension, including the initial dot
867 (or the empty string if there is not extension).
868 .SH "SEE ALSO"
869 \fBdisorder\fR(1), \fBsox\fR(1), \fBdisorderd\fR(8), \fBdisorder\-dump\fR(8),
870 \fBpcrepattern\fR(3), \fBdisorder_templates\fR(5), \fBdisorder_actions\fR(5),
871 \fBdisorder.cgi\fR(8)
872 .\" Local Variables:
873 .\" mode:nroff
874 .\" fill-column:79
875 .\" End: