Instead of Host field: check box for "make accessible from other computers"

Want something added? Ask for it here.
Post Reply
User avatar
sander
Release Testers
Release Testers
Posts: 9062
Joined: January 22nd, 2008, 2:22 pm

Instead of Host field: check box for "make accessible from other computers"

Post by sander »

Hi,

A feature suggestion:

At this moment (SABnzbd 0.4.6 and earlier) you have to replace "localhost" with "0.0.0.0" in the Host field to make SABnzbd accessible from other computers.
This is a technical thing (to a user there is no useful info in "0.0.0.0"), and a lot of questions/problems in the help forum are caused by this.

So my suggestion is:
Remove the Host field.
Keep SABnzbd default only locally accessible (underlying: "localhost") out of security / privacy considerations. Same as now.
Introduce a checkbox "make accessible from other computers". If the owner checks that checkbox, SAB will fill out "0.0.0.0" in sabnzbd.ini. Furthermore, it could be impressively useful if SABnzbd would then present the full URLs under which SABnzbd is then accessible, so http://192.168.1.38:8080/sabnzbd/ and http://[fe80::218:deff:fe10:c512]:8080/sabnzbd/ and http://[2001:0:53aa:64c:2860:ced1:ad55:e85a]:8080/sabnzbd/ . The user could then just click and copy those URLs to check and use the remote Web functionality.

I think this setup would be easier and less error-prone.
Last edited by sander on January 1st, 2009, 2:39 pm, edited 1 time in total.
If you like our support, check our special newsserver deal or donate at: https://sabnzbd.org/donate
Eejit
Sr. Member
Sr. Member
Posts: 267
Joined: September 10th, 2008, 5:46 pm

Re: Instead of Host field: check box for "make accessible from other computers"

Post by Eejit »

I wouldn't have a problem with this suggestion as long as the port number could be changed.
The SABnzdb default, for me, is not usable, so I have another selected
Eejit - The name say's it all !!
Image
User avatar
shypike
Administrator
Administrator
Posts: 19774
Joined: January 18th, 2008, 12:49 pm

Re: Instead of Host field: check box for "make accessible from other computers"

Post by shypike »

I'll think about it.

There are several situations where the user must really specify the host address
(multiple interfaces, host name doesn't resolve properly).

"Presenting" is addresses is a bit awkward.
On a local system, the browser will be launched, so you already know which URI is used.
In a server situation, where would SABnzbd rreport the URI-s?

Summarizing. Yes, some improvements would help here, but it isn't as simple as you suggest.
User avatar
sander
Release Testers
Release Testers
Posts: 9062
Joined: January 22nd, 2008, 2:22 pm

Re: Instead of Host field: check box for "make accessible from other computers"

Post by sander »

@Eejit:
In my suggested setup, the Port field is still there. Only the Host field is replaced by a check box. (And as an extra, SABnzbd will the show the URLs you can use to access it.)
If you like our support, check our special newsserver deal or donate at: https://sabnzbd.org/donate
User avatar
sander
Release Testers
Release Testers
Posts: 9062
Joined: January 22nd, 2008, 2:22 pm

Re: Instead of Host field: check box for "make accessible from other computers"

Post by sander »

shypike wrote: I'll think about it.

There are several situations where the user must really specify the host address
(multiple interfaces, host name doesn't resolve properly).
Only if you want to restrict access to a certain interface, you would specify an IP address. Correct?
When do you need a hostname (other than 'localhost')? Also if you want to restrict access?

FWIW: I myself have never specified anything else than 0.0.0.0, and I've got a lot of interfaces (5 on this machine).
shypike wrote:
"Presenting" is addresses is a bit awkward.
On a local system, the browser will be launched, so you already know which URI is used.
Indeed. In the case of only local access (so: having the check box empty), I would even not display an URL at all.
shypike wrote:
In a server situation, where would SABnzbd rreport the URI-s?
By "server situation", you mean non-local access. If so: On the same webGUI page as the config, so Config -> General.
shypike wrote: Summarizing. Yes, some improvements would help here, but it isn't as simple as you suggest.
Thanks.
If you like our support, check our special newsserver deal or donate at: https://sabnzbd.org/donate
User avatar
shypike
Administrator
Administrator
Posts: 19774
Joined: January 18th, 2008, 12:49 pm

Re: Instead of Host field: check box for "make accessible from other computers"

Post by shypike »

sander wrote: Indeed. In the case of only local access (so: having the check box empty), I would even not display an URL at all.
How useful is showing the URI in the Web interface?
Apparently you already know the correct URI, because you wouldn't see the Web interface otherwise.
User avatar
sander
Release Testers
Release Testers
Posts: 9062
Joined: January 22nd, 2008, 2:22 pm

Re: Instead of Host field: check box for "make accessible from other computers"

Post by sander »

shypike wrote:
sander wrote: Indeed. In the case of only local access (so: having the check box empty), I would even not display an URL at all.
How useful is showing the URI in the Web interface?
Apparently you already know the correct URI, because you wouldn't see the Web interface otherwise.
On the local machine, the URL is obvious: http://localhost:8080/sabnzbd/ and should not be presented.

However, from that point on, it's unclear for a lot of users how to access that machine/interface from *other* computers. How can they find out the IP address (or name) and the correct URL / URI? That's not an obvious task for normal users. People should use (/sbin/)ifconfig or ipconfig to find their IP address and copy-pate into a URL. And they should do this each time, as the IPv4 address can change due to DHCP.

See user question for example here: http://forums.sabnzbd.org/index.php?topic=1565 and in lesser extent http://forums.sabnzbd.org/index.php?topic=1578


So, if the obvious interface http://localhost:8080/sabnzbd/ would present the URLs under which that interface is accessible for other computers, that would be helpful.

As an example, in my case these URLs for remote access would be presented:

http://192.168.1.36:8080/sabnzbd/ for old skool IPv4 access
http://[fe80::79da:502b:44bc:ff99]:8080/sabnzbd/ local IPv6 address, not subject to DHCP, always the same
http://[2001:0:d5c7:a2ca:248b:9277:ad55:e85c]:8080/sabnzbd/ global IPv6 address, handy for global, remote management.


The user can then check the functionality of these URLs by just clicking, and then copy-paste them (via mail or IM) to her/his other machine.

I think this would make SABnzbd easier to handle.
If you like our support, check our special newsserver deal or donate at: https://sabnzbd.org/donate
User avatar
sander
Release Testers
Release Testers
Posts: 9062
Joined: January 22nd, 2008, 2:22 pm

Re: Instead of Host field: check box for "make accessible from other computers"

Post by sander »

FWIW: I did some scripting / filter exercises to see how a system can discover and present the SABnzbd URLs:

On (Ubuntu) Linux:

Code: Select all

sander@flappie:~$ /sbin/ifconfig | grep addr: | sed -e 's/.*addr: *//' | sed -e  's/[\/ ].*//' | grep -vi 127.0.0.1 | grep -vi ::1 | awk '{ print "http://" $1 ":8080/sabnzbd/"  }' | sort
http://192.168.1.34:8080/sabnzbd/
http://2001:0:53aa:64c:2864:bfdd:3c0e:67f6:8080/sabnzbd/
http://fe80::218:deff:fe10:c506:8080/sabnzbd/
http://fe80::ffff:ffff:ffff:8080/sabnzbd/
sander@flappie:~$

The ipconfig output of Vista:


Code: Select all

sander@flappie:~$ cat ipconfig.vista.txt  | grep -i IPv | sed  -e  's/.*: //' | sed -e  's/%.*//'  | awk '{ print "http://" $1 ":8080/sabnzbd/"  }' | sort 
http://192.168.1.36:8080/sabnzbd/
http://2001:0:d5c7:a2ca:248b:9277:ad55:e84b:8080/sabnzbd/
http://fe80::248b:9277:ad55:e84b:8080/sabnzbd/
http://fe80::79da:502b:44bc:ff82:8080/sabnzbd/
sander@flappie:~$
Remark: I'm not sure this works for all language versions of Vista; I search for the string "IPv" (of IPv4 and IPv6). I don't know if that string is there in Afrikaans and Vietnamese, for example.

I guess these filters must have python equivalents.
If you like our support, check our special newsserver deal or donate at: https://sabnzbd.org/donate
User avatar
sander
Release Testers
Release Testers
Posts: 9062
Joined: January 22nd, 2008, 2:22 pm

Re: Instead of Host field: check box for "make accessible from other computers"

Post by sander »

Some more exercises, now python regexp stuff to find IPv4 resp IPv6 addresses, which works for both Linux ifconfig and Vista ipconfig output alike:

Code: Select all

sander@flappie:~$ python
Python 2.5.2 (r252:60911, Jul 31 2008, 17:28:52) 
[GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import re

>>> inet4 =  re.compile('[0-9.]+')

>>> inet4.findall('          inet addr:127.0.0.1  Mask:255.0.0.0')
['127.0.0.1', '255.0.0.0']


>>> inet6 =  re.compile('[0-9a-f]+:[0-9a-f]*:[0-9a-f:]+')

>>> inet6.findall('          inet6 addr: 2001:0:53aa:64c:2864:bfdd:3c0e:67f6/32 Scope:Global')
['2001:0:53aa:64c:2864:bfdd:3c0e:67f6']
>>> inet6.findall('          inet6 addr: 2001::1/32 Scope:Global')
['2001::1']
>>> inet6.findall('             Link-local IPv6 Address . . . . . : fe80::79da:502b:44bc:ff82%12')
['fe80::79da:502b:44bc:ff82']
>>> inet6.findall('              Default Gateway . . . . . . . . . : ::')
[]
>>>
If you like our support, check our special newsserver deal or donate at: https://sabnzbd.org/donate
User avatar
sander
Release Testers
Release Testers
Posts: 9062
Joined: January 22nd, 2008, 2:22 pm

Re: Instead of Host field: check box for "make accessible from other computers"

Post by sander »

I've edited my local ~/SABnzbd-0.4.6/interfaces/Default/templates/config_general.tmpl with some hard-coding to give an idea of possible output of the URLs.

Disclaimer: this is just some hard-coding to get the resulting GUI idea. It's not the real stuff. The check box is not implemented.
If you like our support, check our special newsserver deal or donate at: https://sabnzbd.org/donate
User avatar
sander
Release Testers
Release Testers
Posts: 9062
Joined: January 22nd, 2008, 2:22 pm

Re: Instead of Host field: check box for "make accessible from other computers"

Post by sander »

Some more exercises: a small, clean python script to find the IP address from both ifconfig and ipconfig:

Code: Select all

from commands import *
import re


def find_ip_addresses(command):

	ifconfig=getoutput(command)
	# print "raw stuff:"
	# print ifconfig

	print "IP addresses found:"
	inet4 =  re.compile('[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+')
	print inet4.findall(ifconfig)

	inet6 =  re.compile('[0-9a-f]+:[0-9a-f]*:[0-9a-f:]+')
	print inet6.findall(ifconfig)

### end of def find_ip_addresses


print "Let's go:"
find_ip_addresses('/sbin/ifconfig | grep addr:')
find_ip_addresses('cat ipconfig.vista.txt')  # should be 'ipconfig'
print "Ready"
This results in finding the IPv4 and IPv6 addresses from both Linux and Windows Vista:

Code: Select all

sander@flappie:~/mijn-python$ python ikke.py 
Let's go:

IP addresses found:
['127.0.0.1', '255.0.0.0', '192.168.1.34', '192.168.1.255', '255.255.255.0']
['fe80::ffff:ffff:ffff', '2001:0:53aa:64c:2864:bfdd:3c0e:67f6', 'fe80::218:deff:fe10:c506']

IP addresses found:
['192.168.1.36', '255.255.255.0', '192.168.1.254']
['fe80::79da:502b:44bc:ff82', '2001:0:d5c7:a2ca:248b:9277:ad55:e84b', 'fe80::248b:9277:ad55:e84b']

Ready
sander@flappie:~/mijn-python$
It's not yet perfect (it finds the IPv4 masks and broadcast addresses), but a nice start, I would say.
If you like our support, check our special newsserver deal or donate at: https://sabnzbd.org/donate
User avatar
sander
Release Testers
Release Testers
Posts: 9062
Joined: January 22nd, 2008, 2:22 pm

Re: Instead of Host field: check box for "make accessible from other computers"

Post by sander »

@pair of dimes:

I like your idea of Local/Remote/Other (or Manual). What do you think of this summary:

Option: Local
Host value in sabnzbd.ini: "localhost"
Presentation: no extra info

Option: Remote
Host value in sabnzbd.ini: "0.0.0.0"
Presentation: overview of all URLs (non-editable)

Option: Other (or Manual)
Host value in sabnzbd.ini: as specificied by user. Could be "192.168.2.60". See here:
Presentation: edit box with value of host in sabnzbd.ini filled out, editable by user
Last edited by sander on January 2nd, 2009, 6:37 pm, edited 1 time in total.
If you like our support, check our special newsserver deal or donate at: https://sabnzbd.org/donate
User avatar
thaylok
Newbie
Newbie
Posts: 29
Joined: November 20th, 2008, 11:39 am

Re: Instead of Host field: check box for "make accessible from other computers"

Post by thaylok »

How about thoose of us that have multiple eth devices? Without the manual ip option sabnzbd would be a hassle to configure.
I would need to bridge my network interfaces if SAB choose the wrong one, and then apply ipchains rules to block all traffic between them other than usenet and sab itself. (On my debian box I have inet and localnet seperated)

IMHO: I don't really think the configuration can get much easier than it is right now,
and those who can't understand it need to read up on their basic skills...
User avatar
sander
Release Testers
Release Testers
Posts: 9062
Joined: January 22nd, 2008, 2:22 pm

Re: Instead of Host field: check box for "make accessible from other computers"

Post by sander »

thaylok wrote: How about thoose of us that have multiple eth devices? Without the manual ip option sabnzbd would be a hassle to configure.
The third option "Other" (or Manual) would be the same option as the current Host-field: you can fill out whatever you want.
If you like our support, check our special newsserver deal or donate at: https://sabnzbd.org/donate
Post Reply