mirror of https://gitlab.com/bashrc2/epicyon
Snake case
parent
3c1c0f2feb
commit
5aa2e2f7c3
18
daemon.py
18
daemon.py
|
@ -534,7 +534,7 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
self.server.http_prefix,
|
self.server.http_prefix,
|
||||||
self.server.domainFull,
|
self.server.domainFull,
|
||||||
postJsonObject,
|
postJsonObject,
|
||||||
self.server.maxReplies,
|
self.server.max_replies,
|
||||||
self.server.debug)
|
self.server.debug)
|
||||||
# record the vote
|
# record the vote
|
||||||
try:
|
try:
|
||||||
|
@ -16652,7 +16652,7 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
self.server.http_prefix,
|
self.server.http_prefix,
|
||||||
self.server.domainFull,
|
self.server.domainFull,
|
||||||
messageJson,
|
messageJson,
|
||||||
self.server.maxReplies,
|
self.server.max_replies,
|
||||||
self.server.debug)
|
self.server.debug)
|
||||||
return 1
|
return 1
|
||||||
else:
|
else:
|
||||||
|
@ -16729,7 +16729,7 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
self.server.http_prefix,
|
self.server.http_prefix,
|
||||||
self.server.domainFull,
|
self.server.domainFull,
|
||||||
messageJson,
|
messageJson,
|
||||||
self.server.maxReplies,
|
self.server.max_replies,
|
||||||
self.server.debug)
|
self.server.debug)
|
||||||
return 1
|
return 1
|
||||||
else:
|
else:
|
||||||
|
@ -16879,7 +16879,7 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
self.server.http_prefix,
|
self.server.http_prefix,
|
||||||
self.server.domain,
|
self.server.domain,
|
||||||
messageJson,
|
messageJson,
|
||||||
self.server.maxReplies,
|
self.server.max_replies,
|
||||||
self.server.debug)
|
self.server.debug)
|
||||||
return 1
|
return 1
|
||||||
else:
|
else:
|
||||||
|
@ -16931,7 +16931,7 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
self.server.http_prefix,
|
self.server.http_prefix,
|
||||||
self.server.domain,
|
self.server.domain,
|
||||||
messageJson,
|
messageJson,
|
||||||
self.server.maxReplies,
|
self.server.max_replies,
|
||||||
self.server.debug)
|
self.server.debug)
|
||||||
return 1
|
return 1
|
||||||
else:
|
else:
|
||||||
|
@ -16990,7 +16990,7 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
self.server.http_prefix,
|
self.server.http_prefix,
|
||||||
self.server.domain,
|
self.server.domain,
|
||||||
messageJson,
|
messageJson,
|
||||||
self.server.maxReplies,
|
self.server.max_replies,
|
||||||
self.server.debug)
|
self.server.debug)
|
||||||
return 1
|
return 1
|
||||||
else:
|
else:
|
||||||
|
@ -18476,7 +18476,7 @@ def runDaemon(content_license_url: str,
|
||||||
fed_list: [] = [],
|
fed_list: [] = [],
|
||||||
max_mentions: int = 10, max_emoji: int = 10,
|
max_mentions: int = 10, max_emoji: int = 10,
|
||||||
secure_mode: bool = False,
|
secure_mode: bool = False,
|
||||||
proxy_type: str = None, maxReplies: int = 64,
|
proxy_type: str = None, max_replies: int = 64,
|
||||||
domainMaxPostsPerDay: int = 8640,
|
domainMaxPostsPerDay: int = 8640,
|
||||||
accountMaxPostsPerDay: int = 864,
|
accountMaxPostsPerDay: int = 864,
|
||||||
allowDeletion: bool = False,
|
allowDeletion: bool = False,
|
||||||
|
@ -18757,7 +18757,7 @@ def runDaemon(content_license_url: str,
|
||||||
httpd.lastLoginFailure = 0
|
httpd.lastLoginFailure = 0
|
||||||
httpd.loginFailureCount = {}
|
httpd.loginFailureCount = {}
|
||||||
httpd.log_login_failures = log_login_failures
|
httpd.log_login_failures = log_login_failures
|
||||||
httpd.maxReplies = maxReplies
|
httpd.max_replies = max_replies
|
||||||
httpd.tokens = {}
|
httpd.tokens = {}
|
||||||
httpd.tokensLookup = {}
|
httpd.tokensLookup = {}
|
||||||
loadTokens(base_dir, httpd.tokens, httpd.tokensLookup)
|
loadTokens(base_dir, httpd.tokens, httpd.tokensLookup)
|
||||||
|
@ -18927,7 +18927,7 @@ def runDaemon(content_license_url: str,
|
||||||
domain, onion_domain, i2p_domain,
|
domain, onion_domain, i2p_domain,
|
||||||
port, proxy_type,
|
port, proxy_type,
|
||||||
httpd.federationList,
|
httpd.federationList,
|
||||||
maxReplies,
|
max_replies,
|
||||||
domainMaxPostsPerDay,
|
domainMaxPostsPerDay,
|
||||||
accountMaxPostsPerDay,
|
accountMaxPostsPerDay,
|
||||||
allowDeletion, debug,
|
allowDeletion, debug,
|
||||||
|
|
|
@ -640,7 +640,7 @@ def _showLikesOnPost(postJsonObject: {}, maxLikes: int) -> None:
|
||||||
break
|
break
|
||||||
|
|
||||||
|
|
||||||
def _showRepliesOnPost(postJsonObject: {}, maxReplies: int) -> None:
|
def _showRepliesOnPost(postJsonObject: {}, max_replies: int) -> None:
|
||||||
"""Shows the replies on a post
|
"""Shows the replies on a post
|
||||||
"""
|
"""
|
||||||
if not hasObjectDict(postJsonObject):
|
if not hasObjectDict(postJsonObject):
|
||||||
|
@ -659,7 +659,7 @@ def _showRepliesOnPost(postJsonObject: {}, maxReplies: int) -> None:
|
||||||
for item in objectReplies['items']:
|
for item in objectReplies['items']:
|
||||||
print(' ↰ ' + str(item['url']))
|
print(' ↰ ' + str(item['url']))
|
||||||
ctr += 1
|
ctr += 1
|
||||||
if ctr >= maxReplies:
|
if ctr >= max_replies:
|
||||||
break
|
break
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -556,7 +556,7 @@ parser.add_argument('--deny', dest='deny', type=str, default=None,
|
||||||
parser.add_argument("-c", "--client", type=str2bool, nargs='?',
|
parser.add_argument("-c", "--client", type=str2bool, nargs='?',
|
||||||
const=True, default=False,
|
const=True, default=False,
|
||||||
help="Use as an ActivityPub client")
|
help="Use as an ActivityPub client")
|
||||||
parser.add_argument('--maxreplies', dest='maxReplies', type=int, default=64,
|
parser.add_argument('--maxreplies', dest='max_replies', type=int, default=64,
|
||||||
help='Maximum number of replies to a post')
|
help='Maximum number of replies to a post')
|
||||||
parser.add_argument('--max_mentions', '--hellthread', dest='max_mentions',
|
parser.add_argument('--max_mentions', '--hellthread', dest='max_mentions',
|
||||||
type=int, default=10,
|
type=int, default=10,
|
||||||
|
@ -3253,7 +3253,7 @@ if __name__ == "__main__":
|
||||||
port, proxy_port, http_prefix,
|
port, proxy_port, http_prefix,
|
||||||
federationList, args.max_mentions,
|
federationList, args.max_mentions,
|
||||||
args.max_emoji, args.secure_mode,
|
args.max_emoji, args.secure_mode,
|
||||||
proxy_type, args.maxReplies,
|
proxy_type, args.max_replies,
|
||||||
args.domainMaxPostsPerDay,
|
args.domainMaxPostsPerDay,
|
||||||
args.accountMaxPostsPerDay,
|
args.accountMaxPostsPerDay,
|
||||||
args.allowdeletion, debug, False,
|
args.allowdeletion, debug, False,
|
||||||
|
|
12
inbox.py
12
inbox.py
|
@ -2105,7 +2105,7 @@ def _postAllowsComments(postFilename: str) -> bool:
|
||||||
|
|
||||||
|
|
||||||
def populateReplies(base_dir: str, http_prefix: str, domain: str,
|
def populateReplies(base_dir: str, http_prefix: str, domain: str,
|
||||||
messageJson: {}, maxReplies: int, debug: bool) -> bool:
|
messageJson: {}, max_replies: int, debug: bool) -> bool:
|
||||||
"""Updates the list of replies for a post on this domain if
|
"""Updates the list of replies for a post on this domain if
|
||||||
a reply to it arrives
|
a reply to it arrives
|
||||||
"""
|
"""
|
||||||
|
@ -2155,7 +2155,7 @@ def populateReplies(base_dir: str, http_prefix: str, domain: str,
|
||||||
messageId = removeIdEnding(messageJson['id'])
|
messageId = removeIdEnding(messageJson['id'])
|
||||||
if os.path.isfile(postRepliesFilename):
|
if os.path.isfile(postRepliesFilename):
|
||||||
numLines = sum(1 for line in open(postRepliesFilename))
|
numLines = sum(1 for line in open(postRepliesFilename))
|
||||||
if numLines > maxReplies:
|
if numLines > max_replies:
|
||||||
return False
|
return False
|
||||||
if messageId not in open(postRepliesFilename).read():
|
if messageId not in open(postRepliesFilename).read():
|
||||||
try:
|
try:
|
||||||
|
@ -3185,7 +3185,7 @@ def _inboxAfterInitial(recentPostsCache: {}, max_recent_posts: int,
|
||||||
port: int, proxy_type: str,
|
port: int, proxy_type: str,
|
||||||
federationList: [], debug: bool,
|
federationList: [], debug: bool,
|
||||||
queueFilename: str, destinationFilename: str,
|
queueFilename: str, destinationFilename: str,
|
||||||
maxReplies: int, allowDeletion: bool,
|
max_replies: int, allowDeletion: bool,
|
||||||
max_mentions: int, max_emoji: int, translate: {},
|
max_mentions: int, max_emoji: int, translate: {},
|
||||||
unitTest: bool,
|
unitTest: bool,
|
||||||
yt_replace_domain: str,
|
yt_replace_domain: str,
|
||||||
|
@ -3446,7 +3446,7 @@ def _inboxAfterInitial(recentPostsCache: {}, max_recent_posts: int,
|
||||||
# list of indexes to be updated
|
# list of indexes to be updated
|
||||||
updateIndexList = ['inbox']
|
updateIndexList = ['inbox']
|
||||||
populateReplies(base_dir, http_prefix, domain, postJsonObject,
|
populateReplies(base_dir, http_prefix, domain, postJsonObject,
|
||||||
maxReplies, debug)
|
max_replies, debug)
|
||||||
|
|
||||||
_receiveQuestionVote(base_dir, nickname, domain,
|
_receiveQuestionVote(base_dir, nickname, domain,
|
||||||
http_prefix, handle, debug,
|
http_prefix, handle, debug,
|
||||||
|
@ -4067,7 +4067,7 @@ def runInboxQueue(recentPostsCache: {}, max_recent_posts: int,
|
||||||
domain: str,
|
domain: str,
|
||||||
onion_domain: str, i2p_domain: str,
|
onion_domain: str, i2p_domain: str,
|
||||||
port: int, proxy_type: str,
|
port: int, proxy_type: str,
|
||||||
federationList: [], maxReplies: int,
|
federationList: [], max_replies: int,
|
||||||
domainMaxPostsPerDay: int,
|
domainMaxPostsPerDay: int,
|
||||||
accountMaxPostsPerDay: int,
|
accountMaxPostsPerDay: int,
|
||||||
allowDeletion: bool, debug: bool, max_mentions: int,
|
allowDeletion: bool, debug: bool, max_mentions: int,
|
||||||
|
@ -4500,7 +4500,7 @@ def runInboxQueue(recentPostsCache: {}, max_recent_posts: int,
|
||||||
federationList,
|
federationList,
|
||||||
debug,
|
debug,
|
||||||
queueFilename, destination,
|
queueFilename, destination,
|
||||||
maxReplies, allowDeletion,
|
max_replies, allowDeletion,
|
||||||
max_mentions, max_emoji,
|
max_mentions, max_emoji,
|
||||||
translate, unitTest,
|
translate, unitTest,
|
||||||
yt_replace_domain,
|
yt_replace_domain,
|
||||||
|
|
16
tests.py
16
tests.py
|
@ -693,7 +693,7 @@ def createServerAlice(path: str, domain: str, port: int,
|
||||||
http_prefix = 'http'
|
http_prefix = 'http'
|
||||||
proxy_type = None
|
proxy_type = None
|
||||||
password = 'alicepass'
|
password = 'alicepass'
|
||||||
maxReplies = 64
|
max_replies = 64
|
||||||
domainMaxPostsPerDay = 1000
|
domainMaxPostsPerDay = 1000
|
||||||
accountMaxPostsPerDay = 1000
|
accountMaxPostsPerDay = 1000
|
||||||
allowDeletion = True
|
allowDeletion = True
|
||||||
|
@ -816,7 +816,7 @@ def createServerAlice(path: str, domain: str, port: int,
|
||||||
"instance_id", False, path, domain,
|
"instance_id", False, path, domain,
|
||||||
onion_domain, i2p_domain, None, None, port, port,
|
onion_domain, i2p_domain, None, None, port, port,
|
||||||
http_prefix, federationList, max_mentions, max_emoji, False,
|
http_prefix, federationList, max_mentions, max_emoji, False,
|
||||||
proxy_type, maxReplies,
|
proxy_type, max_replies,
|
||||||
domainMaxPostsPerDay, accountMaxPostsPerDay,
|
domainMaxPostsPerDay, accountMaxPostsPerDay,
|
||||||
allowDeletion, True, True, False, sendThreads,
|
allowDeletion, True, True, False, sendThreads,
|
||||||
False)
|
False)
|
||||||
|
@ -838,7 +838,7 @@ def createServerBob(path: str, domain: str, port: int,
|
||||||
proxy_type = None
|
proxy_type = None
|
||||||
client_to_server = False
|
client_to_server = False
|
||||||
password = 'bobpass'
|
password = 'bobpass'
|
||||||
maxReplies = 64
|
max_replies = 64
|
||||||
domainMaxPostsPerDay = 1000
|
domainMaxPostsPerDay = 1000
|
||||||
accountMaxPostsPerDay = 1000
|
accountMaxPostsPerDay = 1000
|
||||||
allowDeletion = True
|
allowDeletion = True
|
||||||
|
@ -958,7 +958,7 @@ def createServerBob(path: str, domain: str, port: int,
|
||||||
"instance_id", False, path, domain,
|
"instance_id", False, path, domain,
|
||||||
onion_domain, i2p_domain, None, None, port, port,
|
onion_domain, i2p_domain, None, None, port, port,
|
||||||
http_prefix, federationList, max_mentions, max_emoji, False,
|
http_prefix, federationList, max_mentions, max_emoji, False,
|
||||||
proxy_type, maxReplies,
|
proxy_type, max_replies,
|
||||||
domainMaxPostsPerDay, accountMaxPostsPerDay,
|
domainMaxPostsPerDay, accountMaxPostsPerDay,
|
||||||
allowDeletion, True, True, False, sendThreads,
|
allowDeletion, True, True, False, sendThreads,
|
||||||
False)
|
False)
|
||||||
|
@ -977,7 +977,7 @@ def createServerEve(path: str, domain: str, port: int, federationList: [],
|
||||||
http_prefix = 'http'
|
http_prefix = 'http'
|
||||||
proxy_type = None
|
proxy_type = None
|
||||||
password = 'evepass'
|
password = 'evepass'
|
||||||
maxReplies = 64
|
max_replies = 64
|
||||||
allowDeletion = True
|
allowDeletion = True
|
||||||
privateKeyPem, publicKeyPem, person, wfEndpoint = \
|
privateKeyPem, publicKeyPem, person, wfEndpoint = \
|
||||||
createPerson(path, nickname, domain, port, http_prefix, True,
|
createPerson(path, nickname, domain, port, http_prefix, True,
|
||||||
|
@ -1028,7 +1028,7 @@ def createServerEve(path: str, domain: str, port: int, federationList: [],
|
||||||
"instance_id", False, path, domain,
|
"instance_id", False, path, domain,
|
||||||
onion_domain, i2p_domain, None, None, port, port,
|
onion_domain, i2p_domain, None, None, port, port,
|
||||||
http_prefix, federationList, max_mentions, max_emoji, False,
|
http_prefix, federationList, max_mentions, max_emoji, False,
|
||||||
proxy_type, maxReplies, allowDeletion, True, True, False,
|
proxy_type, max_replies, allowDeletion, True, True, False,
|
||||||
sendThreads, False)
|
sendThreads, False)
|
||||||
|
|
||||||
|
|
||||||
|
@ -1047,7 +1047,7 @@ def createServerGroup(path: str, domain: str, port: int,
|
||||||
http_prefix = 'http'
|
http_prefix = 'http'
|
||||||
proxy_type = None
|
proxy_type = None
|
||||||
password = 'testgrouppass'
|
password = 'testgrouppass'
|
||||||
maxReplies = 64
|
max_replies = 64
|
||||||
domainMaxPostsPerDay = 1000
|
domainMaxPostsPerDay = 1000
|
||||||
accountMaxPostsPerDay = 1000
|
accountMaxPostsPerDay = 1000
|
||||||
allowDeletion = True
|
allowDeletion = True
|
||||||
|
@ -1100,7 +1100,7 @@ def createServerGroup(path: str, domain: str, port: int,
|
||||||
"instance_id", False, path, domain,
|
"instance_id", False, path, domain,
|
||||||
onion_domain, i2p_domain, None, None, port, port,
|
onion_domain, i2p_domain, None, None, port, port,
|
||||||
http_prefix, federationList, max_mentions, max_emoji, False,
|
http_prefix, federationList, max_mentions, max_emoji, False,
|
||||||
proxy_type, maxReplies,
|
proxy_type, max_replies,
|
||||||
domainMaxPostsPerDay, accountMaxPostsPerDay,
|
domainMaxPostsPerDay, accountMaxPostsPerDay,
|
||||||
allowDeletion, True, True, False, sendThreads,
|
allowDeletion, True, True, False, sendThreads,
|
||||||
False)
|
False)
|
||||||
|
|
Loading…
Reference in New Issue