mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-27 22:03:31 +01:00
Remove fallback scripts and whitelist
They have been extracted to a new fallback-scripts.git repository. Closes ticket 27914.
This commit is contained in:
parent
a9c80788d7
commit
2dd23086f1
4
changes/ticket27914
Normal file
4
changes/ticket27914
Normal file
@ -0,0 +1,4 @@
|
||||
o Removed features:
|
||||
- The scripts used to generate and maintain the list of fallback
|
||||
directories have been extracted into a new "fallback-scripts"
|
||||
repository. Closes ticket 27914.
|
File diff suppressed because it is too large
Load Diff
@ -1,38 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
# Generate a fallback directory whitelist/blacklist line for every fingerprint
|
||||
# passed as an argument.
|
||||
#
|
||||
# Usage:
|
||||
# generateFallbackDirLine.py fingerprint ...
|
||||
|
||||
import sys
|
||||
import urllib2
|
||||
|
||||
import stem.descriptor.remote
|
||||
import stem.util.tor_tools
|
||||
|
||||
if len(sys.argv) <= 1:
|
||||
print('Usage: %s fingerprint ...' % sys.argv[0])
|
||||
sys.exit(1)
|
||||
|
||||
for fingerprint in sys.argv[1:]:
|
||||
if not stem.util.tor_tools.is_valid_fingerprint(fingerprint):
|
||||
print("'%s' isn't a valid relay fingerprint" % fingerprint)
|
||||
sys.exit(1)
|
||||
|
||||
try:
|
||||
desc = stem.descriptor.remote.get_server_descriptors(fingerprint).run()[0]
|
||||
except urllib2.HTTPError as exc:
|
||||
if exc.code == 404:
|
||||
print('# %s not found in recent descriptors' % fingerprint)
|
||||
continue
|
||||
else:
|
||||
raise
|
||||
|
||||
if not desc.dir_port:
|
||||
print("# %s needs a DirPort" % fingerprint)
|
||||
else:
|
||||
ipv6_addresses = [(address, port) for address, port, is_ipv6 in desc.or_addresses if is_ipv6]
|
||||
ipv6_field = ' ipv6=[%s]:%s' % ipv6_addresses[0] if ipv6_addresses else ''
|
||||
print('%s:%s orport=%s id=%s%s # %s' % (desc.address, desc.dir_port, desc.or_port, fingerprint, ipv6_field, desc.nickname))
|
@ -1,28 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
# Lookup fallback directory contact lines for every fingerprint passed as an
|
||||
# argument.
|
||||
#
|
||||
# Usage:
|
||||
# lookupFallbackDirContact.py fingerprint ...
|
||||
|
||||
import sys
|
||||
|
||||
import stem.descriptor.remote as remote
|
||||
|
||||
if len(sys.argv) <= 1:
|
||||
print "Usage: {} fingerprint ...".format(sys.argv[0])
|
||||
sys.exit(-1)
|
||||
|
||||
# we need descriptors, because the consensus does not have contact infos
|
||||
descriptor_list = remote.get_server_descriptors(fingerprints=sys.argv[1:]).run()
|
||||
|
||||
descriptor_list_fingerprints = []
|
||||
for d in descriptor_list:
|
||||
assert d.fingerprint in sys.argv[1:]
|
||||
descriptor_list_fingerprints.append(d.fingerprint)
|
||||
print "{} {}".format(d.fingerprint, d.contact)
|
||||
|
||||
for fingerprint in sys.argv[1:]:
|
||||
if fingerprint not in descriptor_list_fingerprints:
|
||||
print "{} not found in current descriptors".format(fingerprint)
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user