mirror of https://gitlab.com/bashrc2/epicyon
Snake case
parent
a7c1c5272b
commit
bd90c75f32
|
|
@ -18474,7 +18474,7 @@ def runDaemon(content_license_url: str,
|
||||||
port: int = 80, proxy_port: int = 80,
|
port: int = 80, proxy_port: int = 80,
|
||||||
http_prefix: str = 'https',
|
http_prefix: str = 'https',
|
||||||
fed_list: [] = [],
|
fed_list: [] = [],
|
||||||
max_mentions: int = 10, maxEmoji: int = 10,
|
max_mentions: int = 10, max_emoji: int = 10,
|
||||||
secureMode: bool = False,
|
secureMode: bool = False,
|
||||||
proxyType: str = None, maxReplies: int = 64,
|
proxyType: str = None, maxReplies: int = 64,
|
||||||
domainMaxPostsPerDay: int = 8640,
|
domainMaxPostsPerDay: int = 8640,
|
||||||
|
|
@ -18931,7 +18931,7 @@ def runDaemon(content_license_url: str,
|
||||||
domainMaxPostsPerDay,
|
domainMaxPostsPerDay,
|
||||||
accountMaxPostsPerDay,
|
accountMaxPostsPerDay,
|
||||||
allowDeletion, debug,
|
allowDeletion, debug,
|
||||||
max_mentions, maxEmoji,
|
max_mentions, max_emoji,
|
||||||
httpd.translate, unitTest,
|
httpd.translate, unitTest,
|
||||||
httpd.yt_replace_domain,
|
httpd.yt_replace_domain,
|
||||||
httpd.twitter_replacement_domain,
|
httpd.twitter_replacement_domain,
|
||||||
|
|
|
||||||
|
|
@ -561,7 +561,7 @@ parser.add_argument('--maxreplies', dest='maxReplies', type=int, default=64,
|
||||||
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,
|
||||||
help='Maximum number of mentions within a post')
|
help='Maximum number of mentions within a post')
|
||||||
parser.add_argument('--maxEmoji', '--maxemoji', dest='maxEmoji',
|
parser.add_argument('--max_emoji', '--maxemoji', dest='max_emoji',
|
||||||
type=int, default=10,
|
type=int, default=10,
|
||||||
help='Maximum number of emoji within a post')
|
help='Maximum number of emoji within a post')
|
||||||
parser.add_argument('--role', dest='role', type=str, default=None,
|
parser.add_argument('--role', dest='role', type=str, default=None,
|
||||||
|
|
@ -3252,7 +3252,7 @@ if __name__ == "__main__":
|
||||||
args.twitter_replacement_domain,
|
args.twitter_replacement_domain,
|
||||||
port, proxy_port, http_prefix,
|
port, proxy_port, http_prefix,
|
||||||
federationList, args.max_mentions,
|
federationList, args.max_mentions,
|
||||||
args.maxEmoji, args.secureMode,
|
args.max_emoji, args.secureMode,
|
||||||
proxyType, args.maxReplies,
|
proxyType, args.maxReplies,
|
||||||
args.domainMaxPostsPerDay,
|
args.domainMaxPostsPerDay,
|
||||||
args.accountMaxPostsPerDay,
|
args.accountMaxPostsPerDay,
|
||||||
|
|
|
||||||
12
inbox.py
12
inbox.py
|
|
@ -2185,7 +2185,7 @@ def _estimateNumberOfEmoji(content: str) -> int:
|
||||||
|
|
||||||
|
|
||||||
def _validPostContent(base_dir: str, nickname: str, domain: str,
|
def _validPostContent(base_dir: str, nickname: str, domain: str,
|
||||||
messageJson: {}, max_mentions: int, maxEmoji: int,
|
messageJson: {}, max_mentions: int, max_emoji: int,
|
||||||
allow_local_network_access: bool, debug: bool,
|
allow_local_network_access: bool, debug: bool,
|
||||||
systemLanguage: str,
|
systemLanguage: str,
|
||||||
http_prefix: str, domainFull: str,
|
http_prefix: str, domainFull: str,
|
||||||
|
|
@ -2244,7 +2244,7 @@ def _validPostContent(base_dir: str, nickname: str, domain: str,
|
||||||
print('REJECT HELLTHREAD: Too many mentions in post - ' +
|
print('REJECT HELLTHREAD: Too many mentions in post - ' +
|
||||||
contentStr)
|
contentStr)
|
||||||
return False
|
return False
|
||||||
if _estimateNumberOfEmoji(contentStr) > maxEmoji:
|
if _estimateNumberOfEmoji(contentStr) > max_emoji:
|
||||||
if messageJson['object'].get('id'):
|
if messageJson['object'].get('id'):
|
||||||
print('REJECT EMOJI OVERLOAD: ' + messageJson['object']['id'])
|
print('REJECT EMOJI OVERLOAD: ' + messageJson['object']['id'])
|
||||||
print('REJECT EMOJI OVERLOAD: Too many emoji in post - ' +
|
print('REJECT EMOJI OVERLOAD: Too many emoji in post - ' +
|
||||||
|
|
@ -3186,7 +3186,7 @@ def _inboxAfterInitial(recentPostsCache: {}, max_recent_posts: int,
|
||||||
federationList: [], debug: bool,
|
federationList: [], debug: bool,
|
||||||
queueFilename: str, destinationFilename: str,
|
queueFilename: str, destinationFilename: str,
|
||||||
maxReplies: int, allowDeletion: bool,
|
maxReplies: int, allowDeletion: bool,
|
||||||
max_mentions: int, maxEmoji: int, translate: {},
|
max_mentions: int, max_emoji: int, translate: {},
|
||||||
unitTest: bool,
|
unitTest: bool,
|
||||||
yt_replace_domain: str,
|
yt_replace_domain: str,
|
||||||
twitter_replacement_domain: str,
|
twitter_replacement_domain: str,
|
||||||
|
|
@ -3415,7 +3415,7 @@ def _inboxAfterInitial(recentPostsCache: {}, max_recent_posts: int,
|
||||||
jsonObj = None
|
jsonObj = None
|
||||||
domainFull = getFullDomain(domain, port)
|
domainFull = getFullDomain(domain, port)
|
||||||
if _validPostContent(base_dir, nickname, domain,
|
if _validPostContent(base_dir, nickname, domain,
|
||||||
postJsonObject, max_mentions, maxEmoji,
|
postJsonObject, max_mentions, max_emoji,
|
||||||
allow_local_network_access, debug,
|
allow_local_network_access, debug,
|
||||||
systemLanguage, http_prefix,
|
systemLanguage, http_prefix,
|
||||||
domainFull, personCache):
|
domainFull, personCache):
|
||||||
|
|
@ -4071,7 +4071,7 @@ def runInboxQueue(recentPostsCache: {}, max_recent_posts: int,
|
||||||
domainMaxPostsPerDay: int,
|
domainMaxPostsPerDay: int,
|
||||||
accountMaxPostsPerDay: int,
|
accountMaxPostsPerDay: int,
|
||||||
allowDeletion: bool, debug: bool, max_mentions: int,
|
allowDeletion: bool, debug: bool, max_mentions: int,
|
||||||
maxEmoji: int, translate: {}, unitTest: bool,
|
max_emoji: int, translate: {}, unitTest: bool,
|
||||||
yt_replace_domain: str,
|
yt_replace_domain: str,
|
||||||
twitter_replacement_domain: str,
|
twitter_replacement_domain: str,
|
||||||
show_published_date_only: bool,
|
show_published_date_only: bool,
|
||||||
|
|
@ -4501,7 +4501,7 @@ def runInboxQueue(recentPostsCache: {}, max_recent_posts: int,
|
||||||
debug,
|
debug,
|
||||||
queueFilename, destination,
|
queueFilename, destination,
|
||||||
maxReplies, allowDeletion,
|
maxReplies, allowDeletion,
|
||||||
max_mentions, maxEmoji,
|
max_mentions, max_emoji,
|
||||||
translate, unitTest,
|
translate, unitTest,
|
||||||
yt_replace_domain,
|
yt_replace_domain,
|
||||||
twitter_replacement_domain,
|
twitter_replacement_domain,
|
||||||
|
|
|
||||||
22
posts.py
22
posts.py
|
|
@ -525,7 +525,7 @@ def isCreateInsideAnnounce(item: {}) -> bool:
|
||||||
|
|
||||||
def _getPosts(session, outboxUrl: str, maxPosts: int,
|
def _getPosts(session, outboxUrl: str, maxPosts: int,
|
||||||
max_mentions: int,
|
max_mentions: int,
|
||||||
maxEmoji: int, maxAttachments: int,
|
max_emoji: int, maxAttachments: int,
|
||||||
federationList: [],
|
federationList: [],
|
||||||
personCache: {}, raw: bool,
|
personCache: {}, raw: bool,
|
||||||
simple: bool, debug: bool,
|
simple: bool, debug: bool,
|
||||||
|
|
@ -627,7 +627,7 @@ def _getPosts(session, outboxUrl: str, maxPosts: int,
|
||||||
if debug:
|
if debug:
|
||||||
print('max mentions reached')
|
print('max mentions reached')
|
||||||
continue
|
continue
|
||||||
if len(emoji) > maxEmoji:
|
if len(emoji) > max_emoji:
|
||||||
if debug:
|
if debug:
|
||||||
print('max emojis reached')
|
print('max emojis reached')
|
||||||
continue
|
continue
|
||||||
|
|
@ -744,7 +744,7 @@ def _updateWordFrequency(content: str, wordFrequency: {}) -> None:
|
||||||
|
|
||||||
def getPostDomains(session, outboxUrl: str, maxPosts: int,
|
def getPostDomains(session, outboxUrl: str, maxPosts: int,
|
||||||
max_mentions: int,
|
max_mentions: int,
|
||||||
maxEmoji: int, maxAttachments: int,
|
max_emoji: int, maxAttachments: int,
|
||||||
federationList: [],
|
federationList: [],
|
||||||
personCache: {},
|
personCache: {},
|
||||||
debug: bool,
|
debug: bool,
|
||||||
|
|
@ -811,7 +811,7 @@ def getPostDomains(session, outboxUrl: str, maxPosts: int,
|
||||||
def _getPostsForBlockedDomains(base_dir: str,
|
def _getPostsForBlockedDomains(base_dir: str,
|
||||||
session, outboxUrl: str, maxPosts: int,
|
session, outboxUrl: str, maxPosts: int,
|
||||||
max_mentions: int,
|
max_mentions: int,
|
||||||
maxEmoji: int, maxAttachments: int,
|
max_emoji: int, maxAttachments: int,
|
||||||
federationList: [],
|
federationList: [],
|
||||||
personCache: {},
|
personCache: {},
|
||||||
debug: bool,
|
debug: bool,
|
||||||
|
|
@ -4114,9 +4114,9 @@ def getPublicPostsOfPerson(base_dir: str, nickname: str, domain: str,
|
||||||
return
|
return
|
||||||
|
|
||||||
max_mentions = 10
|
max_mentions = 10
|
||||||
maxEmoji = 10
|
max_emoji = 10
|
||||||
maxAttachments = 5
|
maxAttachments = 5
|
||||||
_getPosts(session, personUrl, 30, max_mentions, maxEmoji,
|
_getPosts(session, personUrl, 30, max_mentions, max_emoji,
|
||||||
maxAttachments, federationList,
|
maxAttachments, federationList,
|
||||||
personCache, raw, simple, debug,
|
personCache, raw, simple, debug,
|
||||||
project_version, http_prefix, originDomain, systemLanguage,
|
project_version, http_prefix, originDomain, systemLanguage,
|
||||||
|
|
@ -4162,10 +4162,10 @@ def getPublicPostDomains(session, base_dir: str, nickname: str, domain: str,
|
||||||
nickname, domain, 'outbox',
|
nickname, domain, 'outbox',
|
||||||
92522)
|
92522)
|
||||||
max_mentions = 99
|
max_mentions = 99
|
||||||
maxEmoji = 99
|
max_emoji = 99
|
||||||
maxAttachments = 5
|
maxAttachments = 5
|
||||||
postDomains = \
|
postDomains = \
|
||||||
getPostDomains(session, personUrl, 64, max_mentions, maxEmoji,
|
getPostDomains(session, personUrl, 64, max_mentions, max_emoji,
|
||||||
maxAttachments, federationList,
|
maxAttachments, federationList,
|
||||||
personCache, debug,
|
personCache, debug,
|
||||||
project_version, http_prefix, domain,
|
project_version, http_prefix, domain,
|
||||||
|
|
@ -4258,11 +4258,11 @@ def getPublicPostInfo(session, base_dir: str, nickname: str, domain: str,
|
||||||
nickname, domain, 'outbox',
|
nickname, domain, 'outbox',
|
||||||
13863)
|
13863)
|
||||||
max_mentions = 99
|
max_mentions = 99
|
||||||
maxEmoji = 99
|
max_emoji = 99
|
||||||
maxAttachments = 5
|
maxAttachments = 5
|
||||||
maxPosts = 64
|
maxPosts = 64
|
||||||
postDomains = \
|
postDomains = \
|
||||||
getPostDomains(session, personUrl, maxPosts, max_mentions, maxEmoji,
|
getPostDomains(session, personUrl, maxPosts, max_mentions, max_emoji,
|
||||||
maxAttachments, federationList,
|
maxAttachments, federationList,
|
||||||
personCache, debug,
|
personCache, debug,
|
||||||
project_version, http_prefix, domain,
|
project_version, http_prefix, domain,
|
||||||
|
|
@ -4276,7 +4276,7 @@ def getPublicPostInfo(session, base_dir: str, nickname: str, domain: str,
|
||||||
blockedPosts = \
|
blockedPosts = \
|
||||||
_getPostsForBlockedDomains(base_dir, session, personUrl, maxPosts,
|
_getPostsForBlockedDomains(base_dir, session, personUrl, maxPosts,
|
||||||
max_mentions,
|
max_mentions,
|
||||||
maxEmoji, maxAttachments,
|
max_emoji, maxAttachments,
|
||||||
federationList,
|
federationList,
|
||||||
personCache,
|
personCache,
|
||||||
debug,
|
debug,
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ def instancesGraph(base_dir: str, handles: str,
|
||||||
cachedWebfingers = {}
|
cachedWebfingers = {}
|
||||||
federationList = []
|
federationList = []
|
||||||
max_mentions = 99
|
max_mentions = 99
|
||||||
maxEmoji = 99
|
max_emoji = 99
|
||||||
maxAttachments = 5
|
maxAttachments = 5
|
||||||
|
|
||||||
personHandles = handles.split(',')
|
personHandles = handles.split(',')
|
||||||
|
|
@ -74,7 +74,7 @@ def instancesGraph(base_dir: str, handles: str,
|
||||||
27261)
|
27261)
|
||||||
wordFrequency = {}
|
wordFrequency = {}
|
||||||
postDomains = \
|
postDomains = \
|
||||||
getPostDomains(session, personUrl, 64, max_mentions, maxEmoji,
|
getPostDomains(session, personUrl, 64, max_mentions, max_emoji,
|
||||||
maxAttachments, federationList,
|
maxAttachments, federationList,
|
||||||
personCache, debug,
|
personCache, debug,
|
||||||
project_version, http_prefix, domain,
|
project_version, http_prefix, domain,
|
||||||
|
|
|
||||||
16
tests.py
16
tests.py
|
|
@ -776,7 +776,7 @@ def createServerAlice(path: str, domain: str, port: int,
|
||||||
global testServerAliceRunning
|
global testServerAliceRunning
|
||||||
testServerAliceRunning = True
|
testServerAliceRunning = True
|
||||||
max_mentions = 10
|
max_mentions = 10
|
||||||
maxEmoji = 10
|
max_emoji = 10
|
||||||
onion_domain = None
|
onion_domain = None
|
||||||
i2p_domain = None
|
i2p_domain = None
|
||||||
allow_local_network_access = True
|
allow_local_network_access = True
|
||||||
|
|
@ -815,7 +815,7 @@ def createServerAlice(path: str, domain: str, port: int,
|
||||||
5, True, True, 'en', __version__,
|
5, True, True, 'en', __version__,
|
||||||
"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, maxEmoji, False,
|
http_prefix, federationList, max_mentions, max_emoji, False,
|
||||||
proxyType, maxReplies,
|
proxyType, maxReplies,
|
||||||
domainMaxPostsPerDay, accountMaxPostsPerDay,
|
domainMaxPostsPerDay, accountMaxPostsPerDay,
|
||||||
allowDeletion, True, True, False, sendThreads,
|
allowDeletion, True, True, False, sendThreads,
|
||||||
|
|
@ -918,7 +918,7 @@ def createServerBob(path: str, domain: str, port: int,
|
||||||
global testServerBobRunning
|
global testServerBobRunning
|
||||||
testServerBobRunning = True
|
testServerBobRunning = True
|
||||||
max_mentions = 10
|
max_mentions = 10
|
||||||
maxEmoji = 10
|
max_emoji = 10
|
||||||
onion_domain = None
|
onion_domain = None
|
||||||
i2p_domain = None
|
i2p_domain = None
|
||||||
allow_local_network_access = True
|
allow_local_network_access = True
|
||||||
|
|
@ -957,7 +957,7 @@ def createServerBob(path: str, domain: str, port: int,
|
||||||
5, True, True, 'en', __version__,
|
5, True, True, 'en', __version__,
|
||||||
"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, maxEmoji, False,
|
http_prefix, federationList, max_mentions, max_emoji, False,
|
||||||
proxyType, maxReplies,
|
proxyType, maxReplies,
|
||||||
domainMaxPostsPerDay, accountMaxPostsPerDay,
|
domainMaxPostsPerDay, accountMaxPostsPerDay,
|
||||||
allowDeletion, True, True, False, sendThreads,
|
allowDeletion, True, True, False, sendThreads,
|
||||||
|
|
@ -987,7 +987,7 @@ def createServerEve(path: str, domain: str, port: int, federationList: [],
|
||||||
global testServerEveRunning
|
global testServerEveRunning
|
||||||
testServerEveRunning = True
|
testServerEveRunning = True
|
||||||
max_mentions = 10
|
max_mentions = 10
|
||||||
maxEmoji = 10
|
max_emoji = 10
|
||||||
onion_domain = None
|
onion_domain = None
|
||||||
i2p_domain = None
|
i2p_domain = None
|
||||||
allow_local_network_access = True
|
allow_local_network_access = True
|
||||||
|
|
@ -1027,7 +1027,7 @@ def createServerEve(path: str, domain: str, port: int, federationList: [],
|
||||||
5, True, True, 'en', __version__,
|
5, True, True, 'en', __version__,
|
||||||
"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, maxEmoji, False,
|
http_prefix, federationList, max_mentions, max_emoji, False,
|
||||||
proxyType, maxReplies, allowDeletion, True, True, False,
|
proxyType, maxReplies, allowDeletion, True, True, False,
|
||||||
sendThreads, False)
|
sendThreads, False)
|
||||||
|
|
||||||
|
|
@ -1059,7 +1059,7 @@ def createServerGroup(path: str, domain: str, port: int,
|
||||||
global testServerGroupRunning
|
global testServerGroupRunning
|
||||||
testServerGroupRunning = True
|
testServerGroupRunning = True
|
||||||
max_mentions = 10
|
max_mentions = 10
|
||||||
maxEmoji = 10
|
max_emoji = 10
|
||||||
onion_domain = None
|
onion_domain = None
|
||||||
i2p_domain = None
|
i2p_domain = None
|
||||||
allow_local_network_access = True
|
allow_local_network_access = True
|
||||||
|
|
@ -1099,7 +1099,7 @@ def createServerGroup(path: str, domain: str, port: int,
|
||||||
5, True, True, 'en', __version__,
|
5, True, True, 'en', __version__,
|
||||||
"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, maxEmoji, False,
|
http_prefix, federationList, max_mentions, max_emoji, False,
|
||||||
proxyType, maxReplies,
|
proxyType, maxReplies,
|
||||||
domainMaxPostsPerDay, accountMaxPostsPerDay,
|
domainMaxPostsPerDay, accountMaxPostsPerDay,
|
||||||
allowDeletion, True, True, False, sendThreads,
|
allowDeletion, True, True, False, sendThreads,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue