Permalink
Browse files

Merge branch 'master' of github.com:midgetspy/Sick-Beard into windows…

…_binaries
  • Loading branch information...
2 parents 9d8a939 + 5352bc6 commit c16c34e418d47000a75e1adf8e35a6d6ce41ff83 @midgetspy midgetspy committed Feb 25, 2012
Showing with 28 additions and 11 deletions.
  1. +12 −3 data/interfaces/default/restart_bare.tmpl
  2. +2 −2 sickbeard/common.py
  3. +2 −1 sickbeard/helpers.py
  4. +12 −5 sickbeard/webserveInit.py
@@ -1,9 +1,18 @@
<script type="text/javascript" charset="utf-8">
<!--
+#try:
+ #set curSBHost = $sbHost
+ #set curSBHttpPort = $sbHttpPort
+ #set curSBHttpsEnabled = $sbHttpsEnabled
+#except NameMapper.NotFound:
+ #set curSBHost = "localhost"
+ #set curSBHttpPort = $sickbeard.WEB_PORT
+ #set curSBHttpsEnabled = "False"
+#end try
sbRoot = "$sbRoot";
-sbHttpPort = "$sbHttpPort";
-sbHttpsEnabled = "$sbHttpsEnabled";
-sbHost = "$sbHost";
+sbHttpPort = "$curSBHttpPort";
+sbHttpsEnabled = "$curSBHttpsEnabled";
+sbHost = "$curSBHost";
//-->
</script>
View
@@ -124,9 +124,9 @@ def nameQuality(name):
checkName = lambda list, func: func([re.search(x, name, re.I) for x in list])
- if checkName(["pdtv.xvid", "hdtv.xvid", "dsr.xvid", "hdtv.x264"], any) and not checkName(["720p", "1080p", "1080i"], any):
+ if checkName(["(pdtv|hdtv|dsr)\.(xvid|x264)"], all) and not checkName(["(720|1080)[pi]"], all):
return Quality.SDTV
- elif checkName(["dvdrip.xvid", "bdrip.xvid", "dvdrip.divx", "dvdrip.ws.xvid"], any) and not checkName(["720p"], all):
+ elif checkName(["(dvdrip|bdrip)(\.ws)?\.(xvid|divx|x264)"], any) and not checkName(["(720|1080)[pi]"], all):
return Quality.SDDVD
elif checkName(["720p", "hdtv", "x264"], all) or checkName(["hr.ws.pdtv.x264"], any):
return Quality.HDTV
View
@@ -503,7 +503,8 @@ def sanitizeSceneName (name, ezrss=False):
return name
def create_https_certificates(ssl_cert, ssl_key):
- """ Create self-signed HTTPS certificares and store in paths 'ssl_cert' and 'ssl_key'
+ """
+ Create self-signed HTTPS certificares and store in paths 'ssl_cert' and 'ssl_key'
"""
try:
from OpenSSL import crypto #@UnresolvedImport
View
@@ -20,12 +20,12 @@
import cherrypy.lib.auth_basic
import os.path
+import sickbeard
+
from sickbeard import logger
from sickbeard.webserve import WebInterface
from sickbeard.helpers import create_https_certificates
-from cherrypy import _cpserver
-from cherrypy import _cpwsgi_server
def initWebServer(options = {}):
options.setdefault('port', 8081)
@@ -80,10 +80,14 @@ def http_error_404_hander(status, message, traceback, version):
if enable_https:
# If either the HTTPS certificate or key do not exist, make some self-signed ones.
if not (https_cert and os.path.exists(https_cert)) or not (https_key and os.path.exists(https_key)):
- create_https_certificates(https_cert, https_key)
+ if not create_https_certificates(https_cert, https_key):
+ logger.log(u"Unable to create cert/key files, disabling HTTPS")
+ sickbeard.ENABLE_HTTPS = False
+ enable_https = False
if not (os.path.exists(https_cert) and os.path.exists(https_key)):
logger.log(u"Disabled HTTPS because of missing CERT and KEY files", logger.WARNING)
+ sickbeard.ENABLE_HTTPS = False
enable_https = False
options_dict = {
@@ -92,13 +96,16 @@ def http_error_404_hander(status, message, traceback, version):
'log.screen': False,
'error_page.401': http_error_401_hander,
'error_page.404': http_error_404_hander,
- }
+ }
if enable_https:
options_dict['server.ssl_certificate'] = https_cert
options_dict['server.ssl_private_key'] = https_key
+ protocol = "https"
+ else:
+ protocol = "http"
- logger.log(u"Starting Sick Beard on http://" + str(options['host']) + ":" + str(options['port']) + "/")
+ logger.log(u"Starting Sick Beard on "+protocol+"://" + str(options['host']) + ":" + str(options['port']) + "/")
cherrypy.config.update(options_dict)
# setup cherrypy logging

0 comments on commit c16c34e

Please sign in to comment.