% # Note that this file is not a valid *.html file! # It is intended to be a bottlepy - style template # used for the scripting part of TheOnionBox! VERSION_STATUS_COLORS = {"new": "blue", "new in series": "blue", "obsolete": "red", "recommended": "green", "old": "red", "unrecommended": "red", "unknown": "cyan"} tor = get('tor') # 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", 'none': 'cyan', "unknown": "black"} def flags(is_bridge = False): flags = ['unknown'] try: if is_bridge is True: oo_details = get('oo_details', None) if oo_details is not None: # get_flags() only works for relays, not for bridges flags = oo_details('flags') or ['unknown'] end else: flags = tor.flags or ['unknown'] end except Exception as exc: pass end fs = '' for flag in flags: if fs is not '': fs += ' | ' end fs += '' + flag + '' end if (len(flags) == 1) and (flags[0] == 'none'): a_o = get('accounting_on') if a_o == True: a_s = get('accounting_stats') if a_s.status != 'awake': fs += ' | could be due to ' fs += 'Hibernation Status' fs += ' ' + a_s.status + '' end end end return fs end %> <% bv = get('boxVersion') tvt = bv.Tor tvs = tor.version_short %> {{!header_row('Tor', 'Local Status', 'stats')}} {{!standard_row('Version', tor.get_version())}}