[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [stem/master] Synchronize fallback cache
commit 6d331d7d9d2aa239510d413fcc07f79806fe7834
Author: Damian Johnson <atagar@xxxxxxxxxxxxxx>
Date: Sun Jul 19 15:42:47 2020 -0700
Synchronize fallback cache
Fixing our cache script and re-syncing fallback directory data. The only
difference seems to be the order of our header metadata.
---
cache_fallback_directories.py | 6 +++---
stem/cached_fallbacks.cfg | 10 +++++-----
stem/cached_manual.sqlite | Bin 253952 -> 253952 bytes
stem/directory.py | 2 +-
4 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/cache_fallback_directories.py b/cache_fallback_directories.py
index 91ad40c0..7f712683 100755
--- a/cache_fallback_directories.py
+++ b/cache_fallback_directories.py
@@ -14,12 +14,12 @@ import stem.directory
import stem.util.system
GITWEB_FALLBACK_LOG = 'https://gitweb.torproject.org/tor.git/log/src/app/config/fallback_dirs.inc'
-FALLBACK_DIR_LINK = "href='/tor.git/commit/src/app/config/fallback_dirs.inc\\?id=([^']*)'"
+FALLBACK_DIR_LINK = b"href='/tor.git/commit/src/app/config/fallback_dirs.inc\\?id=([^']*)'"
if __name__ == '__main__':
try:
fallback_dir_page = urllib.request.urlopen(GITWEB_FALLBACK_LOG).read()
- fallback_dir_commit = re.search(FALLBACK_DIR_LINK, fallback_dir_page).group(1)
+ fallback_dir_commit = re.search(FALLBACK_DIR_LINK, fallback_dir_page).group(1).decode('utf-8')
except:
print("Unable to determine the latest commit to edit tor's fallback directories: %s" % sys.exc_info()[1])
sys.exit(1)
@@ -43,7 +43,7 @@ if __name__ == '__main__':
# all fallbacks have the same header metadata, so just picking one
- headers = latest_fallback_directories.values()[0].header if latest_fallback_directories else None
+ headers = list(latest_fallback_directories.values())[0].header if latest_fallback_directories else None
print('Differences detected...\n')
print(stem.directory._fallback_directory_differences(cached_fallback_directories, latest_fallback_directories))
diff --git a/stem/cached_fallbacks.cfg b/stem/cached_fallbacks.cfg
index 90f5db5b..33e0051e 100644
--- a/stem/cached_fallbacks.cfg
+++ b/stem/cached_fallbacks.cfg
@@ -1,11 +1,11 @@
-tor_commit 1dd95278970f9f32d83a31fe73e0258a30523539
-stem_commit ec67e06398d6bbbcefdc14b56d2e91bd49f47539
-header.timestamp 20190625114911
-header.source whitelist
+tor_commit 268d01ada5f4a11c5d8e63215288eb593dbfb9ed
+stem_commit ab6ce01a81a878597fa0662a31b1e0f1e057974a
+header.type fallback
header.version 2.0.0
+header.timestamp 20190625114911
header.timestamp0 20190625114911
header.timestamp1 20190628085927
-header.type fallback
+header.source allowlist
001524DD403D729F08F7E5D77813EF12756CFA8D.address 185.13.39.197
001524DD403D729F08F7E5D77813EF12756CFA8D.or_port 443
001524DD403D729F08F7E5D77813EF12756CFA8D.dir_port 80
diff --git a/stem/cached_manual.sqlite b/stem/cached_manual.sqlite
index c967dd32..809512fe 100644
Binary files a/stem/cached_manual.sqlite and b/stem/cached_manual.sqlite differ
diff --git a/stem/directory.py b/stem/directory.py
index 6f1b8958..20982ccc 100644
--- a/stem/directory.py
+++ b/stem/directory.py
@@ -550,7 +550,7 @@ def _fallback_directory_differences(previous_directories: Mapping[str, 'stem.dir
new_directory = new_directories[fp]
if previous_directory != new_directory:
- for attr in ('address', 'or_port', 'dir_port', 'fingerprint', 'orport_v6'):
+ for attr in ('address', 'or_port', 'dir_port', 'fingerprint', 'orport_v6', 'header'):
old_attr = getattr(previous_directory, attr)
new_attr = getattr(new_directory, attr)
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits