aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorteor <teor2345@gmail.com>2017-12-23 00:23:12 +1100
committerteor <teor2345@gmail.com>2018-01-05 13:27:07 +1100
commit561f18e724c15c0ad22d2915786fdb8e6ddd9c30 (patch)
treef43ad0390d4f9e7d195fc76539bed5f350ef719f /scripts
parent384a450a472818ff13b18b971c92f7a52ca71ac9 (diff)
downloadtor-561f18e724c15c0ad22d2915786fdb8e6ddd9c30.tar.gz
tor-561f18e724c15c0ad22d2915786fdb8e6ddd9c30.zip
Add a nickname to each fallback in a C comment
This makes it easier for operators to find their relays, and allows stem to use nicknames to identify fallbacks. Implements ticket 24600.
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/maint/updateFallbackDirs.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/scripts/maint/updateFallbackDirs.py b/scripts/maint/updateFallbackDirs.py
index 7bd6fae0e3..4e4000dceb 100755
--- a/scripts/maint/updateFallbackDirs.py
+++ b/scripts/maint/updateFallbackDirs.py
@@ -1331,6 +1331,7 @@ class Candidate(object):
def fallbackdir_info(self, dl_speed_ok):
# "address:dirport orport=port id=fingerprint"
# "[ipv6=addr:orport]"
+ # /* nickname=name */
# ,
#
# Do we want a C string, or a commented-out string?
@@ -1355,6 +1356,12 @@ class Candidate(object):
if self.has_ipv6():
s += '" ipv6=%s:%d"'%(cleanse_c_string(self.ipv6addr), self.ipv6orport)
s += '\n'
+ if not comment_string:
+ s += '/* '
+ s += 'nickname=%s'%(cleanse_c_string(self._data['nickname']))
+ if not comment_string:
+ s += ' */'
+ s += '\n'
s += ','
if comment_string:
s += '\n'