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