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