...
 
Commits (8)
......@@ -25,7 +25,7 @@ sentry_release_master:
- sentry-cli releases new --project $SENTRY_PROJECT $(cat sickrage/version.txt)
- sentry-cli releases set-commits --auto $(cat sickrage/version.txt)
- sentry-cli releases finalize $(cat sickrage/version.txt)
- sentry-cli releases deploys $(cat sickrage/version.txt) new -e $CI_COMMIT_REF_NAME
- sentry-cli releases deploys $(cat sickrage/version.txt) new -e master
only:
- /^[0-9.]+$/
except:
......@@ -45,7 +45,7 @@ sentry_release_develop:
- sentry-cli releases new --project $SENTRY_PROJECT $(cat sickrage/version.txt)
- sentry-cli releases set-commits --auto $(cat sickrage/version.txt)
- sentry-cli releases finalize $(cat sickrage/version.txt)
- sentry-cli releases deploys $(cat sickrage/version.txt) new -e $CI_COMMIT_REF_NAME
- sentry-cli releases deploys $(cat sickrage/version.txt) new -e develop
only:
- /^[0-9.]+dev[0-9]$/
except:
......
......@@ -233,16 +233,20 @@ module.exports = function (grunt) {
const newVersion = vArray.vMajor + '.' + vArray.vMinor + '.' + vArray.vPatch;
const tasks = [
'exec:git:checkout:-b release-v' + newVersion + ':develop',
'changelog',
'webpack:prod',
//'sync_trans',
'bump_version:' + newVersion,
'exec:git_commit:Release v' + newVersion,
'exec:git:checkout:master',
'exec:git:merge:develop:-m:Release v' + newVersion,
'exec:git:merge:release-v' + newVersion,
'exec:git_last_tag', 'exec:git_list_changes', 'exec:git_tag:' + newVersion,
'exec:git_push:origin:develop:tags',
'exec:git_push:origin:master:tags',
'exec:git:checkout:develop',
'exec:git:merge:release-v' + newVersion,
'exec:git_push:origin:develop',
'exec:git:branch:-d release-v' + newVersion,
'exec:pypi_create',
'exec:pypi_upload',
'exec:pypi_cleanup',
......
# Changelog
- * 999475fc0 - 2019-07-13: Updated git release flow.
- * f51300562 - 2019-07-13: Fixed issues with TornadoHTTP handler and self-signed SSL certificates. Fixed issue #382
- * 1fbb04ce4 - 2019-07-13: Fixes issues with generating self-signed SSL certificates on startup.
- * 4a0b9b439 - 2019-07-13: Added exception handling for unauthorized raises.
- * 7b0f1bfbb - 2019-07-13: Resolved issue with setting proxy address when global proxy configured.
- * d5cd13830 - 2019-07-13: Fixed Sentry release environments naming.
- * 1175f6346 - 2019-07-13: Fixes issues with mass editing shows and setting qualities.
- * faeabc947 - 2019-07-13: Pre-Release v9.4.132.dev1
- * 4072c47a2 - 2019-07-13: Release v9.4.131
- * 4df45f161 - 2019-07-13: Fixed issue with gitlab-ci and pipelines for master branch.
- * f7067e987 - 2019-07-13: Pre-Release v9.4.131.dev1
......
......@@ -746,27 +746,10 @@ def create_https_certificates(ssl_cert, ssl_key):
return False
# Check happens if the certificate and key pair already exists for a domain
if not os.path.exists(ssl_key) and os.path.exists(ssl_cert):
if not os.path.exists(ssl_key) and not os.path.exists(ssl_cert):
# Serial Generation - Serial number must be unique for each certificate,
serial = int(time.time())
# Create the CA Certificate
cakey = OpenSSL.crypto.PKey().generate_key(OpenSSL.crypto.TYPE_RSA, 2048)
careq = OpenSSL.crypto.X509()
careq.get_subject().CN = "Certificate Authority"
careq.set_pubkey(cakey)
careq.sign(cakey, b"sha1")
# Sign the CA Certificate
cacert = OpenSSL.crypto.X509()
cacert.set_serial_number(serial)
cacert.gmtime_adj_notBefore(0)
cacert.gmtime_adj_notAfter(365 * 24 * 60 * 60)
cacert.set_issuer(careq.get_subject())
cacert.set_subject(careq.get_subject())
cacert.set_pubkey(careq.get_pubkey())
cacert.sign(cakey, b"sha1")
# Generate self-signed certificate
key = OpenSSL.crypto.PKey()
key.generate_key(OpenSSL.crypto.TYPE_RSA, 2048)
......@@ -775,9 +758,9 @@ def create_https_certificates(ssl_cert, ssl_key):
cert.gmtime_adj_notBefore(0)
cert.gmtime_adj_notAfter(365 * 24 * 60 * 60)
cert.set_serial_number(serial)
cert.set_issuer(cacert.get_subject())
cert.set_issuer(cert.get_subject())
cert.set_pubkey(key)
cert.sign(cakey, b"sha1")
cert.sign(key, "sha1")
# Save the key and certificate to disk
try:
......
......@@ -26,7 +26,7 @@ class TornadoHTTP(object):
headers = {"Cookie": 'sr_httpclient_token={}'.format(sickrage.app.wserver.app.settings['httpclient_secret'])}
http_client = AsyncHTTPClient()
http_request = HTTPRequest(url, headers=headers, request_timeout=timeout, **kwargs)
http_request = HTTPRequest(url, headers=headers, request_timeout=timeout, validate_cert=False, **kwargs)
response = await http_client.fetch(http_request)
......@@ -36,7 +36,7 @@ class TornadoHTTP(object):
headers = {"Cookie": 'sr_httpclient_token={}'.format(sickrage.app.wserver.app.settings['httpclient_secret'])}
http_client = AsyncHTTPClient()
http_request = HTTPRequest(url, method="POST", headers=headers, request_timeout=timeout, **kwargs)
http_request = HTTPRequest(url, method="POST", headers=headers, request_timeout=timeout, validate_cert=False, **kwargs)
response = await http_client.fetch(http_request)
......
......@@ -139,17 +139,11 @@ class WebServer(object):
# tornado setup
if sickrage.app.config.enable_https:
# If either the HTTPS certificate or key do not exist, make some self-signed ones.
if not (
sickrage.app.config.https_cert and os.path.exists(
sickrage.app.config.https_cert)) or not (
sickrage.app.config.https_key and os.path.exists(sickrage.app.config.https_key)):
if not create_https_certificates(sickrage.app.config.https_cert,
sickrage.app.config.https_key):
sickrage.app.log.info("Unable to create CERT/KEY files, disabling HTTPS")
sickrage.app.config.enable_https = False
if not (os.path.exists(sickrage.app.config.https_cert) and os.path.exists(
sickrage.app.config.https_key)):
if not create_https_certificates(sickrage.app.config.https_cert, sickrage.app.config.https_key):
sickrage.app.log.info("Unable to create CERT/KEY files, disabling HTTPS")
sickrage.app.config.enable_https = False
if not (os.path.exists(sickrage.app.config.https_cert) and os.path.exists(sickrage.app.config.https_key)):
sickrage.app.log.warning("Disabled HTTPS because of missing CERT and KEY files")
sickrage.app.config.enable_https = False
......
......@@ -482,8 +482,8 @@ class MassEditHandler(BaseHandler, ABC):
quality_preset = self.get_argument('quality_preset', None)
subtitles = self.get_argument('subtitles', None)
air_by_date = self.get_argument('air_by_date', None)
any_qualities = self.get_argument('anyQualities', '')
best_qualities = self.get_argument('bestQualities', '')
any_qualities = self.get_arguments('anyQualities')
best_qualities = self.get_arguments('bestQualities')
to_edit = self.get_argument('toEdit', None)
i = 0
......@@ -574,31 +574,29 @@ class MassEditHandler(BaseHandler, ABC):
if quality_preset == 'keep':
any_qualities, best_qualities = Quality.split_quality(show_obj.quality)
elif try_int(quality_preset, None):
best_qualities = ''
post_data = dict(
show=curShow,
location=new_show_dir,
anyQualities=','.join(map(str, any_qualities)) if isinstance(any_qualities,
list) else any_qualities,
bestQualities=','.join(map(str, best_qualities)) if isinstance(best_qualities,
list) else best_qualities,
exceptions_list='',
defaultEpStatus=new_default_ep_status,
skip_downloaded=new_skip_downloaded,
flatten_folders=new_flatten_folders,
paused=new_paused,
sports=new_sports,
subtitles=new_subtitles,
anime=new_anime,
scene=new_scene,
air_by_date=new_air_by_date,
directCall='true'
)
best_qualities = []
post_data = {
'show': curShow,
'location': new_show_dir,
'anyQualities': any_qualities,
'bestQualities': best_qualities,
'exceptions_list': [],
'defaultEpStatus': new_default_ep_status,
'skip_downloaded': new_skip_downloaded,
'flatten_folders': new_flatten_folders,
'paused': new_paused,
'sports': new_sports,
'subtitles': new_subtitles,
'anime': new_anime,
'scene': new_scene,
'air_by_date': new_air_by_date,
'directCall': 'true'
}
response = await TornadoHTTP().post(
self.get_url("/home/editShow"),
body=urlencode(post_data)
body=urlencode(post_data, True)
)
if response.body:
......
......@@ -17,7 +17,7 @@
# along with SiCKRAGE. If not, see <http://www.gnu.org/licenses/>.
import os
import ssl
from urllib.parse import splittype
from urllib.parse import urlparse
import certifi
import cfscrape
......@@ -35,9 +35,8 @@ from sickrage.core import helpers
def _add_proxies():
if sickrage.app.config.proxy_setting:
sickrage.app.log.debug("Using global proxy: " + sickrage.app.config.proxy_setting)
scheme, address = splittype(sickrage.app.config.proxy_setting)
address = ('http://{}'.format(sickrage.app.config.proxy_setting),
sickrage.app.config.proxy_setting)[scheme]
proxy = urlparse(sickrage.app.config.proxy_setting)
address = sickrage.app.config.proxy_setting if proxy.scheme else 'http://{}'.format(sickrage.app.config.proxy_setting)
return {"http": address, "https": address}
......
......@@ -553,16 +553,13 @@ class Tvdb:
try:
# get series info in english
series_info = self._request('get',
self.config['api']['series'].format(id=sid),
lang=self.config['api']['lang']
)['data']
series_info = self._request('get', self.config['api']['series'].format(id=sid), lang=self.config['api']['lang'])['data']
# translate if required to provided language
if not self.config['language'] == self.config['api']['lang']:
series_info.update((k, v) for k, v in self._request('get',
self.config['api']['series'].format(id=sid)
)['data'].items() if v)
series_info.update((k, v) for k, v in self._request('get', self.config['api']['series'].format(id=sid))['data'].items() if v)
except tvdb_unauthorized:
raise tvdb_unauthorized
except Exception as e:
sickrage.app.log.debug("[{}]: Series result returned zero, ERROR: {}".format(sid, e))
raise tvdb_error("[{}]: Series result returned zero, ERROR: {}".format(sid, e))
......@@ -687,6 +684,8 @@ class Tvdb:
images = self._request('get', self.config['api']['images'][key_type].format(id=sid), language)['data']
else:
images = self._request('get', self.config['api']['images'][key_type].format(id=sid, season=season), language)['data']
except tvdb_unauthorized:
raise tvdb_unauthorized
except tvdb_error:
continue
......@@ -719,6 +718,8 @@ class Tvdb:
curActor[k] = v
cur_actors.append(curActor)
except tvdb_unauthorized:
raise tvdb_unauthorized
except Exception:
sickrage.app.log.debug('Actors result returned zero')
......
......@@ -887,8 +887,7 @@ class MetadataProviders(dict):
return list(dict(
inspect.getmembers(
importlib.import_module('.{}'.format(name), 'sickrage.metadata'),
predicate=lambda o: inspect.isclass(o) and issubclass(o,
GenericMetadata) and o is not GenericMetadata)
predicate=lambda o: inspect.isclass(o) and issubclass(o, GenericMetadata) and o is not GenericMetadata)
).values())[0]
except IndexError:
pass
9.4.132.dev1
\ No newline at end of file
9.4.132
\ No newline at end of file