diff --git a/daemon.py b/daemon.py index a8c4f2c16..c3231770b 100644 --- a/daemon.py +++ b/daemon.py @@ -5562,14 +5562,14 @@ class PubServer(BaseHTTPRequestHandler): setConfigParam(base_dir, "show_node_info_version", show_node_info_version) - verifyAllSignatures = False + verify_all_signatures = False if fields.get('verifyallsignatures'): if fields['verifyallsignatures'] == 'on': - verifyAllSignatures = True - self.server.verifyAllSignatures = \ - verifyAllSignatures - setConfigParam(base_dir, "verifyAllSignatures", - verifyAllSignatures) + verify_all_signatures = True + self.server.verify_all_signatures = \ + verify_all_signatures + setConfigParam(base_dir, "verify_all_signatures", + verify_all_signatures) broch_mode = False if fields.get('broch_mode'): @@ -18412,7 +18412,7 @@ def runDaemon(content_license_url: str, show_node_info_accounts: bool, show_node_info_version: bool, broch_mode: bool, - verifyAllSignatures: bool, + verify_all_signatures: bool, sendThreadsTimeoutMins: int, dormantMonths: int, maxNewswirePosts: int, @@ -18579,7 +18579,7 @@ def runDaemon(content_license_url: str, httpd.maxNewswirePosts = maxNewswirePosts # whether to require that all incoming posts have valid jsonld signatures - httpd.verifyAllSignatures = verifyAllSignatures + httpd.verify_all_signatures = verify_all_signatures # This counter is used to update the list of blocked domains in memory. # It helps to avoid touching the disk and so improves flooding resistance @@ -18907,7 +18907,7 @@ def runDaemon(content_license_url: str, httpd.maxFollowers, httpd.allowLocalNetworkAccess, httpd.peertubeInstances, - verifyAllSignatures, + verify_all_signatures, httpd.themeName, httpd.systemLanguage, httpd.max_like_count, diff --git a/epicyon.py b/epicyon.py index c045a71e1..1e475f9a0 100644 --- a/epicyon.py +++ b/epicyon.py @@ -371,8 +371,8 @@ parser.add_argument("--allowLocalNetworkAccess", help="Whether to allow access to local network " + "addresses. This might be useful when deploying in " + "a mesh network") -parser.add_argument("--verifyAllSignatures", - dest='verifyAllSignatures', +parser.add_argument("--verify_all_signatures", + dest='verify_all_signatures', type=str2bool, nargs='?', const=True, default=False, help="Whether to require that all incoming " + @@ -3108,10 +3108,10 @@ allowLocalNetworkAccess = \ if allowLocalNetworkAccess is not None: args.allowLocalNetworkAccess = bool(allowLocalNetworkAccess) -verifyAllSignatures = \ - getConfigParam(base_dir, 'verifyAllSignatures') -if verifyAllSignatures is not None: - args.verifyAllSignatures = bool(verifyAllSignatures) +verify_all_signatures = \ + getConfigParam(base_dir, 'verify_all_signatures') +if verify_all_signatures is not None: + args.verify_all_signatures = bool(verify_all_signatures) broch_mode = \ getConfigParam(base_dir, 'broch_mode') @@ -3221,7 +3221,7 @@ if __name__ == "__main__": args.show_node_info_accounts, args.show_node_info_version, args.broch_mode, - args.verifyAllSignatures, + args.verify_all_signatures, args.sendThreadsTimeoutMins, args.dormantMonths, args.maxNewswirePosts, diff --git a/inbox.py b/inbox.py index a04edfcb3..61f6471ee 100644 --- a/inbox.py +++ b/inbox.py @@ -4077,7 +4077,7 @@ def runInboxQueue(recentPostsCache: {}, maxRecentPosts: int, maxFollowers: int, allowLocalNetworkAccess: bool, peertubeInstances: [], - verifyAllSignatures: bool, + verify_all_signatures: bool, themeName: str, systemLanguage: str, max_like_count: int, signingPrivateKeyPem: str, default_reply_interval_hrs: int, @@ -4196,9 +4196,9 @@ def runInboxQueue(recentPostsCache: {}, maxRecentPosts: int, 'accounts': {} } # also check if the json signature enforcement has changed - verifyAllSigs = getConfigParam(base_dir, "verifyAllSignatures") + verifyAllSigs = getConfigParam(base_dir, "verify_all_signatures") if verifyAllSigs is not None: - verifyAllSignatures = verifyAllSigs + verify_all_signatures = verifyAllSigs # change the last time that this was done quotasLastUpdatePerMin = currTime @@ -4294,12 +4294,12 @@ def runInboxQueue(recentPostsCache: {}, maxRecentPosts: int, if debug: pprint(queueJson['httpHeaders']) - if verifyAllSignatures: + if verify_all_signatures: originalJson = queueJson['original'] print('Queue: inbox post does not have a jsonld signature ' + keyId + ' ' + str(originalJson)) - if httpSignatureFailed or verifyAllSignatures: + if httpSignatureFailed or verify_all_signatures: if os.path.isfile(queueFilename): try: os.remove(queueFilename) @@ -4310,7 +4310,7 @@ def runInboxQueue(recentPostsCache: {}, maxRecentPosts: int, queue.pop(0) continue else: - if httpSignatureFailed or verifyAllSignatures: + if httpSignatureFailed or verify_all_signatures: # use the original json message received, not one which # may have been modified along the way originalJson = queueJson['original'] diff --git a/tests.py b/tests.py index e6976c6cd..a3d6ce2c7 100644 --- a/tests.py +++ b/tests.py @@ -784,7 +784,7 @@ def createServerAlice(path: str, domain: str, port: int, dormantMonths = 3 sendThreadsTimeoutMins = 30 maxFollowers = 10 - verifyAllSignatures = True + verify_all_signatures = True broch_mode = False show_node_info_accounts = True show_node_info_version = True @@ -805,7 +805,7 @@ def createServerAlice(path: str, domain: str, port: int, show_node_info_accounts, show_node_info_version, broch_mode, - verifyAllSignatures, + verify_all_signatures, sendThreadsTimeoutMins, dormantMonths, maxNewswirePosts, allowLocalNetworkAccess, @@ -926,7 +926,7 @@ def createServerBob(path: str, domain: str, port: int, dormantMonths = 3 sendThreadsTimeoutMins = 30 maxFollowers = 10 - verifyAllSignatures = True + verify_all_signatures = True broch_mode = False show_node_info_accounts = True show_node_info_version = True @@ -947,7 +947,7 @@ def createServerBob(path: str, domain: str, port: int, show_node_info_accounts, show_node_info_version, broch_mode, - verifyAllSignatures, + verify_all_signatures, sendThreadsTimeoutMins, dormantMonths, maxNewswirePosts, allowLocalNetworkAccess, @@ -995,7 +995,7 @@ def createServerEve(path: str, domain: str, port: int, federationList: [], dormantMonths = 3 sendThreadsTimeoutMins = 30 maxFollowers = 10 - verifyAllSignatures = True + verify_all_signatures = True broch_mode = False show_node_info_accounts = True show_node_info_version = True @@ -1017,7 +1017,7 @@ def createServerEve(path: str, domain: str, port: int, federationList: [], show_node_info_accounts, show_node_info_version, broch_mode, - verifyAllSignatures, + verify_all_signatures, sendThreadsTimeoutMins, dormantMonths, maxNewswirePosts, allowLocalNetworkAccess, @@ -1067,7 +1067,7 @@ def createServerGroup(path: str, domain: str, port: int, dormantMonths = 3 sendThreadsTimeoutMins = 30 maxFollowers = 10 - verifyAllSignatures = True + verify_all_signatures = True broch_mode = False show_node_info_accounts = True show_node_info_version = True @@ -1089,7 +1089,7 @@ def createServerGroup(path: str, domain: str, port: int, show_node_info_accounts, show_node_info_version, broch_mode, - verifyAllSignatures, + verify_all_signatures, sendThreadsTimeoutMins, dormantMonths, maxNewswirePosts, allowLocalNetworkAccess, diff --git a/webapp_profile.py b/webapp_profile.py index 56fafeff1..bf552efd4 100644 --- a/webapp_profile.py +++ b/webapp_profile.py @@ -1365,7 +1365,7 @@ def _htmlEditProfileInstance(base_dir: str, translate: {}, instanceStr += \ editCheckBox(nodeInfoStr, 'show_node_info_version', False) - if getConfigParam(base_dir, "verifyAllSignatures"): + if getConfigParam(base_dir, "verify_all_signatures"): instanceStr += \ editCheckBox(translate['Verify all signatures'], 'verifyallsignatures', True)