2 # $Id: gnump3d.conf,v 1.23 2006/04/26 13:44:40 skx Exp $
5 # This is the configuration file for GNUMP3d, the streaming MP3/OGG server.
7 # All lines beginning with '#' are comments and may be ignored.
11 # user = nobody # Some comment
13 # # The port to listen upon.
18 # If you believe the documentation here is incomplete or misleading
19 # please consider contributing an update - or reporting it as a bug.
21 # Comments on sensible defaults to ship this file with, or new options
22 # should be sent to the author.
28 # http://www.gnump3d.org/ - Website for this software, including
29 # documentation and mailing lists.
31 # http://www.steve.org.uk/ - My homepage. Visit. Enjoy.
39 # Basic Server Settings
43 # The port upon which we are going to serve. This may be any
44 # port which is not already in use upon your machine.
46 # You may use a low port, for example 80, if you are running
47 # as root - but that is only recommended if you make use of
48 # the `user' option, which occurs later in this file.
54 # The following is the interface address that we wish to
57 # You'll only need set this if you are running this server upon
58 # a machine which has multiple IP addresses and you wish to force
59 # it to bind to a particular address.
61 # If you're not running this server on a machine with multiple
62 # IP addresses, then please ignore this setting.
68 # If you just want to specify the name used in all the generated
69 # links then you should be setting `hostname' instead.
71 # binding_host = 192.168.2.2
76 # Set the hostname that is used in all the generated links.
78 # (This defaults to the name of the server machine, with no
81 # You won't need this unless the machine which is serving on
82 # MUST be accessed via its fully qualified domain name - for
83 # example if you're running it on a machine which is accessible
89 # See `binding_host' if you have a machine which has multiple
90 # IP addresses and you're trying to bind to one in particular.
92 # hostname = mp3d.foo.org
97 # The root directory where we serve content from, this should be
98 # the directory containing the MP3, OGG, or other media files that
101 # Obviously the files which you wish to serve should be accessible
102 # to the user who this server is running as - which is set via the
103 # 'user' setting below.
105 # If you're on a multi-user system its probably a good idea to
106 # make the audio files readable to other users anyway, share the
113 # This is the file which logs all MP3's / OGG's / directories
114 # which clients access.
116 # If you start the server as root it's recommended that you use
117 # a canonical location such as '/var/log' or '/var/adm', (because
118 # your system will, probably, rotate files held there).
120 # If you're starting this server as a non-root user you should
121 # change these locations to be a directory upon which you have write
128 # If you want the song statistics to be displayed correctly
129 # you MUST give the logfile as an absolute path - you must also
130 # ensure that the logfile is readable to the user whom you are
131 # running the server as.
137 # This logfile is 100% apache logfile compatible so you may run any
138 # Apache logfile processor upon it if you so wish.
140 # Simplistic statistics such as the most popular directories, songs,
141 # and clients are available via the installed script 'gnump3d-top'
142 # Run 'gnump3d-top --help' for details.
147 logfile = /var/log/gnump3d/access.log
151 # Specify the format of the logfile, this may use any valid variables
152 # which are defined in package "main".
155 log_format = $connected_address - $user [$date] "GET $REQUEST" $HTTP_CODE $SERVED_SIZE "-" "$USER_AGENT"
160 # In the case of problems all output from the server will be sent
163 # This next option configures where that is
165 errorlog = /var/log/gnump3d/error.log
170 # This option allows you to specify additional arguments to the
171 # statistics generating program 'gnump3d-top', and it's complete
172 # path if you don't have it installed upon the $PATH of the user
173 # who starts the server:
175 # stats_program = /usr/bin/gnump3d-top
178 # For example you may change the default number of lines which are
179 # reported from the default of 20 to 10 with this:
181 # stats_arguments = --count=10
183 # To hide the directories which are handled by the various plugins
184 # you may use the '--hide' option.
186 # stats_arguments = --hide
188 # To read multiple logfiles, (eg to cope with files which have been
189 # processed by logrotate), you could use:
191 # stats_arguments = --logfiles = /var/log/gnump3d/access.log*
193 # Combine the options if you wish, and see the gnump3d-top man-page
194 # for details of more arguments
196 # stats_arguments = --count=40 --hide --logfiles=/var/log/gnump3d/access.log*
207 # If there is a user value setup below then the server will become that
208 # user, after creating the listening socket and after opening the logfiles
211 # If you want to run this server via init.d, (which has the effect of
212 # starting the daemon as root), you should make sure you have this set
213 # to an appropriate value.
214 # Otherwise you will have the server running as root, which is clearly
215 # not a good idea - even in the unlikely event that this application is
218 # You may comment the line out if you are running the daemon from your home
219 # directory, and you are the only user with read access to the server root.
220 # Although this is not recommended way of running the server.
222 # For the benefit of fellow computer users is recommended that you run the
223 # server as a user such as 'nobody', and allow people read-only access to
232 # AUTHORISATION OPTIONS.
236 # The following section allows you to specify which clients
237 # are allowed to connect to your server.
239 # If you are leaving this server out on an Internet-accessible
240 # machine then you will probably want to setup something here,
241 # or at least make use of the password protection system.
243 # The following entries are commented out, so they have no effect,
244 # but they should serve as good examples of the things which
251 # Multiple settings are allowed - just separated them with ';'
254 # Only people on the same subnet, (class C):
255 # allowed_clients = 192.168.2.0/8
257 # People on the same class B:
258 # allowed_clients = 10.0.0.0/16
261 # allowed_clients = 192.168.2.12
264 # allowed_clients = all
267 # allowed_clients = none
269 # Everybody local, and one remote address:
270 # allowed_clients = 192.168.2.0/8; 194.247.82.33
272 # Everybody local, and one remote range:
273 # allowed_clients = 192.168.2.0/8; 194.237.82.0/8
276 allowed_clients = all
280 # 'denied_clients' is the counterpart to allowed_clients - here
281 # you can specify particular clients who are unable to browse your
284 # Usage is identical to the allowed clients above; eg:
286 # denied_clients = 192.168.2.12; 192.168.2.25; 192.168.6.0/8
288 # denied_clients = none
294 # This section controls whether we will prompt clients for
295 # a username and password prior to granting access to the
298 # This is enabled by default; all you need to do is create
299 # a password file in the MP3 directory called '.password'.
301 # (To disable this uncomment the 'enable_password_protection' line).
303 # The password file should be of the following format:
306 # username2:password2
308 # usernameN:passwordN
314 # The password file must be readable to the user the server is running
318 # enable_password_protection = 0
328 # The last security option is the ability to block clients that don't
329 # contain a specific 'Referrer:' header.
331 # Note that referrer protection isn't terribly reliable, as many clients
332 # will not send a referrer header when making a connection. This is
333 # especially likely when clients are connecting via a 'privacy enhancing'
334 # proxy server; such as Internet Junkbuster, etc.
336 # Similarly malicious clients may deliberately stop sending referrers
337 # if they realise what is going on.
342 # If you wish to only allow a particular referring URL then specify it
344 # valid_referrers = http://somesite.com/
352 # This next option controls what happens when you click upon a
355 # If always_stream is set to '1', and you click upon it you'll
356 # actually get a .m3u (playlist) file containing a link to it -
357 # the advantage of doing this is that you don't have to download
358 # the file in its entirety to listen to it - it should start playing
361 # If set to '0' the playlists will work via streaming, but selecting
362 # an individual MP3 file will cause it to be downloaded to your local
363 # machine prior to playing - one drawback of this is that playback
364 # will probably not start until the entire file has downloaded.
370 # There is a link placed at the top of every directory, which allows you
371 # to play the songs within that directory recursively.
373 # By default the recursive option plays all the tracks in a
374 # sorted order - by uncommenting the following option you can
375 # have the recursive playlists default to being in a random order.
377 # recursive_randomize = 1
381 # This next setting controls the format of the playslist files.
383 # There are two formats this server supports, simple playlists which
384 # are just plain listings of tracks, and advanced playlists which contain
385 # copies of the song tags in comments.
387 # The advanced playlists will allow you to view song tag information
388 # inside the playlist windows of both XMMS and WinAMP
391 advanced_playlists = 1
397 # Server Appearance Settings.
403 # All the output the server produces is generated with the help of
404 # some HTML template files, these are referred to throughout the
405 # program and each collection of templates is referred to collectively
408 # This next option allows you to specify which theme should be used
409 # by default. (Any client can select one of the available themes by
410 # the use of cookies).
412 # For each theme there are a collection of HTML files which are read
413 # and used for the server output. There are several basic files which
414 # must be supplied to be considered a theme:
416 # index.html -> Used for displaying individual directories.
417 # search.html -> Used for displaying the search form.
418 # results.html -> Used for displaying the results of a search.
419 # stats.html -> Used for customising the server statistics page.
421 # In addition to those each plugin reads in it's own template file
422 # and uses that. For example the statistics plugin is accessed via
423 # the URL http://server.host.name:port/stats/, and reads in a template
424 # called 'stats.html'
426 # The theme directory defaults to /usr/share/gnump3d - but may be
427 # changed via the 'theme_directory' setting given below.
429 # When the server is running you may set the theme from your browser
430 # via the preferences page, simply visit the link:
432 # http://server.host.name:port/prefs
438 # If you create a theme I'd be happy to include it in future releases
439 # if you wish - see the online theme creation docs at:
441 # http://www.gnump3d.org/theme.html
449 # Set the base theme directory if you wish to place them in a non-standard
453 theme_directory = /usr/share/gnump3d/
460 # This next option controls how directories are displayed on the index
463 # There are several defined variables which you can choose to use:
465 # $LINK = The actual URL of the directory.
467 # $DIR_NAME = The name of the directory.
469 # $SONG_COUNT = The number of songs contained in the directory.
471 # $DIR_COUNT = The number of subdirectories in the directory.
473 # $RECURSE = A link to play the contents of the directory recursively.
475 # $NEW = Will insert the text specified by 'new_format' if the
476 # directory is recently modified.
478 # NOTE: you can also specify "directory_format2" as an alternative display
479 # format. Directories are then listed with alternating display formats.
480 # This is useful if you want to have alternating background colors for
481 # each entry in a table, for example.
483 directory_format = <tr><td width="10%"> </td><td><a href="$LINK">$DIR_NAME</a> $NEW</td><td>$SONG_COUNT</td><td>$DIR_COUNT</td><td>[$RECURSE]</td></tr></a>
486 # directory_format = <tr><td><a href="$LINK">$DIR_NAME</a></td></tr>
488 # directory_format = <tr><td><a href="$LINK">$DIR_NAME</a></td></tr>
490 # directory_format = <tr><td><a href="$LINK">$DIR_NAME</a></td><td>[$RECURSE]</td></tr>
495 # Text to insert if the directory is recently modified.
497 new_format = <font color="red"><b>New</b></font>
500 # If a directory hasn't been modifed in more than 'x' days then
501 # it isn't considered 'new'.
510 # This option is analogous to the 'directory_format' option above.
512 # It specifies how the files should be listed.
514 # $LINK Is the link to the track itself
516 # $SONG_FORMAT Is a template string which is described below.
518 # NOTE: you can also specify "file_format2" as an alternative display
519 # format. Files are then listed with alternating display formats.
520 # This is useful if you want to have alternating background colors for
521 # each entry in a table, for example.
523 file_format = <tr><td width="10%"> </td><td><a href="$LINK">$SONG_FORMAT</a></td><td align="right">[<a href="/info$PLAINLINK">Info</a>] [<a href="$PLAINLINK">Download</a>]</td></tr>
529 # This next setting, `song_format', allows you to configure how the
530 # MP3 and OGG Vorbis files are displayed.
532 # If the file which has been found contains any tag information then
533 # the following values will be available to you:
535 # $ARTIST -> The artist of the song.
537 # $ALBUM -> The album the song came from.
539 # $COMMENT -> The comment string attached to the song, if any.
540 # NOT AVAILABLE FOR OGG FILES.
542 # $SONGNAME -> The name of the song.
544 # $YEAR -> The year the song was recorded.
545 # NOT AVAILABLE FOR OGG FILES.
547 # $GENRE -> The genre of the track.
548 # NOT AVAILABLE FOR OGG FILES.
550 # $BPS -> The sample rate of the song - if non-variable.
551 # NOT AVAILABLE FOR OGG FILES.
553 # $LENGTH -> The length of the track in MM:SS
554 # NOT AVAILABLE FOR OGG FILES, OR VBR MP3's.
556 # $SECONDS -> The length of the track in seconds
557 # NOT AVAILABLE FOR OGG FILES, OR VBR MP3's.
559 # $SIZE -> The size of the audio stream.
560 # NOT AVAILABLE FOR OGG FILES, OR VBR MP3's.
562 # $TRACK -> The number of the track
564 # $FILENAME will always be available. (This is the name of the file
565 # without any suffix or directory information).
567 song_format = $TRACK - $ARTIST - $ALBUM - $SONGNAME [ $GENRE - $LENGTH / $SIZE ] $NEW
573 # If you wish to change the text displayed on the 'Play'
574 # link you should uncomment the following option, and change the
575 # text appropriately.
579 # play_recursively_text = Play
585 # This next option controls how songs are sorted prior to display,
586 # and used in the playlists.
588 # You may use any of the $ values which are listed above in
589 # the 'song_format' setting, eg:
591 # Sort by the song name.
592 # sort_order = $SONGNAME
594 # Sort by artist if present.
595 # sort_order = $ARTIST
597 # Default to sorting by the track number, due to popular.
605 # DOWNSAMPLING / BIT RATE CHANGE
608 # This support allows the music to be down-sampled before it is streamed
609 # to clients. This will slow down the serving, and may be a little
610 # processor intensive - I guess it will depend upon the speed of your
611 # server, and the number of users you have.
615 # Is downsampling support enabled?
617 # If this is disabled then none of the further downsampling options will
618 # apply, even if they are set.
620 # Also note that if the downsampling support is disabled the preferences
621 # page will not allow the clients to select their own bitrate.
623 # (I think this makes sense, if it's disabled it's misleading to present
624 # configuration options to the clients).
626 # downsample_enabled = 1
631 # YOU MUST UNCOMMENT THESE LINES
633 # Downsampling is based upon IP address, rather than enabled globally
634 # this allows you to control things a little more tightly than user
637 # For example on a gateway machine you'd want all people on the internal
638 # LAN to have full quality files, and people remote to have the lower
641 # The next two settings specify the downsampling ranges:
643 # downsample_clients = ALL
644 # no_downsample_clients = 192.168.0.0/24
646 # NOTE: 'no_downsample_clients' takes precedence over 'downsample_clients'.
648 # Here are some examples, notice that you can use either single IP
649 # addresses, ranges, 'NONE' or 'ALL'
652 # Downsample Everybody:
653 # downsample_clients = ALL
654 # no_downsample_clients = NONE
656 # Downsample remote, allow local to have full quality
657 # downsample_clients = ALL
658 # no_downsample_clients = 192.168.0.0/24
660 # Downsample all except two addresses
661 # downsample_clients = ALL
662 # no_downsample_clients = 192.168.0.162; 192.168.0.33
664 # Full quality for all local, except one address
665 # downsample_clients = 192.168.0.99
666 # no_downsample_clients = 192.168.0.0/24
672 # YOU MUST UNCOMMENT THESE LINES
675 # For each of the downsampling levels the user has chosen the selected
676 # file will be processed by a command.
678 # This command is assumed to write it's output directly to STDOUT.
680 # The following options specify the command line to run, note that
681 # the string '$FILENAME' will be replaced by the file the user is
686 # If you wish to downsample or convert any other file types you
687 # need to add entries to this file to specify what is done to them
688 # simply create an entry which looks like:
690 # downsample_"level"_"file suffix" = command args
692 #downsample_high_mp3 = /usr/bin/lame --mp3input -b 56 $FILENAME -
693 #downsample_medium_mp3 = /usr/bin/lame --mp3input -b 32 $FILENAME -
694 #downsample_low_mp3 = /usr/bin/lame --mp3input -b 16 $FILENAME -
696 #downsample_high_ogg = /usr/bin/sox -t ogg $FILENAME -t raw - | oggenc --raw --downmix -b 96 -
697 #downsample_medium_ogg = /usr/bin/sox -t ogg $FILENAME -t raw - | oggenc --raw --downmix -b 64 -
698 #downsample_low_ogg = /usr/bin/sox -t ogg $FILENAME -t raw - | oggenc --raw --downmix --resample 22050 -b 32 -
702 # If you always want to force a particular bitrate upon clients who've
703 # not chosen something different then specify it here:
705 # default_quality = medium
720 # Several of the servers features are controlled via external plugins,
721 # these are simple Perl scripts which are called by the server in response
724 # This next setting allows you to change the location from which the
725 # plugins are loaded.
727 # plugin_directory = /usr/lib/perl5/gnump3d/plugins
730 # NOTE: the following directory should be correctly filled in by
731 # the installation script - if this doesn't happen report this as
734 plugin_directory = /usr/lib/perl5/5.32.1/gnump3d/plugins
739 # Plugin-Specific settings here.
744 # Directories to exclude when choosing a random directory. Seperate
745 # multiple directories with a '|' character.
747 # plugin_random_exclude = Talk|Midi|Video
757 # HACKING - atypical configuration follows, this will not be of
758 # interest to casual users.
760 # Dragons lie yonder ... ->
765 # When files are served there needs to be an appropriate mime type
766 # sent along with them, this allows the browser to pass the response
767 # back to an MP3 player, etc.
769 # Most Unix systems will have the file '/etc/mime.types' which is
770 # used by default. If not point this next file to wherever your mime
771 # types file is located:
773 mime_file = /etc/gnump3d/mime.types
778 # This next setting controls where the file types are looked up.
779 # we support many audio, visual, and playlist files and to do this
780 # we need to be able to lookup a file to determine what kind of
783 # Here is the lookup file.
784 file_types = /etc/gnump3d/file.types
788 # In order to record which songs are currently being played the server
789 # will create a temporary file containing that path of each file that
792 # The path under which these files are created in may be set here.
794 now_playing_path = /var/cache/gnump3d/serving
798 # As a speedup and optimisation song tag is read via a companion script
799 # which is called 'gnump3d-index'. This will be run automatically when
800 # the server starts if possible.
802 # This next setting controls where that script will write its tag database
805 tag_cache = /var/cache/gnump3d/song.tags
808 # This next setting allows you to control the path to the gnump3d-index
809 # script which is used, as explained above.
811 # Normally you shouldn't need to touch this.
813 # index_program = /usr/bin/gnump3d-index
817 # This setting controls whether we should stream song title
818 # information in shoutcast format.
820 # If your client supports it then you should enable it, otherwise
823 # (This works correctly on WinAmp, and XMMS.)
825 shoutcast_streaming = 1
829 # By default the server logfile is appended to when we start.
831 # If you set the following value to '1' the logfile will be truncated
834 # You might want to truncate the file to save space, but doing this
835 # renders the server statistics less useful.
837 # truncate_log_file = 0
841 # By default the server will close a connection it receives if it
842 # hasn't received a valid request after 10 seconds.
844 # Here you may change this timeout value.
851 # This next section controls whether we present a HTML interface
854 # In most situations you will want to do this - but some people have
855 # approached me and suggested that it should be tweakable, so here's
856 # the option to disable the browsing of the music
858 # If you set this to '0' the best you can probably do is call
859 # 'http://server:port/recurse.m3u' - or similar.
861 # enable_browsing = 1
865 # This next value controls whether we should believe, and use, the
866 # client supplied 'Host:' header.
868 # This header is sent by HTTP/1.1 clients only, and could be spoofed.
869 # You'll only NEED to use it if tunnelling over SSH or performing similar
872 # It's enabled here because I don't believe it should cause any real harm
880 # Set this option to rewrite the hostname:port combination in the URLs in
881 # your playlist. Most people won't need this unless they are proxying
882 # their connection or running multiple streaming servers through a load
883 # balancer or DNS rotor.
885 # Note: If you set this you will almost certainly need to set
886 # "use_client_host=0"
893 # This is an experimental feature - ignore it.
897 # Ignore it: You are not expected to understand this (I've always wanted
898 # to leave that as a comment somewhere ;)
903 # jukebox_player = /usr/bin/mpg123 $FILENAME
910 # Make it possible to hide song tags, and just display filenames.
917 # Make it possible to disable the tag cache altogether, to save memory.
920 # disable_tag_cache = 0
925 # This option allows you to insert a custom META-tag inside the header of
926 # each page which is output.
928 # You can add whatever you like here, perhaps the most useful thing to
929 # add is an encoding type.
931 # add_meta_tag = <meta name="author" value="Steve Kemp" />
932 # add_meta_tag = <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
937 # End Of Hacking Section
943 # End of gnump3d.conf