% # 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! import os import psutil # from tob.configcollector import ConfigCollector # cfgcoll = ConfigCollector(tor) configs_used = get('configs_used', []) configs_all = [] try: # get all valid configuration names (only and drop attached information) config_names = tor.get_info('config/names') # print(config_names) names_with_values = config_names.splitlines() config_params = {} for line in names_with_values: # print(line) config = line.split(' ') try: c0 = config[0] c1 = config[1] # https://trac.torproject.org/projects/tor/ticket/20956 # see as well configcollector.py if 'Port' in c0 and c1 in ['Dependent', 'Dependant', 'Virtual']: # special handling for ...Port's ! c1 = 'LineList' end config_params[c0] = c1 except: pass end end except: pass end enable_print = False if enable_print is True: print(tor.get_info('config/defaults')) print('-----') print(tor.get_info('config/names')) print('-----') print(tor.get_info('config-text')) end %> {{!header_row('Tor', 'Configuration', 'config')}} <% cmd_line = [] if tor.is_localhost(): try: pid = tor.get_pid() p = psutil.Process(pid) cmd_line = p.cmdline() # This returns a list! except: pass end end if len(cmd_line) > 0: %>
none
% end
% else:
Error
% end