Skip to content

Commit

Permalink
Merge branch 'develop' into beta
Browse files Browse the repository at this point in the history
  • Loading branch information
labrys committed Jul 14, 2016
2 parents e6c8442 + 919bdbc commit f9b2c04
Show file tree
Hide file tree
Showing 637 changed files with 42,717 additions and 31,666 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ server.key

# Compiled source #
######################
*.py[co]
*.py[cod]

# IDE specific #
######################
Expand Down
Binary file added gui/slick/images/network/rai 1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added gui/slick/images/network/tnt (us).png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified gui/slick/images/network/tnt.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added gui/slick/images/providers/animebytes.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added gui/slick/images/providers/xspeeds.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added gui/slick/images/providers/xspeeds_eu.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion gui/slick/js/configProviders.js
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ $(document).ready(function(){
} else {
$('#torrentrss_name').attr("disabled", "disabled");
$('#torrentrss_url').removeAttr("disabled");
$('#torrentrss_cookies').removeAttr("disabled");
$('#torrentrss_cookies').attr("disabled", "disabled");
$('#torrentrss_titleTAG').removeAttr("disabled");
$('#torrentrss_delete').removeAttr("disabled");
}
Expand Down
23 changes: 20 additions & 3 deletions gui/slick/views/config_providers.mako
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ $('#config-components').tabs();
% for curProvider in sickbeard.providers.sortedProviderList():
<%
## These will show the '!' not saying they are broken
broken_providers = {}
broken_providers = {'btdigg'}
if curProvider.provider_type == GenericProvider.NZB and not sickbeard.USE_NZBS:
continue
elif curProvider.provider_type == GenericProvider.TORRENT and not sickbeard.USE_TORRENTS:
Expand Down Expand Up @@ -408,6 +408,23 @@ $('#config-components').tabs();
</div>
% endif
% if curTorrentProvider.enable_cookies:
<div class="field-pair">
<label for="${curTorrentProvider.get_id()}_cookies">
<span class="component-title">Cookies:</span>
<span class="component-desc">
<input type="text" name="${curTorrentProvider.get_id()}_cookies" id="${curTorrentProvider.get_id()}_cookies" value="${curTorrentProvider.cookies}" class="form-control input-sm input350" autocapitalize="off" autocomplete="no" />
</span>
</label>
<label>
<span class="component-title">&nbsp;</span>
<span class="component-desc">
<p>eg. uid=xx;pass=yy</p>
</span>
</label>
</div>
% endif
% if hasattr(curTorrentProvider, 'passkey'):
<div class="field-pair">
<label for="${curTorrentProvider.get_id()}_passkey">
Expand Down Expand Up @@ -766,11 +783,11 @@ $('#config-components').tabs();
<div class="field-pair">
<label for="torrentrss_cookies">
<span class="component-title">Cookies:</span>
<input type="text" id="torrentrss_cookies" class="form-control input-sm input350" autocapitalize="off" />
<input type="text" id="torrentrss_cookies" class="form-control input-sm input350" autocapitalize="off" disabled="disabled"/>
</label>
<label>
<span class="component-title">&nbsp;</span>
<span class="component-desc">eg. uid=xx;pass=yy</span>
<span class="component-desc">eg. uid=xx;pass=yy, please use "Provider options" to reconfigure!</span>
</label>
</div>
<div class="field-pair">
Expand Down
5 changes: 3 additions & 2 deletions gui/slick/views/snatchSelection.mako
Original file line number Diff line number Diff line change
Expand Up @@ -317,9 +317,9 @@
if hItem["name"] and preferred_words and show_name_helpers.containsAtLeastOneWord(hItem["name"], preferred_words):
name_preferred = True
if hItem["provider_minseed"] and hItem["seeders"] and hItem["seeders"] > -1 and int(hItem["seeders"]) < hItem["provider_minseed"]:
if hItem["provider_minseed"] and int(hItem["seeders"]) > -1 and int(hItem["seeders"]) < int(hItem["provider_minseed"]):
below_minseed = True
if hItem["provider_minleech"] and hItem["leechers"] and hItem["leechers"] > -1 and int(hItem["leechers"]) < hItem["provider_minleech"]:
if hItem["provider_minleech"] and int(hItem["leechers"]) > -1 and int(hItem["leechers"]) < int(hItem["provider_minleech"]):
below_minleech = True
%>
Expand Down Expand Up @@ -360,6 +360,7 @@
% endif
</td>
<td align="center">${renderQualityPill(int(hItem["quality"]))}</td>
% if below_minseed:
<td align="center"><font color="red">${hItem["seeders"] if hItem["seeders"] > -1 else '-'}</font></td>
% else:
Expand Down
51 changes: 0 additions & 51 deletions lib/backports/ssl_match_hostname/LICENSE.txt

This file was deleted.

52 changes: 0 additions & 52 deletions lib/backports/ssl_match_hostname/README.txt

This file was deleted.

58 changes: 55 additions & 3 deletions lib/backports/ssl_match_hostname/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,20 @@
"""The match_hostname() function from Python 3.3.3, essential when using SSL."""

import re
import sys

# ipaddress has been backported to 2.6+ in pypi. If it is installed on the
# system, use it to handle IPAddress ServerAltnames (this was added in
# python-3.5) otherwise only do DNS matching. This allows
# backports.ssl_match_hostname to continue to be used all the way back to
# python-2.4.
try:
import ipaddress
except ImportError:
ipaddress = None

__version__ = '3.5.0.1'

__version__ = '3.4.0.2'

class CertificateError(ValueError):
pass
Expand Down Expand Up @@ -61,6 +73,23 @@ def _dnsname_match(dn, hostname, max_wildcards=1):
return pat.match(hostname)


def _to_unicode(obj):
if isinstance(obj, str) and sys.version_info < (3,):
obj = unicode(obj, encoding='ascii', errors='strict')
return obj

def _ipaddress_match(ipname, host_ip):
"""Exact matching of IP addresses.
RFC 6125 explicitly doesn't define an algorithm for this
(section 1.7.2 - "Out of Scope").
"""
# OpenSSL may add a trailing newline to a subjectAltName's IP address
# Divergence from upstream: ipaddress can't handle byte str
ip = ipaddress.ip_address(_to_unicode(ipname).rstrip())
return ip == host_ip


def match_hostname(cert, hostname):
"""Verify that *cert* (in decoded format as returned by
SSLSocket.getpeercert()) matches the *hostname*. RFC 2818 and RFC 6125
Expand All @@ -70,12 +99,35 @@ def match_hostname(cert, hostname):
returns nothing.
"""
if not cert:
raise ValueError("empty or no certificate")
raise ValueError("empty or no certificate, match_hostname needs a "
"SSL socket or SSL context with either "
"CERT_OPTIONAL or CERT_REQUIRED")
try:
# Divergence from upstream: ipaddress can't handle byte str
host_ip = ipaddress.ip_address(_to_unicode(hostname))
except ValueError:
# Not an IP address (common case)
host_ip = None
except UnicodeError:
# Divergence from upstream: Have to deal with ipaddress not taking
# byte strings. addresses should be all ascii, so we consider it not
# an ipaddress in this case
host_ip = None
except AttributeError:
# Divergence from upstream: Make ipaddress library optional
if ipaddress is None:
host_ip = None
else:
raise
dnsnames = []
san = cert.get('subjectAltName', ())
for key, value in san:
if key == 'DNS':
if _dnsname_match(value, hostname):
if host_ip is None and _dnsname_match(value, hostname):
return
dnsnames.append(value)
elif key == 'IP Address':
if host_ip is not None and _ipaddress_match(value, host_ip):
return
dnsnames.append(value)
if not dnsnames:
Expand Down
Loading

0 comments on commit f9b2c04

Please sign in to comment.