% import psutil cpu_count = psutil.cpu_count() # template_directory = get('template_directory') import socket host_name = socket.gethostname() from tob_template_tools import * import datetime # from stem.version import Version # in_version = get('version', "0.0.0.0-NoVersion") # x_version = Version(in_version) # short_version = ("{}.{}.{}.{}").format(x_version.major, x_version.minor, x_version.micro, x_version.patch)--> tor_info = get('tor_info') # This is Copy/Paste from ARM! # see dir-spec.txt for description of FLAGS FLAG_LABELS = {"Authority": "default", "BadExit": "danger", "BadDirectory": "danger", "Exit": "warning", "Fast": "primary", "Guard": "primary", "HSDir": "info", "Named": "primary", "Stable": "primary", "Running": "success", "Unnamed": "warning", "Valid": "success", "V2Dir": "default", "V3Dir": "default"} FLAG_COLORS = {"Authority": "black", "BadExit": "red", "BadDirectory": "red", "Exit": "orange", "Fast": "blue", "Guard": "blue", "HSDir": "deepskyblue", "Named": "blue", "Stable": "blue", "Running": "green", "Unnamed": "red", "Valid": "green", "V2Dir": "black", "V3Dir": "black", "Tor Communication Error": "red"} VERSION_STATUS_COLORS = {"new": "blue", "new in series": "blue", "obsolete": "red", "recommended": "green", "old": "red", "unrecommended": "red", "unknown": "cyan"} box_bold_grid = 'col-xs-3 col-md-2 box_bold' box_section_grid = 'col-xs-8 col-md-9 box_section' box_datum_grid = 'col-xs-3 col-md-2 box_datum' box_value_grid = 'col-xs-8 col-md-9 box_value' box_title_grid = 'col-xs-8 col-md-9 box_title' box_subtitle_grid = 'col-xs-8 col-md-9 box_subtitle' def standard_row(datum, value): out = "
{}
{}
{{!"Tor {} @ {}
{}".format(tor_info['tor/version/short'], host_name, tor_info['tor/fingerprint'])}}
Nickname
( {{nn}} )
% else:{{nn}}
% endFingerprint
Version
{{tor_info['tor/version']}}
% tvc = tor_info['tor/version/current']
% if tvc in VERSION_STATUS_COLORS:
{{tvc}}
% end
Control Port
<%
_cat_color = {"open": "black", "Password": "green", "Cookie": "blue"}
_cat = "open"
if tor_info['tor/isAuthPassword']:
_cat = "Password"
elif tor_info['tor/isAuthCookie']:
_cat = "Cookie"
end
%>
{{tor_info['tor/controlPort']}}
{{_cat}}
Flags
<% fs = ''
for flag in tor_info['tor/flags']:
if fs is not '':
fs += ' '
end
fs += '' + flag + '
'
end
%>
{{!fs}}
Exit Policy
<%
_ep = ""
for ep in tor_info['tor/exitPolicies']:
if _ep is not '':
_ep += ' | '
end
_ep += ep
end
%>
{{_ep}}
Charts
Total: 0 Bytes | Current: 0 Bytes/s
Total: 0 Bytes | Current: 0 Bytes/s
Status
disabled
Status
{{accounting_stats.status}}
Level
Messages