From e453d373b676d26c77f64f159c03dd8c9d7820c2 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sat, 25 Dec 2021 20:36:53 +0000 Subject: [PATCH] Snake case --- daemon.py | 10 +++++----- epicyon.py | 12 ++++++------ tests.py | 8 ++++---- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/daemon.py b/daemon.py index c4fbfe1cd..cf4a8c4e5 100644 --- a/daemon.py +++ b/daemon.py @@ -797,7 +797,7 @@ class PubServer(BaseHTTPRequestHandler): self.send_header('Set-Cookie', 'epicyon=; SameSite=Strict') self.send_header('Location', self._quoted_redirect(redirect)) self.send_header('Host', callingDomain) - self.send_header('X-AP-Instance-ID', self.server.instanceId) + self.send_header('X-AP-Instance-ID', self.server.instance_id) self.send_header('Content-Length', '0') self.end_headers() @@ -820,7 +820,7 @@ class PubServer(BaseHTTPRequestHandler): if permissive: self.send_header('Access-Control-Allow-Origin', '*') return - self.send_header('X-AP-Instance-ID', self.server.instanceId) + self.send_header('X-AP-Instance-ID', self.server.instance_id) self.send_header('X-Clacks-Overhead', 'GNU Natalie Nguyen') if cookie: cookieStr = cookie @@ -917,7 +917,7 @@ class PubServer(BaseHTTPRequestHandler): self.send_header('Set-Cookie', cookieStr) self.send_header('Location', self._quoted_redirect(redirect)) self.send_header('Host', callingDomain) - self.send_header('X-AP-Instance-ID', self.server.instanceId) + self.send_header('X-AP-Instance-ID', self.server.instance_id) self.send_header('Content-Length', '0') self.end_headers() @@ -18456,7 +18456,7 @@ def runDaemon(content_license_url: str, max_recent_posts: int, enable_shared_inbox: bool, registration: bool, language: str, project_version: str, - instanceId: str, clientToServer: bool, + instance_id: str, clientToServer: bool, base_dir: str, domain: str, onionDomain: str, i2pDomain: str, yt_replace_domain: str, @@ -18726,7 +18726,7 @@ def runDaemon(content_license_url: str, httpd.shared_items_federated_domains = \ shared_items_federated_domains.copy() httpd.base_dir = base_dir - httpd.instanceId = instanceId + httpd.instance_id = instance_id httpd.personCache = {} httpd.cachedWebfingers = {} httpd.faviconsCache = {} diff --git a/epicyon.py b/epicyon.py index f181c6134..8c963814c 100644 --- a/epicyon.py +++ b/epicyon.py @@ -1100,11 +1100,11 @@ if args.resetregistrations: print('Number of new registrations reset to ' + str(maxRegistrations)) # unique ID for the instance -instanceId = getConfigParam(base_dir, 'instanceId') -if not instanceId: - instanceId = createPassword(32) - setConfigParam(base_dir, 'instanceId', instanceId) - print('Instance ID: ' + instanceId) +instance_id = getConfigParam(base_dir, 'instance_id') +if not instance_id: + instance_id = createPassword(32) + setConfigParam(base_dir, 'instance_id', instance_id) + print('Instance ID: ' + instance_id) # get domain name from configuration configDomain = getConfigParam(base_dir, 'domain') @@ -3246,7 +3246,7 @@ if __name__ == "__main__": args.max_recent_posts, not args.nosharedinbox, registration, args.language, __version__, - instanceId, args.client, base_dir, + instance_id, args.client, base_dir, domain, onionDomain, i2pDomain, args.yt_replace_domain, args.twitterReplacementDomain, diff --git a/tests.py b/tests.py index f2ee5aec1..538599923 100644 --- a/tests.py +++ b/tests.py @@ -813,7 +813,7 @@ def createServerAlice(path: str, domain: str, port: int, 0, 100, 1024, 5, False, 0, False, 1, False, False, False, 5, True, True, 'en', __version__, - "instanceId", False, path, domain, + "instance_id", False, path, domain, onionDomain, i2pDomain, None, None, port, port, http_prefix, federationList, maxMentions, maxEmoji, False, proxyType, maxReplies, @@ -955,7 +955,7 @@ def createServerBob(path: str, domain: str, port: int, 0, 100, 1024, 5, False, 0, False, 1, False, False, False, 5, True, True, 'en', __version__, - "instanceId", False, path, domain, + "instance_id", False, path, domain, onionDomain, i2pDomain, None, None, port, port, http_prefix, federationList, maxMentions, maxEmoji, False, proxyType, maxReplies, @@ -1025,7 +1025,7 @@ def createServerEve(path: str, domain: str, port: int, federationList: [], 0, 100, 1024, 5, False, 0, False, 1, False, False, False, 5, True, True, 'en', __version__, - "instanceId", False, path, domain, + "instance_id", False, path, domain, onionDomain, i2pDomain, None, None, port, port, http_prefix, federationList, maxMentions, maxEmoji, False, proxyType, maxReplies, allowDeletion, True, True, False, @@ -1097,7 +1097,7 @@ def createServerGroup(path: str, domain: str, port: int, 0, 100, 1024, 5, False, 0, False, 1, False, False, False, 5, True, True, 'en', __version__, - "instanceId", False, path, domain, + "instance_id", False, path, domain, onionDomain, i2pDomain, None, None, port, port, http_prefix, federationList, maxMentions, maxEmoji, False, proxyType, maxReplies,