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