Icecast Streaming Media Server Forum Index Icecast Streaming Media Server
Icecast is a Xiph Foundation Project
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Virtual on/off switch (maybe using ip ban?)

 
Post new topic   Reply to topic    Icecast Streaming Media Server Forum Index -> Icecast Server
View previous topic :: View next topic  
Author Message
fonce



Joined: 19 Oct 2008
Posts: 4

PostPosted: Sun Oct 19, 2008 1:44 am    Post subject: Virtual on/off switch (maybe using ip ban?) Reply with quote

Hello,

I was wondering if this is feasible, as I tried it and didn't quite get it to work. I saw in another thread something about the deny-ip file being reloaded automatically, but I remain unsure about that. If one has specified a deny-ip file can they simply put a wildcard on the first line to block everyone and then erase it to allow everyone, using that like an on/off switch? And if so, does it check that file any time a client attempts to connect or does it require a kill -HUP `pid` to reload the file? Honestly either works for me, I'm curious for coding purposes.

I wrote a little web control panel that starts and stops icecast like a service but what I really want to add is the ability to, as simply as possible, prevent anyone from connecting when it's "off" and then remove that block when it's "on", if you will. It'd be trivial to write a piece of PHP or Javascript that will add and remove a wildcard to a text file, so it seems like if my theory is sound then this should work fine.

Alternatively, if the allow list functions differently than the ban list, do the same thing but in reverse for an allow-ip file?

Thoughts?
Back to top
View user's profile Send private message
karlH
Code Warrior
Code Warrior


Joined: 13 Jun 2005
Posts: 5476
Location: UK

PostPosted: Sun Oct 19, 2008 3:05 am    Post subject: Reply with quote

In 2.3.2, those files don't take wildcards, I do have it in my branch work so adding and removing wildcards would work there. We don't read through the file each time, we cache the contents into a lookup tree and only reread on mtime updates.

karl.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
fonce



Joined: 19 Oct 2008
Posts: 4

PostPosted: Mon Oct 20, 2008 2:35 pm    Post subject: Reply with quote

Perfect! Thank you very much for your help!
Back to top
View user's profile Send private message
fonce



Joined: 19 Oct 2008
Posts: 4

PostPosted: Mon Oct 20, 2008 2:53 pm    Post subject: Reply with quote

One more question for you: is there an easier way to do this sort of on/off switch or is this a perfectly reasonable way of doing it?
Back to top
View user's profile Send private message
karlH
Code Warrior
Code Warrior


Joined: 13 Jun 2005
Posts: 5476
Location: UK

PostPosted: Mon Oct 20, 2008 3:05 pm    Post subject: Reply with quote

I would think that stopping and starting the process would be better, it removes resources when inactive.

karl.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
fonce



Joined: 19 Oct 2008
Posts: 4

PostPosted: Mon Oct 20, 2008 9:10 pm    Post subject: Reply with quote

Good point. Thanks for your help.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Icecast Streaming Media Server Forum Index -> Icecast Server All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2002 phpBB Group
subRebel style by ktauber