Commit cf266be9 authored by Benjamin "Ziirish" SANS's avatar Benjamin "Ziirish" SANS
Browse files

couple of fix and improvements

parent dcb4f1c7
......@@ -21,6 +21,7 @@ from importlib import import_module
from functools import wraps
from .custom.namespace import Namespace
from .._compat import to_bytes
from ..server import BUIServer # noqa
from ..exceptions import BUIserverException
from ..config import config
......@@ -38,7 +39,7 @@ def cache_key():
request.headers.get('X-Session-Tag', ''),
session.get('language', '')
)
key = hashlib.sha256(key).hexdigest()
key = hashlib.sha256(to_bytes(key)).hexdigest()
return key
......
......@@ -57,7 +57,7 @@ BEAT_SCHEDULE = {
},
'backup-running-minutely': {
'task': '{}.backup_running'.format(ME),
'schedule': crontab(), # run every minute
'schedule': 30.0, # run every 30 seconds
},
'get-all-backups-every-twenty-minutes': {
'task': '{}.get_all_backups'.format(ME),
......@@ -67,9 +67,9 @@ BEAT_SCHEDULE = {
'task': '{}.get_all_clients_reports'.format(ME),
'schedule': crontab(minute='*/20'), # every 20 minutes
},
'cleanup-expired-sessions-daily': {
'cleanup-expired-sessions-every-four-hours': {
'task': '{}.cleanup_expired_sessions'.format(ME),
'schedule': crontab(hour='1'), # every day at 1
'schedule': crontab(hour='*/4'), # every four hours
},
}
......
......@@ -10,6 +10,7 @@
"""
import re
import datetime
import inspect
import arrow
import fnmatch
......@@ -115,10 +116,7 @@ class Wildcard(fields.List):
if isinstance(obj, dict):
self._flat = obj.items()
else:
self._flat = []
for attr in dir(obj):
if attr not in self._exclude:
self._flat.append((attr, getattr(obj, attr)))
self._flat.extend(inspect.getmembers(obj, match_attributes))
self._idx = 0
self._cache = []
......@@ -152,3 +150,9 @@ class Wildcard(fields.List):
return None
return self.container.format(value)
def match_attribute(attr):
return not(inspect.isroutine(attr) or
(attr.__name__.startswith('__') and
attr.__name__.endswith('__')))
......@@ -823,7 +823,7 @@ class Burp(Burp1):
ret = 'Windows'
else:
ret = 'Unix/Linux'
except (KeyError, BUIserverException):
except (IndexError, KeyError, BUIserverException):
pass
self._os_cache[name] = ret
......
......@@ -256,7 +256,10 @@ class Burp(BUIbackend):
for name, serv in iteritems(self.servers):
func = getattr(serv, method)
r[name] = func()
try:
r[name] = func()
except BUIserverException:
r[name] = 'Unknown'
return r
......
......@@ -104,7 +104,7 @@ var _clients_table = $('#table-clients').dataTable( {
var label = '';
if (__date[data.last] == 'now' && __status[data.state] != 'idle') {
cls = 'blink';
link_start = '<a href="{{ url_for("view.live_monitor", server=server) }}?name='+data.name+'">';
link_start = '<a href="{{ url_for("view.live_monitor", server=server) }}/'+data.name+'">';
link_end = '</a>';
label = '&nbsp;{{ _("view") }}';
}
......
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