This commit is contained in:
emdee 2023-12-07 19:51:08 +00:00
parent 7a1999f117
commit 1a4db4ae79
3 changed files with 160 additions and 28 deletions

View file

@ -100,6 +100,9 @@ Look in tor's notice.log for 'Every introduction point for service'
```notice_log``` will parse the notice log for warnings about relays and
services that will then be whitelisted.
```--torrc``` will read a file like /etc/tor/torrc and make some
suggestions based on what it finds; it will not edit or change the file.
```--torrc_output``` will write the torrc ExcludeNodes configuration to a file.
```--good_contacts``` will write the contact info as a ciiss dictionary
@ -140,9 +143,6 @@ To be "good" the ContactInfo must:
```--wellknown_output``` will make the program write the well-known files
(```/.well-known/tor-relay/rsa-fingerprint.txt```) to a directory.
```--torrc_output``` will write a file of the commands that it sends to
the Tor controller, so you can include it in a ```/etc/toc/torrc```.
```--relays_output write the download relays in json to a file. The relays
are downloaded from https://onionoo.torproject.org/details
@ -618,7 +618,7 @@ def aParseContact(contact, fp):
contact = contact.split(r'\n')[0]
for elt in lMORONS:
contact = contact.replace(elt)
contact = contact.replace(elt, '')
m = oCONTACT_RE.match(contact)
# 450 matches!
if m and m.groups and len(m.groups(0)) > 2 and m.span()[1] > 0:
@ -1301,7 +1301,7 @@ def iMain(lArgs):
if 'EntryNodes' in aGOOD_NODES[sGOOD_ROOT].keys():
try:
LOG.info(f"{sINCLUDE_GUARD_KEY} {len(aGOOD_NODES[sGOOD_ROOT]['EntryNodes'])} guard nodes")
LOG.info(f"controller {sINCLUDE_GUARD_KEY} {len(aGOOD_NODES[sGOOD_ROOT]['EntryNodes'])} guard nodes")
# FixMe for now override StrictNodes it may be unusable otherwise
controller.set_conf(sINCLUDE_GUARD_KEY,
aGOOD_NODES[sGOOD_ROOT]['EntryNodes'])
@ -1315,12 +1315,12 @@ def iMain(lArgs):
controller.set_conf('StrictNodes', oargs.strict_nodes)
cur = controller.get_conf('StrictNodes')
if int(cur) != oargs.strict_nodes:
LOG.warn(f"OVERRIDING StrictNodes NOT {oargs.strict_nodes}")
LOG.warn(f"controller failed StrictNodes NOT {oargs.strict_nodes}")
else:
LOG.info(f"OVERRODE StrictNodes to {oargs.strict_nodes}")
LOG.info(f"controller OVERRODE StrictNodes to {oargs.strict_nodes}")
else:
LOG.info(f"StrictNodes is set to {cur}")
LOG.info(f"controller StrictNodes is set to {cur}")
except KeyboardInterrupt:
return 0