View previous topic :: View next topic |
Author |
Message |
Murrawhip
Joined: 21 Dec 2010 Posts: 58
|
Posted: Wed Mar 21, 2012 10:54 pm Post subject: Mount-specific admin accounts |
|
|
Some source clients, such as SAM Broadcaster presently have an option to retrieve current listener counts from Icecast. It does this by using the admin username + password.
This obviously isn't a good idea when it comes to shared icecast servers, so I figure it'd be swell if you could define admin accounts within the specific mountpoint definitions, and limit the account to actions that affect that mountpoint. |
|
Back to top |
|
|
Murrawhip
Joined: 21 Dec 2010 Posts: 58
|
Posted: Thu Mar 22, 2012 6:13 pm Post subject: |
|
|
As a workaround, I made a file called stats.xml and put it in an 'admin' folder on my webhost. (SAM requires the path to be server:port/admin/stats.xml).
Using .htaccess, I processed the xml file as PHP, and cURLed the real stats.xml from icecast.
Works fine, and I didn't have to give anybody the real admin password. |
|
Back to top |
|
|
karlH Code Warrior
Joined: 13 Jun 2005 Posts: 5476 Location: UK
|
Posted: Thu Mar 22, 2012 6:28 pm Post subject: |
|
|
the per-mount stats are available using the source user/pass in the kh tree, including listener details. most of the stats are also available in the webroot pages by just supplying mount= as an arg
karl. |
|
Back to top |
|
|
Murrawhip
Joined: 21 Dec 2010 Posts: 58
|
Posted: Thu Mar 22, 2012 7:30 pm Post subject: |
|
|
Unfortunately SAM doesn't give you any choice when it comes to that, which is why I needed to do this. It doesn't even allow you to use a username other than 'source' for the encoder. |
|
Back to top |
|
|
karlH Code Warrior
Joined: 13 Jun 2005 Posts: 5476 Location: UK
|
Posted: Thu Mar 22, 2012 8:37 pm Post subject: |
|
|
I don't know what the possibilities are to work around this without trying it against the app. If no mountpoint is given then how do you decide which stats to retrieve. You could use alias to redirect to a mountpoint that could do something via auth url but what options are available to you.
karl. |
|
Back to top |
|
|
Murrawhip
Joined: 21 Dec 2010 Posts: 58
|
Posted: Thu Mar 22, 2012 9:05 pm Post subject: |
|
|
karlH wrote: |
If no mountpoint is given then how do you decide which stats to retrieve. |
SAM asks for the mountpoint when you set this up. |
|
Back to top |
|
|
karlH Code Warrior
Joined: 13 Jun 2005 Posts: 5476 Location: UK
|
Posted: Thu Mar 22, 2012 10:26 pm Post subject: |
|
|
I agree, SAM does know the mountpoint, but what makes you think icecast knows which mountpoint stats SAM wants if the name is not passed? easy in the case of 1 stream, if there are 100 streams then which?
karl. |
|
Back to top |
|
|
Murrawhip
Joined: 21 Dec 2010 Posts: 58
|
Posted: Thu Mar 22, 2012 10:58 pm Post subject: |
|
|
SAM downloads the entire stats.xml, then looks through it for the mountpoint you specify. If said mountpoint doesn't exist, it throws an error.
My feature request for mount-specific admin accounts would mean, I guess, that when stats.xml is accessed with an admin account that is defined in a <mount> block, it only includes that mount. (And doesn't allow admin functions on any mount that it isn't defined in, within the web interface.)
It's difficult to explain, and probably a bit too complicated. I don't require it now that I have the workaround, though. |
|
Back to top |
|
|
karlH Code Warrior
Joined: 13 Jun 2005 Posts: 5476 Location: UK
|
Posted: Fri Mar 23, 2012 1:27 am Post subject: |
|
|
The fact that it is difficult to explain would indicate that it would be next to impossible to implement. /admin access using source auth has always been allowed for metadata updates for example, but defining some sort of per-mount setting so that only those mountpoints would be included on a stats.xml sounds like trying to work around an old fixed problem.
karl. |
|
Back to top |
|
|
greatmenjmt
Joined: 18 Jan 2012 Posts: 23
|
Posted: Wed Apr 18, 2012 8:50 pm Post subject: |
|
|
karlH wrote: |
the per-mount stats are available using the source user/pass in the kh tree, including listener details. most of the stats are also available in the webroot pages by just supplying mount= as an arg
karl. |
hi karl. how do i access to such stats per mount using source user/pass, i mean beside the ones you can find this way: http://ip:port/status.xsl?mount=/xxxxxxxx
would be great if icecast could allow (on a shared server) users to administrate his/her mount by letting them access to a admin zone which include only his mount/stream beside the server admin zone that let the server admin to handle all. |
|
Back to top |
|
|
karlH Code Warrior
Joined: 13 Jun 2005 Posts: 5476 Location: UK
|
Posted: Thu Apr 19, 2012 12:38 am Post subject: |
|
|
in the kh tree, you can use many of the admin routines with source user pass, certainly the stats /admin/stats and the xsl pages, you do need to provide the ?mount=/.... though or else icecast will assume the request is for all mounts.
karl. |
|
Back to top |
|
|
greatmenjmt
Joined: 18 Jan 2012 Posts: 23
|
Posted: Thu Apr 19, 2012 12:51 am Post subject: |
|
|
karlH wrote: |
in the kh tree, you can use many of the admin routines with source user pass, certainly the stats /admin/stats and the xsl pages, you do need to provide the ?mount=/.... though or else icecast will assume the request is for all mounts.
karl. |
but how do i introduce the source user/pass to access such features? or if is trough the url in what format to doit? |
|
Back to top |
|
|
karlH Code Warrior
Joined: 13 Jun 2005 Posts: 5476 Location: UK
|
Posted: Thu Apr 19, 2012 1:50 pm Post subject: |
|
|
as with any auth passed into a url, either in the url form of
http://user:pass@host:port/....
or if you are dealing at the lower level of http then send the header
Authorization: Basic ....
karl. |
|
Back to top |
|
|
|