Page 3 of 4

Re: Zeroconf (Bonjour/Avahi) support for HTTP

Posted: May 17th, 2011, 3:01 pm
by sander
fkmtc wrote: Hi all,

I was wondering the status of that "Bonjour" support SABnzbd+... I would love to have that feature in SABnzbd+ !!

I'm the developer of SABMobile and would make very good use of that "auto discovering" of sab :)

Thanks,
Jérôme
AFAIK the status is the same as two years ago:
there is a patch working for Linux (tested by me and a few others). I don't know if it works on Windows; I don't know how to run SABnzbd from source on Windows.
I have the feeling the SAB devs are not very interested in this functionality
I must say I don't know how widely spread bonjour / zeroconf functionality is in the Windows world. I think you have to install "bonjour for Windows" from Apple to *see* bonjour resources.

IMHO bonjour functionality in SAB could be a solution for a lot of questions in this forums: it would take away the problems with IP and port, and it would make clear if SAB is running with more than one instance.

So: do you run Linux? Or Mac? Or Windows with SAB-from-source-code? If so, I can patch 0.6.1 with the bonjour-patch, so that you can test it.

Re: Zeroconf (Bonjour/Avahi) support for HTTP

Posted: May 17th, 2011, 3:09 pm
by fkmtc
Hi,

Thanks for your answer.

In fact, I run SABnzbd+ on my NAS, so QNAP or Synology, depends on which one is launched :) I just use MacOS version and Windows version for testing my application SABMobile.

I guess I'll wait for it to be in an official release...

Thanks,
Jérôme

Re: Zeroconf (Bonjour/Avahi) support for HTTP

Posted: May 17th, 2011, 3:24 pm
by shypike
sander wrote: I have the feeling the SAB devs are not very interested in this functionality
We are, but there so much to be done.
Didn't you have a working solution that we could implement?

Re: Zeroconf (Bonjour/Avahi) support for HTTP

Posted: May 17th, 2011, 3:36 pm
by sander
fkmtc wrote: Hi,

Thanks for your answer.

In fact, I run SABnzbd+ on my NAS, so QNAP or Synology, depends on which one is launched :) I just use MacOS version and Windows version for testing my application SABMobile.

I guess I'll wait for it to be in an official release...

Thanks,
Jérôme
Your NAS probably runs Linux. So I guess that means you could run the patched SABnzbd. First check: can you find sabnzbd.py on your NAS?

As you're a programmer, I think you can handle it. ;-)

Re: Zeroconf (Bonjour/Avahi) support for HTTP

Posted: May 17th, 2011, 3:45 pm
by fkmtc
sander wrote:
fkmtc wrote: Hi,

Thanks for your answer.

In fact, I run SABnzbd+ on my NAS, so QNAP or Synology, depends on which one is launched :) I just use MacOS version and Windows version for testing my application SABMobile.

I guess I'll wait for it to be in an official release...

Thanks,
Jérôme
Your NAS probably runs Linux. So I guess that means you could run the patched SABnzbd. First check: can you find sabnzbd.py on your NAS?

As you're a programmer, I think you can handle it. ;-)
I can handle it, but I don't want to. My aim is to add "Auto discovery" to my application, so that configuration is very simple. This means that the end user will just download my app and try to find its sabnzbd+ server. In that case, this won't be my "patched installation on my private NAS", but the end user installation...

I could use the patch to try out the feature, but can't release that because nobody will be able to use it (well, those with the patch... but if they know how to patch it, they know how to enter the IP address ;-))

Cheers,
Jérôme

Re: Zeroconf (Bonjour/Avahi) support for HTTP

Posted: May 17th, 2011, 4:37 pm
by sander
fkmtc wrote:

I can handle it, but I don't want to. My aim is to add "Auto discovery" to my application, so that configuration is very simple. This means that the end user will just download my app and try to find its sabnzbd+ server. In that case, this won't be my "patched installation on my private NAS", but the end user installation...

I could use the patch to try out the feature, but can't release that because nobody will be able to use it (well, those with the patch... but if they know how to patch it, they know how to enter the IP address ;-))

Cheers,
Jérôme
I understand your point. At the same time, that's in a nutshell the problem with this patch: if even people like you don't start using it, I would it's a signal bonjour is too little value. *If* you would try it, we could get experience, and make it easier to get it into mainstream SAB :-)

Re: Zeroconf (Bonjour/Avahi) support for HTTP

Posted: May 18th, 2011, 12:37 am
by fkmtc
OK, fine :)

Give me the piece of code !

Could you also tell me for which version of SABnzbd+ it would work best ? I currently have 0.5.3 or something, because QNAP guys are a little lazy to make clean packages...

Thanks,
Jérôme

Re: Zeroconf (Bonjour/Avahi) support for HTTP

Posted: May 18th, 2011, 10:59 am
by fkmtc
Hi,

I tried, but it seems that I cannot import pybonjour... might be missing something (I copied it to sabnzbd/utils/). Is there any way to check what the problem might be ?

Thanks,
Jérôme

Re: Zeroconf (Bonjour/Avahi) support for HTTP

Posted: May 18th, 2011, 11:49 am
by sander
fkmtc wrote: Hi,

I tried, but it seems that I cannot import pybonjour... might be missing something (I copied it to sabnzbd/utils/). Is there any way to check what the problem might be ?

Thanks,
Jérôme
Ouch, I now read a quote in the first of this trhead: "pybonjour requires the Bonjour compatibility layer (libavahi-compat-libdnssd1) to be installed.". That could be the problem on your NAS ... :-(

Re: Zeroconf (Bonjour/Avahi) support for HTTP

Posted: May 18th, 2011, 12:02 pm
by sander
FYI:

the bonjour patch works (unmodified) with SABnzbd 0.6.1.  :)

On Ubuntu, you need:
sudo apt-get install libavahi-compat-libdnssd1
pybonjour.py (from http://code.google.com/p/pybonjour/) copied into sabnzbd/utils/

And, you could use "avahi-discover" on Ubuntu to view the bonjour resources

Re: Zeroconf (Bonjour/Avahi) support for HTTP

Posted: May 18th, 2011, 1:24 pm
by fkmtc
Hi,

I've installed avahi, but not the ddns stuff. Is it mandatory ?

I guess the installation of SABnzbd+ might be a lot more complicated if that is needed...

Thanks,
Jérôme

Re: Zeroconf (Bonjour/Avahi) support for HTTP

Posted: May 19th, 2011, 1:10 am
by sander
fkmtc wrote: Hi,

I've installed avahi, but not the ddns stuff. Is it mandatory ?
I don't know. Can your run the patched SABnzbd without the ddns stuff?
fkmtc wrote:
I guess the installation of SABnzbd+ might be a lot more complicated if that is needed...
I realize patching SABnzbd with bonjour would introduce more OS/platform dependency... :-(  

Re: Zeroconf (Bonjour/Avahi) support for HTTP

Posted: May 19th, 2011, 1:39 am
by shypike
I have Bonjour running now for OSX.
Later I will test with Linux and Windows.
The PyBonjour code claims it supports the Windows and Linux solutions too.
We'll see.

Slight disappointment in that Bonjour will not publish "localhost".
So it won't be useful in the default setup of SABnzbd.

Re: Zeroconf (Bonjour/Avahi) support for HTTP

Posted: May 20th, 2011, 5:49 pm
by sander
shypike wrote: I have Bonjour running now for OSX.
Later I will test with Linux and Windows.
The PyBonjour code claims it supports the Windows and Linux solutions too.
We'll see.

Slight disappointment in that Bonjour will not publish "localhost".
So it won't be useful in the default setup of SABnzbd.
I found this quote, maybe helpful:

Code: Select all

The definition for kDNSServiceInterfaceIndexLocalOnly says

* If the client passes kDNSServiceInterfaceIndexLocalOnly when registering
 * a service, then that service will be found *only* by other local clients
 * on the same machine that are browsing using
kDNSServiceInterfaceIndexLocalOnly
 * or kDNSServiceInterfaceIndexAny.

Re: Zeroconf (Bonjour/Avahi) support for HTTP

Posted: June 4th, 2011, 6:13 am
by sander
I just discovered a bug in my code: when HTTPS is enabled in SAB, the service advertised via bonjour is like 'http://:9090/sabnzbd'. Which is an incorrect mix of 'http://:8080/sabnzbd' and 'httpS://:9090/sabnzbd'

The problem is in this part of the code:

Code: Select all

	            regtype = '_http._tcp',
	            port = int(cherryport),
I guess I'll have to look into variables enable_https and https_port, and change the regtype ...

@shypike: if HTTPS is enabled, is there still a way to find out on which plain HTTP is running? It's not in cherryport, as that contains the HTTPS port ...