Commit 7f8c9ab1 authored by echel0n's avatar echel0n
Browse files

Merge branch 'release/10.0.28'

parents c586f861 fe00cde2
......@@ -2,8 +2,14 @@
 
All notable changes to this project will be documented in this file. Dates are displayed in UTC.
 
#### [10.0.28](https://git.sickrage.ca/SiCKRAGE/sickrage/compare/10.0.27...10.0.28)
- web ssl certificate/key locations and filenames are now hard-coded [`60d6bc3`](https://git.sickrage.ca/SiCKRAGE/sickrage/commit/60d6bc367c9f94e75ad9bb3ec5ccec3ddaa8da85)
#### [10.0.27](https://git.sickrage.ca/SiCKRAGE/sickrage/compare/10.0.26...10.0.27)
 
> 5 August 2021
- Fixed issues with checksum checks [`0bc9b08`](https://git.sickrage.ca/SiCKRAGE/sickrage/commit/0bc9b0819fb72b8b0701107f3f36ec10746c1490)
- Fixed issues with checksum checks [`8d8d12e`](https://git.sickrage.ca/SiCKRAGE/sickrage/commit/8d8d12e37c5dff3f0d5d5fc7bb5fb4c05b18e881)
 
......
{
"name": "sickrage",
"version": "10.0.27",
"version": "10.0.28",
"private": true,
"repository": {
"type": "git",
......
[bumpversion]
current_version = 10.0.27
current_version = 10.0.28
commit = False
tag = False
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(\.(?P<release>[a-z]+)(?P<dev>\d+))?
......
......@@ -19,7 +19,7 @@
# along with SiCKRAGE. If not, see <http://www.gnu.org/licenses/>.
# ##############################################################################
__version__ = "10.0.27"
__version__ = "10.0.28"
__install_type__ = ""
import argparse
......
sickrage/version.txt = b3a722d9b54f9cd014dc09563c8bd974
sickrage/version.txt = 00c344fbe6cade72ce48ee2bff2b1f39
sickrage/checksums.md5 = d41d8cd98f00b204e9800998ecf8427e
sickrage/__init__.py = 6faeca8a25699d5243789f45186fab8e
sickrage/__init__.py = f08b01e5320a970acb13e7ee5d817618
sickrage/autoProcessTV/mediaToSiCKRAGE.py = f88a6679a211b1f97126c116e2c33b9c
sickrage/autoProcessTV/hellaToSiCKRAGE.py = 9bc477abfd456aaba8d6bf46f2c59b1f
sickrage/autoProcessTV/__init__.py = bfa892dee586740a3a618d3c1955156c
......@@ -264,7 +264,7 @@ sickrage/core/ui.py = bc530df3dcdf73126f22b7c5719641be
sickrage/core/classes.py = ca0d7c07b684b8fe22788346dc755fd8
sickrage/core/blackandwhitelist.py = 9d0a8e2aae2353a842306730c2690c2c
sickrage/core/common.py = 8eca84658272c806858b105179285693
sickrage/core/__init__.py = a4ec20386e16b6e8e44cafee458d8bca
sickrage/core/__init__.py = 5e75c7a35d61f707a379959953575595
sickrage/core/upnp.py = 51eb609bd1f59baa3c0c346d5ac19787
sickrage/core/google_drive.py = 0129b53b8a649fa7c55bfe0c5ad11bdb
sickrage/core/media/fanart.py = e9a4232ff01ef3473e628e3eecf80e6c
......@@ -288,10 +288,10 @@ sickrage/core/helpers/metadata.py = 65108aa990c8bb0218cde3e0834e715c
sickrage/core/logger/__init__.py = 1d7a61b5c2a9465ec9f947adb4d0e9d1
sickrage/core/exceptions/__init__.py = bb106687a1cb41cf0da10e125e0c82c7
sickrage/core/websession/__init__.py = 6d3d11bec0c0855e08a4c8f2cb6b759e
sickrage/core/config/helpers.py = 8d8d00e7e7b4f04d91ce099245deb13a
sickrage/core/config/helpers.py = 8d0d9e502b0fa5eff071558ca0f496d3
sickrage/core/config/__init__.py = de29a2b668fe871cda8103664adc8853
sickrage/core/amqp/__init__.py = cc99abacdc1d2faf46071e03c75af2a0
sickrage/core/webserver/__init__.py = 4a3aa6da4015cdc5ece9fcd7ed4b2c91
sickrage/core/webserver/__init__.py = 8e97a9492ac39f6ad3cfdf4b53257acd
sickrage/core/webserver/static/images/bootstrap-formhelpers-countries.flags.png = 8404ee935503dfec7a38ffe093f73e05
sickrage/core/webserver/static/images/poster-thumb.png = b788e8476ff0a2d3dfca0eb1d31bab58
sickrage/core/webserver/static/images/sickrage-subtitles.png = adc2bc36d6ce96731911947cabb3bf78
......@@ -340,8 +340,8 @@ sickrage/core/webserver/static/fonts/fa-regular-400.ttf = 1a78af4105d4d56e6c34f7
sickrage/core/webserver/static/fonts/fa-brands-400.eot = 0fabb6606be4c45acfeedd115d0caca4
sickrage/core/webserver/static/fonts/fa-solid-900.svg = 03ba7cb710104df27f1c9c46d64bee4e
sickrage/core/webserver/static/css/core.min.css = 05ca1e9c48f013d71d97ecec458b9f76
sickrage/core/webserver/static/js/core.js.map = 86f41e803a85ece7fa20970e95c916ea
sickrage/core/webserver/static/js/core.min.js = 97cd884a5c9a00f9a94d96a93ad2e113
sickrage/core/webserver/static/js/core.js.map = 233b9bebf171630a82339322f552b3e0
sickrage/core/webserver/static/js/core.min.js = 89f7c045a61bb7e07ee9c8825c64559e
sickrage/core/webserver/views/schedule.mako = 1492940accef5afe80d9cbd14be1c078
sickrage/core/webserver/views/history.mako = a90a54341918b398eb652d186a636952
sickrage/core/webserver/views/generic_message.mako = 20ba53fc129c1b69d5b8ccc960233757
......@@ -358,7 +358,7 @@ sickrage/core/webserver/views/config/search.mako = 3d2c6d0f8b771cb67f3c8967d333c
sickrage/core/webserver/views/config/providers.mako = 556665f3cf48dcfd1047377d2896af22
sickrage/core/webserver/views/config/backup_restore.mako = fceae0a471cb0df3477f24f8d35de574
sickrage/core/webserver/views/config/subtitles.mako = 2bbf1cf91683bf5f8e50cdfad7708ad3
sickrage/core/webserver/views/config/general.mako = d05cc3c89781793bedc22361fa631ac8
sickrage/core/webserver/views/config/general.mako = 21d2129c6bd273cb247a015e899fe9f0
sickrage/core/webserver/views/config/notifications.mako = 929ec6cdc94d34ce4906b413e8bfa105
sickrage/core/webserver/views/config/quality_settings.mako = c4fd4793b475aa8aafdaac0444390a43
sickrage/core/webserver/views/errors/500.mako = dde078ba1d942aedf9e94afca17ce314
......@@ -408,7 +408,7 @@ sickrage/core/webserver/handlers/login.py = 77457b9466f66add2d09fed70a77356a
sickrage/core/webserver/handlers/google_drive.py = 98fde470e65096ec71a8e3f1cce2bd44
sickrage/core/webserver/handlers/config/subtitles.py = 73b0155c03e43a895e3456a83f6f5558
sickrage/core/webserver/handlers/config/quality_settings.py = 6a2849c97b8635d46a92b758ba641428
sickrage/core/webserver/handlers/config/general.py = 6ced8e7cdfb4e10e391206ba314378fc
sickrage/core/webserver/handlers/config/general.py = 74657b6581a7d81e624d17cdf381c00f
sickrage/core/webserver/handlers/config/postprocessing.py = 85f89d663c651279cf9b589d8934431a
sickrage/core/webserver/handlers/config/backup_restore.py = 5dc47bafd0e7f842930ae31bcac234e2
sickrage/core/webserver/handlers/config/anime.py = b30c5a43317e9bc2fde98493364391f1
......
......@@ -97,6 +97,9 @@ class Core(object):
self.gui_views_dir = os.path.join(sickrage.PROG_DIR, 'core', 'webserver', 'views')
self.gui_app_dir = os.path.join(sickrage.PROG_DIR, 'core', 'webserver', 'app')
self.https_cert_file = None
self.https_key_file = None
self.trakt_api_key = '5c65f55e11d48c35385d9e8670615763a605fad28374c8ae553a7b7a50651ddd'
self.trakt_api_secret = 'b53e32045ac122a445ef163e6d859403301ffe9b17fb8321d428531b69022a82'
self.trakt_app_id = '4562'
......@@ -338,6 +341,10 @@ class Core(object):
# set socket timeout
socket.setdefaulttimeout(self.config.general.socket_timeout)
# set ssl cert/key filenames
self.https_cert_file = os.path.abspath(os.path.join(self.data_dir, 'server.crt'))
self.https_key_file = os.path.abspath(os.path.join(self.data_dir, 'server.key'))
# setup logger settings
self.log.logSize = self.config.general.log_size
self.log.logNr = self.config.general.log_nr
......@@ -658,7 +665,7 @@ class Core(object):
self.log.info(f"SiCKRAGE :: DATABASE TYPE:[{self.db_type}]")
self.log.info(f"SiCKRAGE :: INSTALL TYPE:[{self.version_updater.updater.type}]")
self.log.info(
f"SiCKRAGE :: URL:[{('http', 'https')[self.config.general.enable_https]}://{(get_internal_ip(), self.web_host)[self.web_host != '']}:{self.config.general.web_port}/{self.config.general.web_root}]")
f"SiCKRAGE :: URL:[{('http', 'https')[self.config.general.enable_https]}://{(get_internal_ip(), self.web_host)[self.web_host not in ['', '0.0.0.0']]}:{self.config.general.web_port}/{self.config.general.web_root.lstrip('/')}]")
def launch_browser(self):
if not self.no_launch and self.config.general.launch_browser:
......
......@@ -183,50 +183,6 @@ def change_unrar_tool(unrar_tool):
sickrage.app.log.info('Disabling UNPACK setting because no unrar is installed.')
sickrage.app.config.general.unpack = False
def change_https_cert(https_cert):
"""
Replace HTTPS Certificate file path
:param https_cert: path to the new certificate file
:return: True on success, False on failure
"""
if https_cert == '':
sickrage.app.config.general.https_cert = ''
return True
if os.path.normpath(sickrage.app.config.general.https_cert) != os.path.normpath(https_cert):
if make_dir(os.path.dirname(os.path.abspath(https_cert))):
sickrage.app.config.general.https_cert = os.path.normpath(https_cert)
sickrage.app.log.info("Changed https cert path to " + https_cert)
else:
return False
return True
def change_https_key(https_key):
"""
Replace HTTPS Key file path
:param https_key: path to the new key file
:return: True on success, False on failure
"""
if https_key == '':
sickrage.app.config.general.https_key = ''
return True
if os.path.normpath(sickrage.app.config.general.https_key) != os.path.normpath(https_key):
if make_dir(os.path.dirname(os.path.abspath(https_key))):
sickrage.app.config.general.https_key = os.path.normpath(https_key)
sickrage.app.log.info("Changed https key path to " + https_key)
else:
return False
return True
def change_nzb_dir(nzb_dir):
"""
Change NZB blackhole directory
......
......@@ -485,7 +485,7 @@ class WebServer(object):
ssl_ctx = None
if sickrage.app.config.general.enable_https:
ssl_ctx = ssl.create_default_context(ssl.Purpose.CLIENT_AUTH)
ssl_ctx.load_cert_chain(sickrage.app.config.general.https_cert, sickrage.app.config.general.https_key)
ssl_ctx.load_cert_chain(sickrage.app.https_cert_file, sickrage.app.https_key_file)
# Web Server
self.server = HTTPServer(self.app, ssl_options=ssl_ctx, xheaders=sickrage.app.config.general.handle_reverse_proxy)
......@@ -503,30 +503,30 @@ class WebServer(object):
def load_ssl_certificate(self, certificate=None, private_key=None):
if certificate and private_key:
with open(sickrage.app.config.general.https_cert, 'w') as cert_out:
with open(sickrage.app.https_cert_file, 'w') as cert_out:
cert_out.write(certificate)
with open(sickrage.app.config.general.https_key, 'w') as key_out:
with open(sickrage.app.https_key_file, 'w') as key_out:
key_out.write(private_key)
else:
if os.path.exists(sickrage.app.config.general.https_key) and os.path.exists(sickrage.app.config.general.https_cert):
if os.path.exists(sickrage.app.https_key_file) and os.path.exists(sickrage.app.https_cert_file):
if self.is_certificate_valid() and not self.certificate_needs_renewal():
return True
resp = sickrage.app.api.server.get_server_certificate(sickrage.app.config.general.server_id)
if not resp or 'certificate' not in resp or 'private_key' not in resp:
if not create_https_certificates(sickrage.app.config.general.https_cert, sickrage.app.config.general.https_key):
if not create_https_certificates(sickrage.app.https_cert_file, sickrage.app.https_key_file):
return False
if not os.path.exists(sickrage.app.config.general.https_cert) or not os.path.exists(sickrage.app.config.general.https_key):
if not os.path.exists(sickrage.app.https_cert_file) or not os.path.exists(sickrage.app.https_key_file):
return False
return True
with open(sickrage.app.config.general.https_cert, 'w') as cert_out:
with open(sickrage.app.https_cert_file, 'w') as cert_out:
cert_out.write(resp['certificate'])
with open(sickrage.app.config.general.https_key, 'w') as key_out:
with open(sickrage.app.https_key_file, 'w') as key_out:
key_out.write(resp['private_key'])
sickrage.app.log.info("Loaded SSL certificate successfully")
......@@ -537,10 +537,10 @@ class WebServer(object):
return True
def certificate_needs_renewal(self):
if not os.path.exists(sickrage.app.config.general.https_cert):
if not os.path.exists(sickrage.app.https_cert_file):
return
with open(sickrage.app.config.general.https_cert, 'rb') as f:
with open(sickrage.app.https_cert_file, 'rb') as f:
cert_pem = f.read()
cert = x509.load_pem_x509_certificate(cert_pem, default_backend())
......@@ -549,10 +549,10 @@ class WebServer(object):
return not_valid_after - datetime.datetime.utcnow() < (cert.not_valid_after - cert.not_valid_before) / 2
def is_certificate_valid(self):
if not os.path.exists(sickrage.app.config.general.https_cert):
if not os.path.exists(sickrage.app.https_cert_file):
return
with open(sickrage.app.config.general.https_cert, 'rb') as f:
with open(sickrage.app.https_cert_file, 'rb') as f:
cert_pem = f.read()
cert = x509.load_pem_x509_certificate(cert_pem, default_backend())
......
......@@ -19,14 +19,11 @@
# along with SiCKRAGE. If not, see <http://www.gnu.org/licenses/>.
# ##############################################################################
import os
from tornado.web import authenticated
import sickrage
from sickrage.core.common import Quality, Qualities, EpisodeStatus
from sickrage.core.config.helpers import change_gui_lang, change_https_key, change_https_cert, change_show_update_hour, \
change_version_notify
from sickrage.core.config.helpers import change_gui_lang, change_show_update_hour, change_version_notify
from sickrage.core.enums import UITheme, DefaultHomePage, TimezoneDisplay, SearchFormat, SeriesProviderID, CpuPreset
from sickrage.core.helpers import generate_api_key, checkbox_to_value, try_int
from sickrage.core.webserver import ConfigWebHandler
......@@ -259,11 +256,11 @@ class SaveGeneralHandler(BaseHandler):
sickrage.app.config.general.enable_https = checkbox_to_value(enable_https)
if not change_https_cert(https_cert):
results += ["Unable to create directory " + os.path.normpath(https_cert) + ", https cert directory not changed."]
if not change_https_key(https_key):
results += ["Unable to create directory " + os.path.normpath(https_key) + ", https key directory not changed."]
# if not change_https_cert(https_cert):
# results += ["Unable to create directory " + os.path.normpath(https_cert) + ", https cert directory not changed."]
#
# if not change_https_key(https_key):
# results += ["Unable to create directory " + os.path.normpath(https_key) + ", https key directory not changed."]
sickrage.app.config.general.handle_reverse_proxy = checkbox_to_value(handle_reverse_proxy)
......
......@@ -957,53 +957,51 @@ c<%inherit file="../layouts/config.mako"/>
</div>
</div>
<div id="content_enable_https">
<div class="form-row form-group">
<div class="col-lg-3 col-md-4 col-sm-5">
<label class="component-title">${_('HTTPS certificate')}</label>
</div>
<div class="col-lg-9 col-md-8 col-sm-7 component-desc">
<div class="form-row">
<div class="col-md-12">
<input name="https_cert" id="https_cert"
value="${sickrage.app.config.general.https_cert}"
class="form-control"
autocapitalize="off"/>
</div>
</div>
<div class="form-row">
<div class="col-md-12">
<label for="https_cert">
${_('file name or path to HTTPS certificate')}
</label>
</div>
</div>
</div>
</div>
<div class="form-row form-group">
<div class="col-lg-3 col-md-4 col-sm-5">
<label class="component-title">${_('HTTPS key')}</label>
</div>
<div class="col-lg-9 col-md-8 col-sm-7 component-desc">
<div class="form-row">
<div class="col-md-12">
<input name="https_key" id="https_key"
value="${sickrage.app.config.general.https_key}"
class="form-control" autocapitalize="off"/>
</div>
</div>
<div class="form-row">
<div class="col-md-12">
<label for="https_key">${_('file name or path to HTTPS key')}</label>
</div>
</div>
</div>
</div>
</div>
## <div id="content_enable_https">
## <div class="form-row form-group">
##
## <div class="col-lg-3 col-md-4 col-sm-5">
## <label class="component-title">${_('HTTPS certificate')}</label>
## </div>
## <div class="col-lg-9 col-md-8 col-sm-7 component-desc">
## <div class="form-row">
## <div class="col-md-12">
## <input name="https_cert" id="https_cert"
## value="${sickrage.app.config.general.https_cert}"
## class="form-control"
## autocapitalize="off"/>
## </div>
## </div>
## <div class="form-row">
## <div class="col-md-12">
## <label for="https_cert">
## ${_('file name or path to HTTPS certificate')}
## </label>
## </div>
## </div>
## </div>
## </div>
##
## <div class="form-row form-group">
## <div class="col-lg-3 col-md-4 col-sm-5">
## <label class="component-title">${_('HTTPS key')}</label>
## </div>
## <div class="col-lg-9 col-md-8 col-sm-7 component-desc">
## <div class="form-row">
## <div class="col-md-12">
## <input name="https_key" id="https_key"
## value="${sickrage.app.config.general.https_key}"
## class="form-control" autocapitalize="off"/>
## </div>
## </div>
## <div class="form-row">
## <div class="col-md-12">
## <label for="https_key">${_('file name or path to HTTPS key')}</label>
## </div>
## </div>
## </div>
## </div>
## </div>
<div class="form-row form-group">
<div class="col-lg-3 col-md-4 col-sm-5">
......
10.0.27
\ No newline at end of file
10.0.28
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment