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