Private GIT

Skip to content
Snippets Groups Projects
Commit c16c34e4 authored by Nic Wolfe's avatar Nic Wolfe
Browse files

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

parents 9d8a9395 5352bc6e
No related branches found
No related tags found
No related merge requests found
<script type="text/javascript" charset="utf-8"> <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"; sbRoot = "$sbRoot";
sbHttpPort = "$sbHttpPort"; sbHttpPort = "$curSBHttpPort";
sbHttpsEnabled = "$sbHttpsEnabled"; sbHttpsEnabled = "$curSBHttpsEnabled";
sbHost = "$sbHost"; sbHost = "$curSBHost";
//--> //-->
</script> </script>
......
...@@ -124,9 +124,9 @@ class Quality: ...@@ -124,9 +124,9 @@ class Quality:
checkName = lambda list, func: func([re.search(x, name, re.I) for x in list]) 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 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 return Quality.SDDVD
elif checkName(["720p", "hdtv", "x264"], all) or checkName(["hr.ws.pdtv.x264"], any): elif checkName(["720p", "hdtv", "x264"], all) or checkName(["hr.ws.pdtv.x264"], any):
return Quality.HDTV return Quality.HDTV
......
...@@ -503,7 +503,8 @@ def sanitizeSceneName (name, ezrss=False): ...@@ -503,7 +503,8 @@ def sanitizeSceneName (name, ezrss=False):
return name return name
def create_https_certificates(ssl_cert, ssl_key): 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: try:
from OpenSSL import crypto #@UnresolvedImport from OpenSSL import crypto #@UnresolvedImport
......
...@@ -20,12 +20,12 @@ ...@@ -20,12 +20,12 @@
import cherrypy.lib.auth_basic import cherrypy.lib.auth_basic
import os.path import os.path
import sickbeard
from sickbeard import logger from sickbeard import logger
from sickbeard.webserve import WebInterface from sickbeard.webserve import WebInterface
from sickbeard.helpers import create_https_certificates from sickbeard.helpers import create_https_certificates
from cherrypy import _cpserver
from cherrypy import _cpwsgi_server
def initWebServer(options = {}): def initWebServer(options = {}):
options.setdefault('port', 8081) options.setdefault('port', 8081)
...@@ -80,10 +80,14 @@ def initWebServer(options = {}): ...@@ -80,10 +80,14 @@ def initWebServer(options = {}):
if enable_https: if enable_https:
# If either the HTTPS certificate or key do not exist, make some self-signed ones. # 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)): 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)): 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) logger.log(u"Disabled HTTPS because of missing CERT and KEY files", logger.WARNING)
sickbeard.ENABLE_HTTPS = False
enable_https = False enable_https = False
options_dict = { options_dict = {
...@@ -97,8 +101,11 @@ def initWebServer(options = {}): ...@@ -97,8 +101,11 @@ def initWebServer(options = {}):
if enable_https: if enable_https:
options_dict['server.ssl_certificate'] = https_cert options_dict['server.ssl_certificate'] = https_cert
options_dict['server.ssl_private_key'] = https_key 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) cherrypy.config.update(options_dict)
# setup cherrypy logging # setup cherrypy logging
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment