From 4905cd0cc4709cecb8794bf950711a84802eb5a4 Mon Sep 17 00:00:00 2001 From: Jonathon Saine Date: Wed, 17 Feb 2016 08:33:11 -0600 Subject: [PATCH] Add pyOpenSSL info to startup/utility/config base. Add OpenSSL & yEnc to config base as well. --- SABnzbd.py | 3 +- interfaces/Config/templates/config.tmpl | 94 +++++++++++++--------- .../Config/templates/staticcfg/css/style.css | 3 + sabnzbd/utils/sslinfo.py | 18 ++++- 4 files changed, 76 insertions(+), 42 deletions(-) diff --git a/SABnzbd.py b/SABnzbd.py index 6c2a624..2dfab67 100755 --- a/SABnzbd.py +++ b/SABnzbd.py @@ -717,7 +717,7 @@ def is_sabnzbd_running(url, timeout=None): # Do this without certificate verification, few installations will have that prev = sabnzbd.set_https_verification(False) ver = sabnzbd.newsunpack.get_from_url(url, timeout=timeout) - sabnzbd.set_https_verification(prev) + sabnzbd.set_https_verification(prev) return bool(ver and re.search(r'\d+\.\d+\.', ver)) except: return False @@ -1367,6 +1367,7 @@ def main(): import sabnzbd.utils.sslinfo logging.info("SSL version %s", sabnzbd.utils.sslinfo.ssl_version()) + logging.info("pyOpenSSL version %s", sabnzbd.utils.sslinfo.pyopenssl_version()) logging.info("SSL potentially supported protocols %s", str(sabnzbd.utils.sslinfo.ssl_potential())) logging.info("SSL actually supported protocols %s", str(sabnzbd.utils.sslinfo.ssl_protocols())) diff --git a/interfaces/Config/templates/config.tmpl b/interfaces/Config/templates/config.tmpl index bcddfdc..db7510d 100644 --- a/interfaces/Config/templates/config.tmpl +++ b/interfaces/Config/templates/config.tmpl @@ -1,64 +1,82 @@ -
-
- + + + + + + +
+
+
- - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + + - - + + - - - + + + - - + + + + + + + + + +
$T('version'): $version [$build]
$T('version'): $version [$build]
$T('uptime'): $uptime$T('uptime'): $uptime
$T('confgFile'): $configfn
$T('confgFile'): $configfn
$T('cache').capitalize(): $msg$T('cache').capitalize(): $msg
$T('parameters'): $cmdline
$T('parameters'): $cmdline
$T('pythonVersion'): $sys.version[:120]$T('pythonVersion'): $sys.version[:120]
$T('homePage') http://sabnzbd.org/
OpenSSL:
$T('menu-wiki') http://wiki.sabnzbd.org/faqpyOpenSSL:
$T('menu-forums') http://forums.sabnzbd.org/
yEnc:
$T('source') https://github.com/sabnzbd/sabnzbd$T('homePage') http://sabnzbd.org/
$T('menu-irc') #sabnzbd on irc.synirc.net $T('or') (webchat)
$T('menu-wiki') http://wiki.sabnzbd.org/faq
$T('menu-issues') http://wiki.sabnzbd.org/issues-1-0-0$T('menu-forums') http://forums.sabnzbd.org/
$T('source') https://github.com/sabnzbd/sabnzbd
$T('menu-irc') #sabnzbd on irc.synirc.net $T('or') (webchat)
+
+ +
+ + +
+
-
- - -
- + diff --git a/interfaces/Config/templates/staticcfg/css/style.css b/interfaces/Config/templates/staticcfg/css/style.css index 277ec54..58bfa72 100644 --- a/interfaces/Config/templates/staticcfg/css/style.css +++ b/interfaces/Config/templates/staticcfg/css/style.css @@ -266,6 +266,9 @@ textarea:hover, input[type="date"]:hover, input[type="datetime"]:hover, input[ty .padTable h3 { margin-top: 0; } +tr.separator { + height: 30px; +} .catTable th, .catTable td { padding: 5px; } diff --git a/sabnzbd/utils/sslinfo.py b/sabnzbd/utils/sslinfo.py index 6228ab2..ee0d9c9 100644 --- a/sabnzbd/utils/sslinfo.py +++ b/sabnzbd/utils/sslinfo.py @@ -1,7 +1,5 @@ - _ALL_PROTOCOLS = ('t12', 't11', 't1', 'v23', 'v3', 'v2') _SSL_PROTOCOLS = {} - def ssl_potential(): ''' Return a list of potentially supported SSL protocols''' try: @@ -47,6 +45,7 @@ try: except ImportError: SSL = None + def ssl_method(method): ''' Translate SSL acronym to a method value ''' if method in _SSL_PROTOCOLS: @@ -56,12 +55,14 @@ def ssl_method(method): try: return SSL.SSLv23_METHOD except AttributeError: - return _SSL_PROTOCOLS[0] + return _SSL_PROTOCOLS[0] + def ssl_protocols(): ''' Return acronyms for SSL protocols, highest quality first ''' return [p for p in _ALL_PROTOCOLS if p in _SSL_PROTOCOLS] + def ssl_version(): if SSL: try: @@ -76,8 +77,19 @@ def ssl_version(): return None +def pyopenssl_version(): + if SSL: + try: + import OpenSSL + return OpenSSL.__version__ + except ImportError: + return 'No pyOpenSSL installed' + else: + return None + if __name__ == '__main__': print 'SSL version: %s' % ssl_version() + print 'pyOpenSSL version: %s' % pyopenssl_version() print 'Potentials: %s' % ssl_potential() print 'Actuals: %s' % ssl_protocols()