EDIT:
Found it!
In the settings, change the host address of 0.0.0.0 to the local IP of the host, i.e. 192.168.x.xx
Works like a charm
Code: Select all
sander@flappie:~$ curl http://192.168.1.101:8080/doesnotexist
<html>
<head>
<script type="text/javascript">
<!--
location.href = "http://localhost:8080/sabnzbd"
//-->
</script>
</head>
<body><br/></body>
</html>
sander@flappie:~$Code: Select all
def error_page_404(status, message, traceback, version):
""" Custom handler for 404 error, redirect to main page """
import cherrypy
return r'''
<html>
<head>
<script type="text/javascript">
<!--
location.href = "%s"
//-->
</script>
</head>
<body><br/></body>
</html>
''' % cherrypy.wsgiserver.REDIRECT_URL
Code: Select all
$ grep -ir error_page.404 *
sabnzbd/panic.py:def error_page_404(status, message, traceback, version):
SABnzbd.py: 'error_page.404': sabnzbd.panic.error_page_404
Code: Select all
$ grep -ir REDIRECT_URL *
cherrypy/wsgiserver/__init__.py:REDIRECT_URL = None # Application can write it's HTTP-->HTTPS redirection URL here
cherrypy/wsgiserver/__init__.py: if REDIRECT_URL:
cherrypy/wsgiserver/__init__.py: req.simple_response("301 Moved Permanently", REDIRECT_URL)
sabnzbd/panic.py:''' % cherrypy.wsgiserver.REDIRECT_URL
SABnzbd.py: cherrypy.wsgiserver.REDIRECT_URL = browser_urlCode: Select all
if enable_https:
browser_url = "https://%s:%s/sabnzbd" % (browserhost, cherryport)
else:
browser_url = "http://%s:%s/sabnzbd" % (browserhost, cherryport)
cherrypy.wsgiserver.REDIRECT_URL = browser_urlCode: Select all
def error_page_404(status, message, traceback, version):
""" Custom handler for 404 error, redirect to main page """
import cherrypy
return r'''
<html>
<head>
<script type="text/javascript">
<!--
var full = location.protocol+'//'+location.hostname+(location.port ? ':'+location.port: '') + '/sabnzbd/' ;
location.href = full
//-->
</script>
</head>
<body><br/></body>
</html>
'''Code: Select all
sander@flappie:~/git/sabnzbd$ grep -irn browser_url *
sabnzbd/sabtray.py:104: launch_a_browser(sabnzbd.BROWSER_URL, True)
Binary file sabnzbd/__init__.pyo matches
sabnzbd/__init__.py:125:BROWSER_URL = None
sabnzbd/osxmenu.py:671: launch_a_browser(sabnzbd.BROWSER_URL, True)
SABnzbd.py:1511: browser_url = "https://%s:%s/sabnzbd" % (browserhost, cherryport)
SABnzbd.py:1513: browser_url = "http://%s:%s/sabnzbd" % (browserhost, cherryport)
SABnzbd.py:1514: cherrypy.wsgiserver.REDIRECT_URL = browser_url
SABnzbd.py:1516: sabnzbd.BROWSER_URL = browser_url
SABnzbd.py:1518: launch_a_browser(browser_url)
SABnzbd.py:1609: if sabnzbd.cfg.web_watchdog() and not is_sabnzbd_running('%s/api?tickleme=1' % sabnzbd.BROWSER_URL, 120):
sander@flappie:~/git/sabnzbd$