| View previous topic :: View next topic |
| Author |
Message |
Sublime7888 Guest
|
Posted: Sun Nov 13, 2005 12:29 am Post subject: Authentication of static files |
|
|
Could somebody tell me how to setup an authenticator for static files (files served out of the web root). The 2.3 release notes state “On demand files now can be fed through an authenticator”, which leads me to believe this is possible, but the support manual doesn’t describe the process. All the examples in the support manual pertain to mount points and since static files aren’t associated with a mount point…….. I don’t see how this is possible?
- Sublime |
|
| Back to top |
|
 |
karlH Code Warrior

Joined: 13 Jun 2005 Posts: 5476 Location: UK
|
Posted: Sun Nov 13, 2005 1:27 am Post subject: |
|
|
Just state a <mount> tag group with a mount-name relating to the file off webroot, eg /mymusicfile.ogg, along with the authenticator to use.
karl. |
|
| Back to top |
|
 |
Sublime7888 Guest
|
Posted: Sun Nov 13, 2005 1:59 am Post subject: Current Configuration |
|
|
Hey Karl,
Here is my current configuration. The file I am testing with is called T.mp3 and is located directly under the web directory of icecast. The configuration below results in the ability to play the song through Winamp, but no authentication is required?
http://localhost:8000/T.mp3
<mount>
<mount-name>/T.mp3</mount-name>
<authentication type="htpasswd">
<option name="filename" value="myauth"/>
<option name="allow_duplicate_users" value="0"/>
</authentication>
</mount>
<fileserve>1</fileserve>
<webroot>./web</webroot> |
|
| Back to top |
|
 |
karlH Code Warrior

Joined: 13 Jun 2005 Posts: 5476 Location: UK
|
Posted: Sun Nov 13, 2005 3:17 am Post subject: |
|
|
If you are sure that the xml is correctly defining the mount (ie no commenting out) then send me the xml and error log (log level 4), because the mechanism works here.
karl. |
|
| Back to top |
|
 |
Sublime7888 Guest
|
Posted: Sun Nov 13, 2005 3:57 am Post subject: Configuration and log |
|
|
Hey Carl,
Here is the log file and config xml file that I am using. The operating system is Windows XP. Thanks for you help!
[2005-11-12 21:54:08] INFO main/main.c Icecast 2.3.0 server started
[2005-11-12 21:54:08] DBUG yp/yp.c Updating YP configuration
[2005-11-12 21:54:08] INFO stats/stats.c stats thread started
[2005-11-12 21:54:08] INFO fserve/fserve.c file serving thread started
[2005-11-12 21:54:08] INFO yp/yp.c YP update thread started
[2005-11-12 21:54:08] INFO auth/auth.c Authentication thread started
[2005-11-12 21:54:09] DBUG slave/slave.c checking master stream list
[2005-11-12 21:54:25] DBUG stats/stats.c update node clients (1)
[2005-11-12 21:54:25] DBUG stats/stats.c update node connections (1)
[2005-11-12 21:54:25] INFO fserve/fserve.c checking for file /T.mp3 (./web/T.mp3)
[2005-11-12 21:54:25] DBUG fserve/fserve.c Adding client to file serving engine
[2005-11-12 21:54:25] DBUG stats/stats.c update node client_connections (1)
[2005-11-12 21:54:25] DBUG stats/stats.c update node file_connections (1)
[2005-11-12 21:54:28] DBUG client/client.c Client connection died
[2005-11-12 21:54:28] DBUG stats/stats.c update node clients (0)
[2005-11-12 21:55:23] DBUG connection/connection.c Connection thread done
[2005-11-12 21:55:23] INFO main/main.c Shutting down
[2005-11-12 21:55:23] INFO fserve/fserve.c file serving thread stopped
[2005-11-12 21:55:23] DBUG slave/slave.c waiting for slave thread
[2005-11-12 21:55:23] DBUG slave/slave.c shutting down current relays
[2005-11-12 21:55:23] INFO slave/slave.c Slave thread shutdown complete
[2005-11-12 21:55:23] INFO auth/auth.c Authenication thread shutting down
[2005-11-12 21:55:23] INFO auth/auth.c Auth thread has terminated
[2005-11-12 21:55:24] INFO yp/yp.c YP thread down
[2005-11-12 21:55:24] INFO stats/stats.c stats thread finished
<icecast>
<limits>
<clients>100</clients>
<sources>2</sources>
<threadpool>5</threadpool>
<queue-size>524288</queue-size>
<client-timeout>30</client-timeout>
<header-timeout>15</header-timeout>
<source-timeout>10</source-timeout>
<!-- If enabled, this will provide a burst of data when a client
first connects, thereby significantly reducing the startup
time for listeners that do substantial buffering. However,
it also significantly increases latency between the source
client and listening client. For low-latency setups, you
might want to disable this. -->
<burst-on-connect>1</burst-on-connect>
<!-- same as burst-on-connect, but this allows for being more
specific on how much to burst. Most people won't need to
change from the default 64k. Applies to all mountpoints -->
<burst-size>65535</burst-size>
</limits>
<authentication>
<!-- Sources log in with username 'source' -->
<source-password>hackmeddfadfa</source-password>
<!-- Relays log in username 'relay' -->
<relay-password>hackme</relay-password>
<!-- Admin logs in with the username given below -->
<admin-user>admin</admin-user>
<admin-password>hackme</admin-password>
</authentication>
<!-- Uncomment this if you want directory listings -->
<!--
<directory>
<yp-url-timeout>15</yp-url-timeout>
<yp-url>http://dir.xiph.org/cgi-bin/yp-cgi</yp-url>
</directory>
<directory>
<yp-url-timeout>15</yp-url-timeout>
<yp-url>http://www.oddsock.org/cgi-bin/yp-cgi</yp-url>
</directory>
-->
<!-- This is the hostname other people will use to connect to your server.
It affects mainly the urls generated by Icecast for playlists and yp
listings. -->
<hostname>localhost</hostname>
<!-- You can use these two if you only want a single listener -->
<!--<port>8000</port> -->
<!--<bind-address>127.0.0.1</bind-address>-->
<!-- You may have multiple <listener> elements -->
<listen-socket>
<port>8000</port>
<!-- <bind-address>127.0.0.1</bind-address> -->
</listen-socket>
<!--
<listen-socket>
<port>8001</port>
</listen-socket>
-->
<!--<master-server>127.0.0.1</master-server>-->
<!--<master-server-port>8001</master-server-port>-->
<!--<master-update-interval>120</master-update-interval>-->
<!--<master-password>hackme</master-password>-->
<!-- setting this makes all relays on-demand unless overridden, this is
useful for master relays which do not have <relay> definitions here.
The default is 0 -->
<!--<relays-on-demand>1</relays-on-demand>-->
<!--
<relay>
<server>127.0.0.1</server>
<port>8001</port>
<mount>/example.ogg</mount>
<local-mount>/different.ogg</local-mount>
<on-demand>0</on-demand>
<relay-shoutcast-metadata>0</relay-shoutcast-metadata>
</relay>
-->
<!-- Only define a <mount> section if you want to use advanced options,
like alternative usernames or passwords
<mount>
<mount-name>/T.mp3</mount-name>
<authentication type="htpasswd">
<option name="filename" value="myauth"/>
<option name="allow_duplicate_users" value="0"/>
</authentication>
</mount>
-->
<fileserve>1</fileserve>
<!-- set the mountpoint for a shoutcast source to use, the default if not
specified is /stream but you can change it here if an alternative is
wanted or an extension is required
<shoutcast-mount>/live.nsv</shoutcast-mount>
-->
<paths>
<!-- basedir is only used if chroot is enabled -->
<basedir>./</basedir>
<!-- Note that if <chroot> is turned on below, these paths must both
be relative to the new root, not the original root -->
<logdir>./logs</logdir>
<webroot>./web</webroot>
<adminroot>./admin</adminroot>
<!-- <pidfile>./icecast.pid</pidfile> -->
<!-- Aliases: treat requests for 'source' path as being for 'dest' path
May be made specific to a port or bound address using the "port"
and "bind-address" attributes.
-->
<!--
<alias source="/foo" dest="/bar"/>
-->
<!-- Aliases: can also be used for simple redirections as well,
this example will redirect all requests for http://server:port/ to
the status page
-->
<alias source="/" dest="/status.xsl"/>
</paths>
<logging>
<accesslog>access.log</accesslog>
<errorlog>error.log</errorlog>
<!-- <playlistlog>playlist.log</playlistlog> -->
<loglevel>4</loglevel> <!-- 4 Debug, 3 Info, 2 Warn, 1 Error -->
</logging>
<security>
<chroot>0</chroot>
<!--
<changeowner>
<user>nobody</user>
<group>nogroup</group>
</changeowner>
-->
</security>
</icecast> |
|
| Back to top |
|
 |
karlH Code Warrior

Joined: 13 Jun 2005 Posts: 5476 Location: UK
|
Posted: Sun Nov 13, 2005 2:48 pm Post subject: |
|
|
As I thought, you have commented the mount out, it's not surprising the auth doesn't apply. uncomment and try again.
karl. |
|
| Back to top |
|
 |
Sublime7888 Guest
|
Posted: Sun Nov 13, 2005 3:10 pm Post subject: Very Cool |
|
|
Hey Carl,
It it work - very cool. Two final questions.
1. Is there away to apply a single point point to all the files (songs) located under my web directory or must they be called out individually in separate mount groupings?
2. What is the format for authoring a username / password file? The manual states that this file can be filled in from the web admin page, but the mount mount doesn't appear to be active (non-visible).
- Sublime |
|
| Back to top |
|
 |
karlH Code Warrior

Joined: 13 Jun 2005 Posts: 5476 Location: UK
|
Posted: Sun Nov 13, 2005 5:35 pm Post subject: Re: Very Cool |
|
|
| Sublime7888 wrote: |
It it work - very cool. Two final questions.
1. Is there away to apply a single point point to all the files (songs) located under my web directory or must they be called out individually in separate mount groupings? |
Currently it has to be seperate mount groups, whether something like a regular expression could be used for <mount-name> has yet to be determined. eg <mount-name>/my_music/.*\.ogg</mount-name>
| Quote: |
| 2. What is the format for authoring a username / password file? The manual states that this file can be filled in from the web admin page, but the mount mount doesn't appear to be active (non-visible). |
traditionally the webroot files never appeared on the xsl pages, so yes there is a question of how best to approach this via the web interface, especially if the above mentioned regular expressions are allowed. The format is the same as that used in apache htpasswd (each line username:md5hash).
karl |
|
| Back to top |
|
 |
Sublime7888 Guest
|
Posted: Sun Nov 13, 2005 6:01 pm Post subject: Alrightly Then |
|
|
Hey Carl,
Thanks for the information. I am sure it is obvious what I am trying to do (make my mp3 collection available over the internet and have security applied, so it is restricted to my use). I have looked at other solutions, but none offer the security and ease of use that icecast offers. I thinking that I am not using icecast in the way it was originally intended to be used and I can respect its intended use. I hope your team decides to include the wildcard feature in the future.
- Sublime |
|
| Back to top |
|
 |
|