Browse Source

Add pyOpenSSL info to startup/utility/config base. Add OpenSSL & yEnc to config base as well.

pull/479/head
Jonathon Saine 9 years ago
parent
commit
4905cd0cc4
  1. 3
      SABnzbd.py
  2. 94
      interfaces/Config/templates/config.tmpl
  3. 3
      interfaces/Config/templates/staticcfg/css/style.css
  4. 18
      sabnzbd/utils/sslinfo.py

3
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()))

94
interfaces/Config/templates/config.tmpl

@ -1,64 +1,82 @@
<!--#set global $pane="Config"#-->
<!--#set global $help_uri="configure-1-0"#-->
<!--#include $webdir + "/_inc_header_uc.tmpl"#-->
<div class="colmask">
<div class="section padTable">
<table id="infoTable">
<!--#from sabnzbd.newswrapper import HAVE_SSL#-->
<!--#import sabnzbd.utils.sslinfo#-->
<!--#from sabnzbd.decoder import HAVE_YENC#-->
<!--#from sabnzbd.newsunpack import PAR2_COMMAND, PAR2C_COMMAND, RAR_COMMAND, ZIP_COMMAND, SEVEN_COMMAND, NICE_COMMAND, IONICE_COMMAND#-->
<div class="colmask">
<div class="table-responsive section padTable" style="padding-bottom: 0;">
<table cellspacing="1" cellpadding="1" class="table table-striped">
<tbody>
<tr class="alt">
<td class="infoTableHeader">$T('version'): </td>
<td class="infoTableCell">$version [$build]</td>
<tr>
<th scope="row">$T('version'): </th>
<td>$version [$build]</td>
</tr>
<tr>
<td class="infoTableHeader">$T('uptime'): </td>
<td class="infoTableCell">$uptime</td>
<th scope="row">$T('uptime'): </th>
<td>$uptime</td>
</tr>
<tr class="alt">
<td class="infoTableHeader">$T('confgFile'): </td>
<td class="infoTableCell">$configfn</td>
<tr>
<th scope="row">$T('confgFile'): </th>
<td>$configfn</td>
</tr>
<tr>
<td class="infoTableHeader">$T('cache').capitalize(): </td>
<td class="infoTableCell"><!--#set $msg=$T('ft-buffer@2')%($cache_art, $cache_size)#-->$msg</td>
<th scope="row">$T('cache').capitalize(): </th>
<td><!--#set $msg=$T('ft-buffer@2')%($cache_art, $cache_size)#-->$msg</td>
</tr>
<tr class="alt">
<td class="infoTableHeader">$T('parameters'): </td>
<td class="infoTableCell">$cmdline</td>
<tr>
<th scope="row">$T('parameters'): </th>
<td>$cmdline</td>
</tr>
<tr>
<td class="infoTableHeader">$T('pythonVersion'): </td>
<td class="infoTableCell">$sys.version[:120]</td>
<th scope="row">$T('pythonVersion'): </th>
<td>$sys.version[:120]</td>
</tr>
<tr class="infoTableSeperator alt">
<td class="infoTableHeader">$T('homePage') </td>
<td class="infoTableCell"><a href="http://sabnzbd.org/" target="_blank">http://sabnzbd.org/</a></td>
<tr>
<th scope="row">OpenSSL:</th>
<td><!--#if HAVE_SSL then sabnzbd.utils.sslinfo.ssl_version() + ' [' + ', '.join(sabnzbd.utils.sslinfo.ssl_protocols()) + ']' else "NOT found"#--></td>
</tr>
<tr>
<td class="infoTableHeader">$T('menu-wiki') </td>
<td class="infoTableCell"><a href="http://wiki.sabnzbd.org/faq" target="_blank">http://wiki.sabnzbd.org/faq</a></td>
<th scope="row">pyOpenSSL:</th>
<td><!--#if HAVE_SSL then sabnzbd.utils.sslinfo.pyopenssl_version() else "NOT found"#--></td>
</tr>
<tr class="alt">
<td class="infoTableHeader">$T('menu-forums') </td>
<td class="infoTableCell"><a href="http://forums.sabnzbd.org/" target="_blank">http://forums.sabnzbd.org/</a></td>
<tr>
<th scope="row">yEnc:</th>
<td><!--#if HAVE_YENC then "Found" else "NOT found"#--></td>
</tr>
<tr class="separator" colspan="2"><th></th><td></td></tr>
<tr>
<td class="infoTableHeader">$T('source') </td>
<td class="infoTableCell"><a href="https://github.com/sabnzbd/sabnzbd" target="_blank">https://github.com/sabnzbd/sabnzbd</a></td>
<th scope="row">$T('homePage') </th>
<td><a href="http://sabnzbd.org/" target="_blank">http://sabnzbd.org/</a></td>
</tr>
<tr class="alt">
<td class="infoTableHeader">$T('menu-irc') </td>
<td class="infoTableCell"><a href="irc://irc.synirc.net/#sabnzbd"><i>#sabnzbd</i> on <i>irc.synirc.net</i></a> $T('or') (<a href="http://sabnzbd.org/live-chat/" target="_blank">webchat</a>)</td>
<tr>
<th scope="row">$T('menu-wiki') </th>
<td><a href="http://wiki.sabnzbd.org/faq" target="_blank">http://wiki.sabnzbd.org/faq</a></td>
</tr>
<tr>
<td class="infoTableHeader">$T('menu-issues') </td>
<td class="infoTableCell"><a href="http://wiki.sabnzbd.org/issues-1-0-0" target="_blank">http://wiki.sabnzbd.org/issues-1-0-0</a></td>
<th scope="row">$T('menu-forums') </th>
<td><a href="http://forums.sabnzbd.org/" target="_blank">http://forums.sabnzbd.org/</a></td>
</tr>
<tr>
<th scope="row">$T('source') </th>
<td><a href="https://github.com/sabnzbd/sabnzbd" target="_blank">https://github.com/sabnzbd/sabnzbd</a></td>
</tr>
<tr>
<th scope="row">$T('menu-irc') </th>
<td><a href="irc://irc.synirc.net/#sabnzbd"><i>#sabnzbd</i> on <i>irc.synirc.net</i></a> $T('or') (<a href="http://sabnzbd.org/live-chat/" target="_blank">webchat</a>)</td>
</tr>
</tbody>
</table>
</div>
<div class="padding alt">
<h5 class="copyright">Copyright &copy; 2008-2016 The SABnzbd Team &lt;<a href="mailto:team@sabnzbd.org">team@sabnzbd.org</a>&gt;</h5>
<p class="copyright"><small>$T('yourRights')</small></p>
</div>
</div>
<div class="padding alt">
<h5 class="copyright">Copyright &copy; 2008-2016 The SABnzbd Team &lt;<a href="mailto:team@sabnzbd.org">team@sabnzbd.org</a>&gt;</h5>
<p class="copyright"><small>$T('yourRights')</small></p>
</div>
</div>
<!--#include $webdir + "/_inc_footer_uc.tmpl"#-->

3
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;
}

18
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()

Loading…
Cancel
Save