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