From 7353c8ff909afa947919a2c0f474809eb13a493f Mon Sep 17 00:00:00 2001 From: caryoscelus Date: Fri, 1 Jul 2022 19:28:53 +0000 Subject: [PATCH] reduce fingerprinting of site owner replace version with generic `user_agent` that will remain constant --- src/Config.py | 3 ++- src/Connection/Connection.py | 2 +- src/Content/ContentManager.py | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Config.py b/src/Config.py index fcb304f2..d7a25d7e 100644 --- a/src/Config.py +++ b/src/Config.py @@ -14,8 +14,9 @@ class Config(object): def __init__(self, argv): self.version = "0.7.6+" + self.user_agent = "conservancy" # DEPRECATED ; replace with git-generated commit - self.rev = 5031 + self.rev = 5032 self.argv = argv self.action = None self.test_parser = None diff --git a/src/Connection/Connection.py b/src/Connection/Connection.py index 4adb3227..de95d867 100644 --- a/src/Connection/Connection.py +++ b/src/Connection/Connection.py @@ -362,7 +362,7 @@ class Connection(object): self.server.log.warning("Unknown target onion address: %s" % self.target_onion) handshake = { - "version": "conservancy", + "version": config.user_agent, "protocol": "v2", "use_bin_type": True, "peer_id": peer_id, diff --git a/src/Content/ContentManager.py b/src/Content/ContentManager.py index 0c0f27a7..42f222b0 100644 --- a/src/Content/ContentManager.py +++ b/src/Content/ContentManager.py @@ -729,7 +729,8 @@ class ContentManager(object): new_content["modified"] = int(time.time()) # Add timestamp if inner_path == "content.json": - new_content["zeronet_version"] = config.version + # add for backward compatibility, but don't expose user version + new_content["zeronet_version"] = config.user_agent new_content["signs_required"] = content.get("signs_required", 1) new_content["address"] = self.site.address