forked from indymedia/epicyon
Tidying
parent
77210c0f41
commit
c8e9804b4a
|
@ -7,6 +7,7 @@ __email__ = "bob@freedombone.net"
|
||||||
__status__ = "Production"
|
__status__ = "Production"
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
from utils import getFullDomain
|
||||||
from utils import urlPermitted
|
from utils import urlPermitted
|
||||||
from utils import getDomainFromActor
|
from utils import getDomainFromActor
|
||||||
from utils import getNicknameFromActor
|
from utils import getNicknameFromActor
|
||||||
|
@ -30,10 +31,7 @@ def createAcceptReject(baseDir: str, federationList: [],
|
||||||
if not urlPermitted(objectJson['actor'], federationList):
|
if not urlPermitted(objectJson['actor'], federationList):
|
||||||
return None
|
return None
|
||||||
|
|
||||||
if port:
|
domain = getFullDomain(domain, port)
|
||||||
if port != 80 and port != 443:
|
|
||||||
if ':' not in domain:
|
|
||||||
domain = domain + ':' + str(port)
|
|
||||||
|
|
||||||
newAccept = {
|
newAccept = {
|
||||||
"@context": "https://www.w3.org/ns/activitystreams",
|
"@context": "https://www.w3.org/ns/activitystreams",
|
||||||
|
|
43
announce.py
43
announce.py
|
@ -6,6 +6,7 @@ __maintainer__ = "Bob Mottram"
|
||||||
__email__ = "bob@freedombone.net"
|
__email__ = "bob@freedombone.net"
|
||||||
__status__ = "Production"
|
__status__ = "Production"
|
||||||
|
|
||||||
|
from utils import getFullDomain
|
||||||
from utils import getStatusNumber
|
from utils import getStatusNumber
|
||||||
from utils import createOutboxDir
|
from utils import createOutboxDir
|
||||||
from utils import urlPermitted
|
from utils import urlPermitted
|
||||||
|
@ -113,11 +114,7 @@ def createAnnounce(session, baseDir: str, federationList: [],
|
||||||
|
|
||||||
if ':' in domain:
|
if ':' in domain:
|
||||||
domain = domain.split(':')[0]
|
domain = domain.split(':')[0]
|
||||||
fullDomain = domain
|
fullDomain = getFullDomain(domain, port)
|
||||||
if port:
|
|
||||||
if port != 80 and port != 443:
|
|
||||||
if ':' not in domain:
|
|
||||||
fullDomain = domain + ':' + str(port)
|
|
||||||
|
|
||||||
statusNumber, published = getStatusNumber()
|
statusNumber, published = getStatusNumber()
|
||||||
newAnnounceId = httpPrefix + '://' + fullDomain + \
|
newAnnounceId = httpPrefix + '://' + fullDomain + \
|
||||||
|
@ -172,11 +169,7 @@ def announcePublic(session, baseDir: str, federationList: [],
|
||||||
debug: bool, projectVersion: str) -> {}:
|
debug: bool, projectVersion: str) -> {}:
|
||||||
"""Makes a public announcement
|
"""Makes a public announcement
|
||||||
"""
|
"""
|
||||||
fromDomain = domain
|
fromDomain = getFullDomain(domain, port)
|
||||||
if port:
|
|
||||||
if port != 80 and port != 443:
|
|
||||||
if ':' not in domain:
|
|
||||||
fromDomain = domain + ':' + str(port)
|
|
||||||
|
|
||||||
toUrl = 'https://www.w3.org/ns/activitystreams#Public'
|
toUrl = 'https://www.w3.org/ns/activitystreams#Public'
|
||||||
ccUrl = httpPrefix + '://' + fromDomain + '/users/' + nickname + \
|
ccUrl = httpPrefix + '://' + fromDomain + '/users/' + nickname + \
|
||||||
|
@ -200,11 +193,7 @@ def repeatPost(session, baseDir: str, federationList: [],
|
||||||
debug: bool, projectVersion: str) -> {}:
|
debug: bool, projectVersion: str) -> {}:
|
||||||
"""Repeats a given status post
|
"""Repeats a given status post
|
||||||
"""
|
"""
|
||||||
announcedDomain = announceDomain
|
announcedDomain = getFullDomain(announceDomain, announcePort)
|
||||||
if announcePort:
|
|
||||||
if announcePort != 80 and announcePort != 443:
|
|
||||||
if ':' not in announcedDomain:
|
|
||||||
announcedDomain = announcedDomain + ':' + str(announcePort)
|
|
||||||
|
|
||||||
objectUrl = announceHttpsPrefix + '://' + announcedDomain + '/users/' + \
|
objectUrl = announceHttpsPrefix + '://' + announcedDomain + '/users/' + \
|
||||||
announceNickname + '/statuses/' + str(announceStatusNumber)
|
announceNickname + '/statuses/' + str(announceStatusNumber)
|
||||||
|
@ -236,11 +225,7 @@ def undoAnnounce(session, baseDir: str, federationList: [],
|
||||||
|
|
||||||
if ':' in domain:
|
if ':' in domain:
|
||||||
domain = domain.split(':')[0]
|
domain = domain.split(':')[0]
|
||||||
fullDomain = domain
|
fullDomain = getFullDomain(domain, port)
|
||||||
if port:
|
|
||||||
if port != 80 and port != 443:
|
|
||||||
if ':' not in domain:
|
|
||||||
fullDomain = domain + ':' + str(port)
|
|
||||||
|
|
||||||
newUndoAnnounce = {
|
newUndoAnnounce = {
|
||||||
"@context": "https://www.w3.org/ns/activitystreams",
|
"@context": "https://www.w3.org/ns/activitystreams",
|
||||||
|
@ -290,11 +275,7 @@ def undoAnnouncePublic(session, baseDir: str, federationList: [],
|
||||||
debug: bool) -> {}:
|
debug: bool) -> {}:
|
||||||
"""Undoes a public announcement
|
"""Undoes a public announcement
|
||||||
"""
|
"""
|
||||||
fromDomain = domain
|
fromDomain = getFullDomain(domain, port)
|
||||||
if port:
|
|
||||||
if port != 80 and port != 443:
|
|
||||||
if ':' not in domain:
|
|
||||||
fromDomain = domain + ':' + str(port)
|
|
||||||
|
|
||||||
toUrl = 'https://www.w3.org/ns/activitystreams#Public'
|
toUrl = 'https://www.w3.org/ns/activitystreams#Public'
|
||||||
ccUrl = httpPrefix + '://' + fromDomain + '/users/' + nickname + \
|
ccUrl = httpPrefix + '://' + fromDomain + '/users/' + nickname + \
|
||||||
|
@ -318,11 +299,7 @@ def undoRepeatPost(session, baseDir: str, federationList: [],
|
||||||
debug: bool) -> {}:
|
debug: bool) -> {}:
|
||||||
"""Undoes a status post repeat
|
"""Undoes a status post repeat
|
||||||
"""
|
"""
|
||||||
announcedDomain = announceDomain
|
announcedDomain = getFullDomain(announceDomain, announcePort)
|
||||||
if announcePort:
|
|
||||||
if announcePort != 80 and announcePort != 443:
|
|
||||||
if ':' not in announcedDomain:
|
|
||||||
announcedDomain = announcedDomain + ':' + str(announcePort)
|
|
||||||
|
|
||||||
objectUrl = announceHttpsPrefix + '://' + announcedDomain + '/users/' + \
|
objectUrl = announceHttpsPrefix + '://' + announcedDomain + '/users/' + \
|
||||||
announceNickname + '/statuses/' + str(announceStatusNumber)
|
announceNickname + '/statuses/' + str(announceStatusNumber)
|
||||||
|
@ -347,11 +324,7 @@ def sendAnnounceViaServer(baseDir: str, session,
|
||||||
print('WARN: No session for sendAnnounceViaServer')
|
print('WARN: No session for sendAnnounceViaServer')
|
||||||
return 6
|
return 6
|
||||||
|
|
||||||
fromDomainFull = fromDomain
|
fromDomainFull = getFullDomain(fromDomain, fromPort)
|
||||||
if fromPort:
|
|
||||||
if fromPort != 80 and fromPort != 443:
|
|
||||||
if ':' not in fromDomain:
|
|
||||||
fromDomainFull = fromDomain + ':' + str(fromPort)
|
|
||||||
|
|
||||||
toUrl = 'https://www.w3.org/ns/activitystreams#Public'
|
toUrl = 'https://www.w3.org/ns/activitystreams#Public'
|
||||||
ccUrl = httpPrefix + '://' + fromDomainFull + '/users/' + fromNickname + \
|
ccUrl = httpPrefix + '://' + fromDomainFull + '/users/' + fromNickname + \
|
||||||
|
|
|
@ -11,6 +11,7 @@ from webfinger import webfingerHandle
|
||||||
from auth import createBasicAuthHeader
|
from auth import createBasicAuthHeader
|
||||||
from posts import getPersonBox
|
from posts import getPersonBox
|
||||||
from session import postJson
|
from session import postJson
|
||||||
|
from utils import getFullDomain
|
||||||
from utils import getNicknameFromActor
|
from utils import getNicknameFromActor
|
||||||
from utils import getDomainFromActor
|
from utils import getDomainFromActor
|
||||||
from utils import loadJson
|
from utils import loadJson
|
||||||
|
@ -85,11 +86,7 @@ def sendAvailabilityViaServer(baseDir: str, session,
|
||||||
print('WARN: No session for sendAvailabilityViaServer')
|
print('WARN: No session for sendAvailabilityViaServer')
|
||||||
return 6
|
return 6
|
||||||
|
|
||||||
domainFull = domain
|
domainFull = getFullDomain(domain, port)
|
||||||
if port:
|
|
||||||
if port != 80 and port != 443:
|
|
||||||
if ':' not in domain:
|
|
||||||
domainFull = domain + ':' + str(port)
|
|
||||||
|
|
||||||
toUrl = httpPrefix + '://' + domainFull + '/users/' + nickname
|
toUrl = httpPrefix + '://' + domainFull + '/users/' + nickname
|
||||||
ccUrl = httpPrefix + '://' + domainFull + '/users/' + nickname + \
|
ccUrl = httpPrefix + '://' + domainFull + '/users/' + nickname + \
|
||||||
|
|
13
blocking.py
13
blocking.py
|
@ -7,6 +7,7 @@ __email__ = "bob@freedombone.net"
|
||||||
__status__ = "Production"
|
__status__ = "Production"
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
from utils import getFullDomain
|
||||||
from utils import removeIdEnding
|
from utils import removeIdEnding
|
||||||
from utils import isEvil
|
from utils import isEvil
|
||||||
from utils import locatePost
|
from utils import locatePost
|
||||||
|
@ -265,11 +266,7 @@ def outboxBlock(baseDir: str, httpPrefix: str,
|
||||||
print('WARN: unable to find nickname in ' + messageJson['object'])
|
print('WARN: unable to find nickname in ' + messageJson['object'])
|
||||||
return
|
return
|
||||||
domainBlocked, portBlocked = getDomainFromActor(messageJson['object'])
|
domainBlocked, portBlocked = getDomainFromActor(messageJson['object'])
|
||||||
domainBlockedFull = domainBlocked
|
domainBlockedFull = getFullDomain(domainBlocked, portBlocked)
|
||||||
if portBlocked:
|
|
||||||
if portBlocked != 80 and portBlocked != 443:
|
|
||||||
if ':' not in domainBlocked:
|
|
||||||
domainBlockedFull = domainBlocked + ':' + str(portBlocked)
|
|
||||||
|
|
||||||
addBlock(baseDir, nickname, domain,
|
addBlock(baseDir, nickname, domain,
|
||||||
nicknameBlocked, domainBlockedFull)
|
nicknameBlocked, domainBlockedFull)
|
||||||
|
@ -346,11 +343,7 @@ def outboxUndoBlock(baseDir: str, httpPrefix: str,
|
||||||
return
|
return
|
||||||
domainObject = messageJson['object']['object']
|
domainObject = messageJson['object']['object']
|
||||||
domainBlocked, portBlocked = getDomainFromActor(domainObject)
|
domainBlocked, portBlocked = getDomainFromActor(domainObject)
|
||||||
domainBlockedFull = domainBlocked
|
domainBlockedFull = getFullDomain(domainBlocked, portBlocked)
|
||||||
if portBlocked:
|
|
||||||
if portBlocked != 80 and portBlocked != 443:
|
|
||||||
if ':' not in domainBlocked:
|
|
||||||
domainBlockedFull = domainBlocked + ':' + str(portBlocked)
|
|
||||||
|
|
||||||
removeBlock(baseDir, nickname, domain,
|
removeBlock(baseDir, nickname, domain,
|
||||||
nicknameBlocked, domainBlockedFull)
|
nicknameBlocked, domainBlockedFull)
|
||||||
|
|
21
blog.py
21
blog.py
|
@ -14,6 +14,7 @@ from webapp_utils import htmlHeaderWithExternalStyle
|
||||||
from webapp_utils import htmlFooter
|
from webapp_utils import htmlFooter
|
||||||
from webapp_utils import getPostAttachmentsAsHtml
|
from webapp_utils import getPostAttachmentsAsHtml
|
||||||
from webapp_media import addEmbeddedElements
|
from webapp_media import addEmbeddedElements
|
||||||
|
from utils import getFullDomain
|
||||||
from utils import getMediaFormats
|
from utils import getMediaFormats
|
||||||
from utils import getNicknameFromActor
|
from utils import getNicknameFromActor
|
||||||
from utils import getDomainFromActor
|
from utils import getDomainFromActor
|
||||||
|
@ -443,10 +444,7 @@ def htmlBlogPage(authorized: bool, session,
|
||||||
if not timelineJson:
|
if not timelineJson:
|
||||||
return blogStr + htmlFooter()
|
return blogStr + htmlFooter()
|
||||||
|
|
||||||
domainFull = domain
|
domainFull = getFullDomain(domain, port)
|
||||||
if port:
|
|
||||||
if port != 80 and port != 443:
|
|
||||||
domainFull = domain + ':' + str(port)
|
|
||||||
|
|
||||||
# show previous and next buttons
|
# show previous and next buttons
|
||||||
if pageNumber is not None:
|
if pageNumber is not None:
|
||||||
|
@ -513,10 +511,7 @@ def htmlBlogPageRSS2(authorized: bool, session,
|
||||||
'\n' in nickname or '\r' in nickname:
|
'\n' in nickname or '\r' in nickname:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
domainFull = domain
|
domainFull = getFullDomain(domain, port)
|
||||||
if port:
|
|
||||||
if port != 80 and port != 443:
|
|
||||||
domainFull = domain + ':' + str(port)
|
|
||||||
|
|
||||||
blogRSS2 = ''
|
blogRSS2 = ''
|
||||||
if includeHeader:
|
if includeHeader:
|
||||||
|
@ -571,10 +566,7 @@ def htmlBlogPageRSS3(authorized: bool, session,
|
||||||
'\n' in nickname or '\r' in nickname:
|
'\n' in nickname or '\r' in nickname:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
domainFull = domain
|
domainFull = getFullDomain(domain, port)
|
||||||
if port:
|
|
||||||
if port != 80 and port != 443:
|
|
||||||
domainFull = domain + ':' + str(port)
|
|
||||||
|
|
||||||
blogRSS3 = ''
|
blogRSS3 = ''
|
||||||
|
|
||||||
|
@ -682,10 +674,7 @@ def htmlBlogView(authorized: bool,
|
||||||
nickname, domain, port,
|
nickname, domain, port,
|
||||||
noOfItems, 1)
|
noOfItems, 1)
|
||||||
|
|
||||||
domainFull = domain
|
domainFull = getFullDomain(domain, port)
|
||||||
if port:
|
|
||||||
if port != 80 and port != 443:
|
|
||||||
domainFull = domain + ':' + str(port)
|
|
||||||
|
|
||||||
for subdir, dirs, files in os.walk(baseDir + '/accounts'):
|
for subdir, dirs, files in os.walk(baseDir + '/accounts'):
|
||||||
for acct in dirs:
|
for acct in dirs:
|
||||||
|
|
37
bookmarks.py
37
bookmarks.py
|
@ -8,6 +8,7 @@ __status__ = "Production"
|
||||||
|
|
||||||
import os
|
import os
|
||||||
from pprint import pprint
|
from pprint import pprint
|
||||||
|
from utils import getFullDomain
|
||||||
from utils import removeIdEnding
|
from utils import removeIdEnding
|
||||||
from utils import removePostFromCache
|
from utils import removePostFromCache
|
||||||
from utils import urlPermitted
|
from utils import urlPermitted
|
||||||
|
@ -237,11 +238,7 @@ def bookmark(recentPostsCache: {},
|
||||||
if not urlPermitted(objectUrl, federationList):
|
if not urlPermitted(objectUrl, federationList):
|
||||||
return None
|
return None
|
||||||
|
|
||||||
fullDomain = domain
|
fullDomain = getFullDomain(domain, port)
|
||||||
if port:
|
|
||||||
if port != 80 and port != 443:
|
|
||||||
if ':' not in domain:
|
|
||||||
fullDomain = domain + ':' + str(port)
|
|
||||||
|
|
||||||
newBookmarkJson = {
|
newBookmarkJson = {
|
||||||
"@context": "https://www.w3.org/ns/activitystreams",
|
"@context": "https://www.w3.org/ns/activitystreams",
|
||||||
|
@ -298,11 +295,7 @@ def bookmarkPost(recentPostsCache: {},
|
||||||
debug: bool, projectVersion: str) -> {}:
|
debug: bool, projectVersion: str) -> {}:
|
||||||
"""Bookmarks a given status post. This is only used by unit tests
|
"""Bookmarks a given status post. This is only used by unit tests
|
||||||
"""
|
"""
|
||||||
bookmarkedomain = bookmarkedomain
|
bookmarkedomain = getFullDomain(bookmarkedomain, bookmarkPort)
|
||||||
if bookmarkPort:
|
|
||||||
if bookmarkPort != 80 and bookmarkPort != 443:
|
|
||||||
if ':' not in bookmarkedomain:
|
|
||||||
bookmarkedomain = bookmarkedomain + ':' + str(bookmarkPort)
|
|
||||||
|
|
||||||
actorBookmarked = httpPrefix + '://' + bookmarkedomain + \
|
actorBookmarked = httpPrefix + '://' + bookmarkedomain + \
|
||||||
'/users/' + bookmarkNickname
|
'/users/' + bookmarkNickname
|
||||||
|
@ -333,11 +326,7 @@ def undoBookmark(recentPostsCache: {},
|
||||||
if not urlPermitted(objectUrl, federationList):
|
if not urlPermitted(objectUrl, federationList):
|
||||||
return None
|
return None
|
||||||
|
|
||||||
fullDomain = domain
|
fullDomain = getFullDomain(domain, port)
|
||||||
if port:
|
|
||||||
if port != 80 and port != 443:
|
|
||||||
if ':' not in domain:
|
|
||||||
fullDomain = domain + ':' + str(port)
|
|
||||||
|
|
||||||
newUndoBookmarkJson = {
|
newUndoBookmarkJson = {
|
||||||
"@context": "https://www.w3.org/ns/activitystreams",
|
"@context": "https://www.w3.org/ns/activitystreams",
|
||||||
|
@ -396,11 +385,7 @@ def undoBookmarkPost(session, baseDir: str, federationList: [],
|
||||||
debug: bool) -> {}:
|
debug: bool) -> {}:
|
||||||
"""Removes a bookmarked post
|
"""Removes a bookmarked post
|
||||||
"""
|
"""
|
||||||
bookmarkedomain = bookmarkedomain
|
bookmarkedomain = getFullDomain(bookmarkedomain, bookmarkPort)
|
||||||
if bookmarkPort:
|
|
||||||
if bookmarkPort != 80 and bookmarkPort != 443:
|
|
||||||
if ':' not in bookmarkedomain:
|
|
||||||
bookmarkedomain = bookmarkedomain + ':' + str(bookmarkPort)
|
|
||||||
|
|
||||||
objectUrl = httpPrefix + '://' + bookmarkedomain + \
|
objectUrl = httpPrefix + '://' + bookmarkedomain + \
|
||||||
'/users/' + bookmarkNickname + \
|
'/users/' + bookmarkNickname + \
|
||||||
|
@ -425,11 +410,7 @@ def sendBookmarkViaServer(baseDir: str, session,
|
||||||
print('WARN: No session for sendBookmarkViaServer')
|
print('WARN: No session for sendBookmarkViaServer')
|
||||||
return 6
|
return 6
|
||||||
|
|
||||||
fromDomainFull = fromDomain
|
fromDomainFull = getFullDomain(fromDomain, fromPort)
|
||||||
if fromPort:
|
|
||||||
if fromPort != 80 and fromPort != 443:
|
|
||||||
if ':' not in fromDomain:
|
|
||||||
fromDomainFull = fromDomain + ':' + str(fromPort)
|
|
||||||
|
|
||||||
newBookmarkJson = {
|
newBookmarkJson = {
|
||||||
"@context": "https://www.w3.org/ns/activitystreams",
|
"@context": "https://www.w3.org/ns/activitystreams",
|
||||||
|
@ -503,11 +484,7 @@ def sendUndoBookmarkViaServer(baseDir: str, session,
|
||||||
print('WARN: No session for sendUndoBookmarkViaServer')
|
print('WARN: No session for sendUndoBookmarkViaServer')
|
||||||
return 6
|
return 6
|
||||||
|
|
||||||
fromDomainFull = fromDomain
|
fromDomainFull = getFullDomain(fromDomain, fromPort)
|
||||||
if fromPort:
|
|
||||||
if fromPort != 80 and fromPort != 443:
|
|
||||||
if ':' not in fromDomain:
|
|
||||||
fromDomainFull = fromDomain + ':' + str(fromPort)
|
|
||||||
|
|
||||||
newUndoBookmarkJson = {
|
newUndoBookmarkJson = {
|
||||||
"@context": "https://www.w3.org/ns/activitystreams",
|
"@context": "https://www.w3.org/ns/activitystreams",
|
||||||
|
|
48
daemon.py
48
daemon.py
|
@ -172,6 +172,7 @@ from shares import getSharesFeedForPerson
|
||||||
from shares import addShare
|
from shares import addShare
|
||||||
from shares import removeShare
|
from shares import removeShare
|
||||||
from shares import expireShares
|
from shares import expireShares
|
||||||
|
from utils import getFullDomain
|
||||||
from utils import removeHtml
|
from utils import removeHtml
|
||||||
from utils import setHashtagCategory
|
from utils import setHashtagCategory
|
||||||
from utils import isEditor
|
from utils import isEditor
|
||||||
|
@ -1501,12 +1502,7 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
# https://domain
|
# https://domain
|
||||||
blockDomain, blockPort = \
|
blockDomain, blockPort = \
|
||||||
getDomainFromActor(moderationText)
|
getDomainFromActor(moderationText)
|
||||||
fullBlockDomain = blockDomain
|
fullBlockDomain = getFullDomain(blockDomain, blockPort)
|
||||||
if blockPort:
|
|
||||||
if blockPort != 80 and blockPort != 443:
|
|
||||||
if ':' not in blockDomain:
|
|
||||||
fullBlockDomain = \
|
|
||||||
blockDomain + ':' + str(blockPort)
|
|
||||||
if '@' in moderationText:
|
if '@' in moderationText:
|
||||||
# nick@domain or *@domain
|
# nick@domain or *@domain
|
||||||
fullBlockDomain = moderationText.split('@')[1]
|
fullBlockDomain = moderationText.split('@')[1]
|
||||||
|
@ -1524,12 +1520,7 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
# https://domain
|
# https://domain
|
||||||
blockDomain, blockPort = \
|
blockDomain, blockPort = \
|
||||||
getDomainFromActor(moderationText)
|
getDomainFromActor(moderationText)
|
||||||
fullBlockDomain = blockDomain
|
fullBlockDomain = getFullDomain(blockDomain, blockPort)
|
||||||
if blockPort:
|
|
||||||
if blockPort != 80 and blockPort != 443:
|
|
||||||
if ':' not in blockDomain:
|
|
||||||
fullBlockDomain = \
|
|
||||||
blockDomain + ':' + str(blockPort)
|
|
||||||
if '@' in moderationText:
|
if '@' in moderationText:
|
||||||
# nick@domain or *@domain
|
# nick@domain or *@domain
|
||||||
fullBlockDomain = moderationText.split('@')[1]
|
fullBlockDomain = moderationText.split('@')[1]
|
||||||
|
@ -1692,12 +1683,7 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
return
|
return
|
||||||
|
|
||||||
optionsDomain, optionsPort = getDomainFromActor(optionsActor)
|
optionsDomain, optionsPort = getDomainFromActor(optionsActor)
|
||||||
optionsDomainFull = optionsDomain
|
optionsDomainFull = getFullDomain(optionsDomain, optionsPort)
|
||||||
if optionsPort:
|
|
||||||
if optionsPort != 80 and optionsPort != 443:
|
|
||||||
if ':' not in optionsDomain:
|
|
||||||
optionsDomainFull = optionsDomain + ':' + \
|
|
||||||
str(optionsPort)
|
|
||||||
if chooserNickname == optionsNickname and \
|
if chooserNickname == optionsNickname and \
|
||||||
optionsDomain == domain and \
|
optionsDomain == domain and \
|
||||||
optionsPort == port:
|
optionsPort == port:
|
||||||
|
@ -2011,11 +1997,7 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
followingNickname = getNicknameFromActor(followingActor)
|
followingNickname = getNicknameFromActor(followingActor)
|
||||||
followingDomain, followingPort = \
|
followingDomain, followingPort = \
|
||||||
getDomainFromActor(followingActor)
|
getDomainFromActor(followingActor)
|
||||||
followingDomainFull = followingDomain
|
followingDomainFull = getFullDomain(followingDomain, followingPort)
|
||||||
if followingPort:
|
|
||||||
if followingPort != 80 and followingPort != 443:
|
|
||||||
followingDomainFull = \
|
|
||||||
followingDomain + ':' + str(followingPort)
|
|
||||||
if followerNickname == followingNickname and \
|
if followerNickname == followingNickname and \
|
||||||
followingDomain == domain and \
|
followingDomain == domain and \
|
||||||
followingPort == port:
|
followingPort == port:
|
||||||
|
@ -2208,12 +2190,7 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
return
|
return
|
||||||
blockingDomain, blockingPort = \
|
blockingDomain, blockingPort = \
|
||||||
getDomainFromActor(blockingActor)
|
getDomainFromActor(blockingActor)
|
||||||
blockingDomainFull = blockingDomain
|
blockingDomainFull = getFullDomain(blockingDomain, blockingPort)
|
||||||
if blockingPort:
|
|
||||||
if blockingPort != 80 and blockingPort != 443:
|
|
||||||
if ':' not in blockingDomain:
|
|
||||||
blockingDomainFull = \
|
|
||||||
blockingDomain + ':' + str(blockingPort)
|
|
||||||
if blockerNickname == blockingNickname and \
|
if blockerNickname == blockingNickname and \
|
||||||
blockingDomain == domain and \
|
blockingDomain == domain and \
|
||||||
blockingPort == port:
|
blockingPort == port:
|
||||||
|
@ -2297,12 +2274,7 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
return
|
return
|
||||||
blockingDomain, blockingPort = \
|
blockingDomain, blockingPort = \
|
||||||
getDomainFromActor(blockingActor)
|
getDomainFromActor(blockingActor)
|
||||||
blockingDomainFull = blockingDomain
|
blockingDomainFull = getFullDomain(blockingDomain, blockingPort)
|
||||||
if blockingPort:
|
|
||||||
if blockingPort != 80 and blockingPort != 443:
|
|
||||||
if ':' not in blockingDomain:
|
|
||||||
blockingDomainFull = \
|
|
||||||
blockingDomain + ':' + str(blockingPort)
|
|
||||||
if blockerNickname == blockingNickname and \
|
if blockerNickname == blockingNickname and \
|
||||||
blockingDomain == domain and \
|
blockingDomain == domain and \
|
||||||
blockingPort == port:
|
blockingPort == port:
|
||||||
|
@ -13154,11 +13126,7 @@ def runDaemon(dormantMonths: int,
|
||||||
httpd.maxPostsInBox = 32000
|
httpd.maxPostsInBox = 32000
|
||||||
httpd.domain = domain
|
httpd.domain = domain
|
||||||
httpd.port = port
|
httpd.port = port
|
||||||
httpd.domainFull = domain
|
httpd.domainFull = getFullDomain(domain, port)
|
||||||
if port:
|
|
||||||
if port != 80 and port != 443:
|
|
||||||
if ':' not in domain:
|
|
||||||
httpd.domainFull = domain + ':' + str(port)
|
|
||||||
saveDomainQrcode(baseDir, httpPrefix, httpd.domainFull)
|
saveDomainQrcode(baseDir, httpPrefix, httpd.domainFull)
|
||||||
httpd.httpPrefix = httpPrefix
|
httpd.httpPrefix = httpPrefix
|
||||||
httpd.debug = debug
|
httpd.debug = debug
|
||||||
|
|
24
delete.py
24
delete.py
|
@ -8,6 +8,7 @@ __status__ = "Production"
|
||||||
|
|
||||||
import os
|
import os
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
from utils import getFullDomain
|
||||||
from utils import removeIdEnding
|
from utils import removeIdEnding
|
||||||
from utils import getStatusNumber
|
from utils import getStatusNumber
|
||||||
from utils import urlPermitted
|
from utils import urlPermitted
|
||||||
|
@ -42,10 +43,7 @@ def createDelete(session, baseDir: str, federationList: [],
|
||||||
if ':' in domain:
|
if ':' in domain:
|
||||||
domain = domain.split(':')[0]
|
domain = domain.split(':')[0]
|
||||||
fullDomain = domain
|
fullDomain = domain
|
||||||
if port:
|
fullDomain = getFullDomain(domain, port)
|
||||||
if port != 80 and port != 443:
|
|
||||||
if ':' not in domain:
|
|
||||||
fullDomain = domain + ':' + str(port)
|
|
||||||
|
|
||||||
statusNumber, published = getStatusNumber()
|
statusNumber, published = getStatusNumber()
|
||||||
newDeleteId = \
|
newDeleteId = \
|
||||||
|
@ -100,11 +98,7 @@ def sendDeleteViaServer(baseDir: str, session,
|
||||||
print('WARN: No session for sendDeleteViaServer')
|
print('WARN: No session for sendDeleteViaServer')
|
||||||
return 6
|
return 6
|
||||||
|
|
||||||
fromDomainFull = fromDomain
|
fromDomainFull = getFullDomain(fromDomain, fromPort)
|
||||||
if fromPort:
|
|
||||||
if fromPort != 80 and fromPort != 443:
|
|
||||||
if ':' not in fromDomain:
|
|
||||||
fromDomainFull = fromDomain + ':' + str(fromPort)
|
|
||||||
|
|
||||||
actor = httpPrefix + '://' + fromDomainFull + \
|
actor = httpPrefix + '://' + fromDomainFull + \
|
||||||
'/users/' + fromNickname
|
'/users/' + fromNickname
|
||||||
|
@ -181,11 +175,7 @@ def deletePublic(session, baseDir: str, federationList: [],
|
||||||
debug: bool) -> {}:
|
debug: bool) -> {}:
|
||||||
"""Makes a public delete activity
|
"""Makes a public delete activity
|
||||||
"""
|
"""
|
||||||
fromDomain = domain
|
fromDomain = getFullDomain(domain, port)
|
||||||
if port:
|
|
||||||
if port != 80 and port != 443:
|
|
||||||
if ':' not in domain:
|
|
||||||
fromDomain = domain + ':' + str(port)
|
|
||||||
|
|
||||||
toUrl = 'https://www.w3.org/ns/activitystreams#Public'
|
toUrl = 'https://www.w3.org/ns/activitystreams#Public'
|
||||||
ccUrl = httpPrefix + '://' + fromDomain + \
|
ccUrl = httpPrefix + '://' + fromDomain + \
|
||||||
|
@ -209,11 +199,7 @@ def deletePostPub(session, baseDir: str, federationList: [],
|
||||||
debug: bool) -> {}:
|
debug: bool) -> {}:
|
||||||
"""Deletes a given status post
|
"""Deletes a given status post
|
||||||
"""
|
"""
|
||||||
deletedDomain = deleteDomain
|
deletedDomain = getFullDomain(deleteDomain, deletePort)
|
||||||
if deletePort:
|
|
||||||
if deletePort != 80 and deletePort != 443:
|
|
||||||
if ':' not in deletedDomain:
|
|
||||||
deletedDomain = deletedDomain + ':' + str(deletePort)
|
|
||||||
|
|
||||||
objectUrl = \
|
objectUrl = \
|
||||||
deleteHttpsPrefix + '://' + deletedDomain + '/users/' + \
|
deleteHttpsPrefix + '://' + deletedDomain + '/users/' + \
|
||||||
|
|
25
epicyon.py
25
epicyon.py
|
@ -47,6 +47,7 @@ from tests import testClientToServer
|
||||||
from tests import runAllTests
|
from tests import runAllTests
|
||||||
from auth import storeBasicCredentials
|
from auth import storeBasicCredentials
|
||||||
from auth import createPassword
|
from auth import createPassword
|
||||||
|
from utils import getFullDomain
|
||||||
from utils import setConfigParam
|
from utils import setConfigParam
|
||||||
from utils import getConfigParam
|
from utils import getConfigParam
|
||||||
from utils import getDomainFromActor
|
from utils import getDomainFromActor
|
||||||
|
@ -501,10 +502,8 @@ if args.posts:
|
||||||
if '/users/' in args.posts:
|
if '/users/' in args.posts:
|
||||||
postsNickname = getNicknameFromActor(args.posts)
|
postsNickname = getNicknameFromActor(args.posts)
|
||||||
postsDomain, postsPort = getDomainFromActor(args.posts)
|
postsDomain, postsPort = getDomainFromActor(args.posts)
|
||||||
args.posts = postsNickname + '@' + postsDomain
|
args.posts = \
|
||||||
if postsPort:
|
getFullDomain(postsNickname + '@' + postsDomain, postsPort)
|
||||||
if postsPort != 80 and postsPort != 443:
|
|
||||||
args.posts += ':' + str(postsPort)
|
|
||||||
else:
|
else:
|
||||||
print('Syntax: --posts nickname@domain')
|
print('Syntax: --posts nickname@domain')
|
||||||
sys.exit()
|
sys.exit()
|
||||||
|
@ -533,10 +532,8 @@ if args.postDomains:
|
||||||
if '/users/' in args.postDomains:
|
if '/users/' in args.postDomains:
|
||||||
postsNickname = getNicknameFromActor(args.postDomains)
|
postsNickname = getNicknameFromActor(args.postDomains)
|
||||||
postsDomain, postsPort = getDomainFromActor(args.postDomains)
|
postsDomain, postsPort = getDomainFromActor(args.postDomains)
|
||||||
args.postDomains = postsNickname + '@' + postsDomain
|
args.postDomains = \
|
||||||
if postsPort:
|
getFullDomain(postsNickname + '@' + postsDomain, postsPort)
|
||||||
if postsPort != 80 and postsPort != 443:
|
|
||||||
args.postDomains += ':' + str(postsPort)
|
|
||||||
else:
|
else:
|
||||||
print('Syntax: --postDomains nickname@domain')
|
print('Syntax: --postDomains nickname@domain')
|
||||||
sys.exit()
|
sys.exit()
|
||||||
|
@ -573,10 +570,8 @@ if args.postDomainsBlocked:
|
||||||
postsNickname = getNicknameFromActor(args.postDomainsBlocked)
|
postsNickname = getNicknameFromActor(args.postDomainsBlocked)
|
||||||
postsDomain, postsPort = \
|
postsDomain, postsPort = \
|
||||||
getDomainFromActor(args.postDomainsBlocked)
|
getDomainFromActor(args.postDomainsBlocked)
|
||||||
args.postDomainsBlocked = postsNickname + '@' + postsDomain
|
args.postDomainsBlocked = \
|
||||||
if postsPort:
|
getFullDomain(postsNickname + '@' + postsDomain, postsPort)
|
||||||
if postsPort != 80 and postsPort != 443:
|
|
||||||
args.postDomainsBlocked += ':' + str(postsPort)
|
|
||||||
else:
|
else:
|
||||||
print('Syntax: --postDomainsBlocked nickname@domain')
|
print('Syntax: --postDomainsBlocked nickname@domain')
|
||||||
sys.exit()
|
sys.exit()
|
||||||
|
@ -612,10 +607,8 @@ if args.checkDomains:
|
||||||
if '/users/' in args.checkDomains:
|
if '/users/' in args.checkDomains:
|
||||||
postsNickname = getNicknameFromActor(args.posts)
|
postsNickname = getNicknameFromActor(args.posts)
|
||||||
postsDomain, postsPort = getDomainFromActor(args.posts)
|
postsDomain, postsPort = getDomainFromActor(args.posts)
|
||||||
args.checkDomains = postsNickname + '@' + postsDomain
|
args.checkDomains = \
|
||||||
if postsPort:
|
getFullDomain(postsNickname + '@' + postsDomain, postsPort)
|
||||||
if postsPort != 80 and postsPort != 443:
|
|
||||||
args.checkDomains += ':' + str(postsPort)
|
|
||||||
else:
|
else:
|
||||||
print('Syntax: --checkDomains nickname@domain')
|
print('Syntax: --checkDomains nickname@domain')
|
||||||
sys.exit()
|
sys.exit()
|
||||||
|
|
73
follow.py
73
follow.py
|
@ -8,6 +8,7 @@ __status__ = "Production"
|
||||||
|
|
||||||
from pprint import pprint
|
from pprint import pprint
|
||||||
import os
|
import os
|
||||||
|
from utils import getFullDomain
|
||||||
from utils import isSystemAccount
|
from utils import isSystemAccount
|
||||||
from utils import getFollowersList
|
from utils import getFollowersList
|
||||||
from utils import validNickname
|
from utils import validNickname
|
||||||
|
@ -145,11 +146,8 @@ def isFollowingActor(baseDir: str,
|
||||||
print('WARN: unable to find nickname in ' + actor)
|
print('WARN: unable to find nickname in ' + actor)
|
||||||
return False
|
return False
|
||||||
followingDomain, followingPort = getDomainFromActor(actor)
|
followingDomain, followingPort = getDomainFromActor(actor)
|
||||||
followingHandle = followingNickname + '@' + followingDomain
|
followingHandle = \
|
||||||
if followingPort:
|
getFullDomain(followingNickname + '@' + followingDomain, followingPort)
|
||||||
if followingPort != 80 and followingPort != 443:
|
|
||||||
if ':' not in followingHandle:
|
|
||||||
followingHandle += ':' + str(followingPort)
|
|
||||||
if followingHandle.lower() in open(followingFile).read().lower():
|
if followingHandle.lower() in open(followingFile).read().lower():
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
@ -374,10 +372,7 @@ def getFollowingFeed(baseDir: str, domain: str, port: int, path: str,
|
||||||
if not validNickname(domain, nickname):
|
if not validNickname(domain, nickname):
|
||||||
return None
|
return None
|
||||||
|
|
||||||
if port:
|
domain = getFullDomain(domain, port)
|
||||||
if port != 80 and port != 443:
|
|
||||||
if ':' not in domain:
|
|
||||||
domain = domain + ':' + str(port)
|
|
||||||
|
|
||||||
if headerOnly:
|
if headerOnly:
|
||||||
firstStr = \
|
firstStr = \
|
||||||
|
@ -539,12 +534,11 @@ def storeFollowRequest(baseDir: str,
|
||||||
return False
|
return False
|
||||||
|
|
||||||
approveHandle = nickname + '@' + domain
|
approveHandle = nickname + '@' + domain
|
||||||
domainFull = domain
|
domainFull = getFullDomain(domain, fromPort)
|
||||||
if fromPort:
|
if fromPort:
|
||||||
if fromPort != 80 and fromPort != 443:
|
if fromPort != 80 and fromPort != 443:
|
||||||
if ':' not in domain:
|
if ':' not in domain:
|
||||||
approveHandle = nickname + '@' + domain + ':' + str(fromPort)
|
approveHandle = nickname + '@' + domain + ':' + str(fromPort)
|
||||||
domainFull = domain + ':' + str(fromPort)
|
|
||||||
|
|
||||||
followersFilename = accountsDir + '/followers.txt'
|
followersFilename = accountsDir + '/followers.txt'
|
||||||
if os.path.isfile(followersFilename):
|
if os.path.isfile(followersFilename):
|
||||||
|
@ -666,11 +660,7 @@ def receiveFollowRequest(session, baseDir: str, httpPrefix: str,
|
||||||
if debug:
|
if debug:
|
||||||
print('DEBUG: follow domain not permitted ' + domainToFollow)
|
print('DEBUG: follow domain not permitted ' + domainToFollow)
|
||||||
return True
|
return True
|
||||||
domainToFollowFull = domainToFollow
|
domainToFollowFull = getFullDomain(domainToFollow, tempPort)
|
||||||
if tempPort:
|
|
||||||
if tempPort != 80 and tempPort != 443:
|
|
||||||
if ':' not in domainToFollow:
|
|
||||||
domainToFollowFull = domainToFollow + ':' + str(tempPort)
|
|
||||||
nicknameToFollow = getNicknameFromActor(messageJson['object'])
|
nicknameToFollow = getNicknameFromActor(messageJson['object'])
|
||||||
if not nicknameToFollow:
|
if not nicknameToFollow:
|
||||||
if debug:
|
if debug:
|
||||||
|
@ -878,10 +868,7 @@ def followedAccountRejects(session, baseDir: str, httpPrefix: str,
|
||||||
' port ' + str(port) + ' to ' +
|
' port ' + str(port) + ' to ' +
|
||||||
nickname + '@' + domain + ' port ' + str(fromPort))
|
nickname + '@' + domain + ' port ' + str(fromPort))
|
||||||
clientToServer = False
|
clientToServer = False
|
||||||
denyHandle = nickname + '@' + domain
|
denyHandle = getFullDomain(nickname + '@' + domain, fromPort)
|
||||||
if fromPort:
|
|
||||||
if fromPort != 80 and fromPort != 443:
|
|
||||||
denyHandle = denyHandle + ':' + str(fromPort)
|
|
||||||
# remove from the follow requests file
|
# remove from the follow requests file
|
||||||
removeFromFollowRequests(baseDir, nicknameToFollow, domainToFollow,
|
removeFromFollowRequests(baseDir, nicknameToFollow, domainToFollow,
|
||||||
denyHandle, debug)
|
denyHandle, debug)
|
||||||
|
@ -913,20 +900,15 @@ def sendFollowRequest(session, baseDir: str,
|
||||||
if not domainPermitted(followDomain, federationList):
|
if not domainPermitted(followDomain, federationList):
|
||||||
return None
|
return None
|
||||||
|
|
||||||
fullDomain = domain
|
fullDomain = getFullDomain(domain, port)
|
||||||
followActor = httpPrefix + '://' + domain + '/users/' + nickname
|
followActor = httpPrefix + '://' + domain + '/users/' + nickname
|
||||||
if port:
|
if port:
|
||||||
if port != 80 and port != 443:
|
if port != 80 and port != 443:
|
||||||
if ':' not in domain:
|
if ':' not in domain:
|
||||||
fullDomain = domain + ':' + str(port)
|
|
||||||
followActor = httpPrefix + '://' + \
|
followActor = httpPrefix + '://' + \
|
||||||
fullDomain + '/users/' + nickname
|
fullDomain + '/users/' + nickname
|
||||||
|
|
||||||
requestDomain = followDomain
|
requestDomain = getFullDomain(followDomain, followPort)
|
||||||
if followPort:
|
|
||||||
if followPort != 80 and followPort != 443:
|
|
||||||
if ':' not in followDomain:
|
|
||||||
requestDomain = followDomain + ':' + str(followPort)
|
|
||||||
|
|
||||||
statusNumber, published = getStatusNumber()
|
statusNumber, published = getStatusNumber()
|
||||||
|
|
||||||
|
@ -984,17 +966,9 @@ def sendFollowRequestViaServer(baseDir: str, session,
|
||||||
print('WARN: No session for sendFollowRequestViaServer')
|
print('WARN: No session for sendFollowRequestViaServer')
|
||||||
return 6
|
return 6
|
||||||
|
|
||||||
fromDomainFull = fromDomain
|
fromDomainFull = getFullDomain(fromDomain, fromPort)
|
||||||
if fromPort:
|
|
||||||
if fromPort != 80 and fromPort != 443:
|
|
||||||
if ':' not in fromDomain:
|
|
||||||
fromDomainFull = fromDomain + ':' + str(fromPort)
|
|
||||||
|
|
||||||
followDomainFull = followDomain
|
followDomainFull = getFullDomain(followDomain, followPort)
|
||||||
if followPort:
|
|
||||||
if followPort != 80 and followPort != 443:
|
|
||||||
if ':' not in followDomain:
|
|
||||||
followDomainFull = followDomain + ':' + str(followPort)
|
|
||||||
|
|
||||||
followActor = httpPrefix + '://' + \
|
followActor = httpPrefix + '://' + \
|
||||||
fromDomainFull + '/users/' + fromNickname
|
fromDomainFull + '/users/' + fromNickname
|
||||||
|
@ -1077,16 +1051,8 @@ def sendUnfollowRequestViaServer(baseDir: str, session,
|
||||||
print('WARN: No session for sendUnfollowRequestViaServer')
|
print('WARN: No session for sendUnfollowRequestViaServer')
|
||||||
return 6
|
return 6
|
||||||
|
|
||||||
fromDomainFull = fromDomain
|
fromDomainFull = getFullDomain(fromDomain, fromPort)
|
||||||
if fromPort:
|
followDomainFull = getFullDomain(followDomain, followPort)
|
||||||
if fromPort != 80 and fromPort != 443:
|
|
||||||
if ':' not in fromDomain:
|
|
||||||
fromDomainFull = fromDomain + ':' + str(fromPort)
|
|
||||||
followDomainFull = followDomain
|
|
||||||
if followPort:
|
|
||||||
if followPort != 80 and followPort != 443:
|
|
||||||
if ':' not in followDomain:
|
|
||||||
followDomainFull = followDomain + ':' + str(followPort)
|
|
||||||
|
|
||||||
followActor = httpPrefix + '://' + \
|
followActor = httpPrefix + '://' + \
|
||||||
fromDomainFull + '/users/' + fromNickname
|
fromDomainFull + '/users/' + fromNickname
|
||||||
|
@ -1241,11 +1207,7 @@ def outboxUndoFollow(baseDir: str, messageJson: {}, debug: bool) -> None:
|
||||||
return
|
return
|
||||||
domainFollower, portFollower = \
|
domainFollower, portFollower = \
|
||||||
getDomainFromActor(messageJson['object']['actor'])
|
getDomainFromActor(messageJson['object']['actor'])
|
||||||
domainFollowerFull = domainFollower
|
domainFollowerFull = getFullDomain(domainFollower, portFollower)
|
||||||
if portFollower:
|
|
||||||
if portFollower != 80 and portFollower != 443:
|
|
||||||
if ':' not in domainFollower:
|
|
||||||
domainFollowerFull = domainFollower + ':' + str(portFollower)
|
|
||||||
|
|
||||||
nicknameFollowing = getNicknameFromActor(messageJson['object']['object'])
|
nicknameFollowing = getNicknameFromActor(messageJson['object']['object'])
|
||||||
if not nicknameFollowing:
|
if not nicknameFollowing:
|
||||||
|
@ -1254,12 +1216,7 @@ def outboxUndoFollow(baseDir: str, messageJson: {}, debug: bool) -> None:
|
||||||
return
|
return
|
||||||
domainFollowing, portFollowing = \
|
domainFollowing, portFollowing = \
|
||||||
getDomainFromActor(messageJson['object']['object'])
|
getDomainFromActor(messageJson['object']['object'])
|
||||||
domainFollowingFull = domainFollowing
|
domainFollowingFull = getFullDomain(domainFollowing, portFollowing)
|
||||||
if portFollowing:
|
|
||||||
if portFollowing != 80 and portFollowing != 443:
|
|
||||||
if ':' not in domainFollowing:
|
|
||||||
domainFollowingFull = \
|
|
||||||
domainFollowing + ':' + str(portFollowing)
|
|
||||||
|
|
||||||
if unfollowPerson(baseDir, nicknameFollower, domainFollowerFull,
|
if unfollowPerson(baseDir, nicknameFollower, domainFollowerFull,
|
||||||
nicknameFollowing, domainFollowingFull):
|
nicknameFollowing, domainFollowingFull):
|
||||||
|
|
12
utils.py
12
utils.py
|
@ -19,6 +19,18 @@ from calendar import monthrange
|
||||||
from followingCalendar import addPersonToCalendar
|
from followingCalendar import addPersonToCalendar
|
||||||
|
|
||||||
|
|
||||||
|
def getFullDomain(domain: str, port: int) -> str:
|
||||||
|
"""Returns the full domain name, including port number
|
||||||
|
"""
|
||||||
|
if not port:
|
||||||
|
return domain
|
||||||
|
if ':' in domain:
|
||||||
|
return domain
|
||||||
|
if port == 80 or port == 443:
|
||||||
|
return domain
|
||||||
|
return domain + ':' + str(port)
|
||||||
|
|
||||||
|
|
||||||
def isDormant(baseDir: str, nickname: str, domain: str, actor: str,
|
def isDormant(baseDir: str, nickname: str, domain: str, actor: str,
|
||||||
dormantMonths=3) -> bool:
|
dormantMonths=3) -> bool:
|
||||||
"""Is the given followed actor dormant, from the standpoint
|
"""Is the given followed actor dormant, from the standpoint
|
||||||
|
|
Loading…
Reference in New Issue