mirror of https://gitlab.com/bashrc2/epicyon
Snake case
parent
f586d1bf66
commit
79dabfa8fc
|
@ -10,7 +10,7 @@ __module_group__ = "ActivityPub"
|
|||
import os
|
||||
from utils import hasObjectStringObject
|
||||
from utils import has_users_path
|
||||
from utils import getFullDomain
|
||||
from utils import get_full_domain
|
||||
from utils import urlPermitted
|
||||
from utils import getDomainFromActor
|
||||
from utils import getNicknameFromActor
|
||||
|
@ -39,7 +39,7 @@ def _create_accept_reject(base_dir: str, federation_list: [],
|
|||
if not urlPermitted(objectJson['actor'], federation_list):
|
||||
return None
|
||||
|
||||
domain = getFullDomain(domain, port)
|
||||
domain = get_full_domain(domain, port)
|
||||
|
||||
new_accept = {
|
||||
"@context": "https://www.w3.org/ns/activitystreams",
|
||||
|
|
10
announce.py
10
announce.py
|
@ -12,7 +12,7 @@ from utils import hasGroupType
|
|||
from utils import removeDomainPort
|
||||
from utils import removeIdEnding
|
||||
from utils import has_users_path
|
||||
from utils import getFullDomain
|
||||
from utils import get_full_domain
|
||||
from utils import getStatusNumber
|
||||
from utils import createOutboxDir
|
||||
from utils import urlPermitted
|
||||
|
@ -134,7 +134,7 @@ def createAnnounce(session, base_dir: str, federation_list: [],
|
|||
return None
|
||||
|
||||
domain = removeDomainPort(domain)
|
||||
fullDomain = getFullDomain(domain, port)
|
||||
fullDomain = get_full_domain(domain, port)
|
||||
|
||||
statusNumber, published = getStatusNumber()
|
||||
newAnnounceId = http_prefix + '://' + fullDomain + \
|
||||
|
@ -195,7 +195,7 @@ def announcePublic(session, base_dir: str, federation_list: [],
|
|||
signing_priv_key_pem: str) -> {}:
|
||||
"""Makes a public announcement
|
||||
"""
|
||||
fromDomain = getFullDomain(domain, port)
|
||||
fromDomain = get_full_domain(domain, port)
|
||||
|
||||
toUrl = 'https://www.w3.org/ns/activitystreams#Public'
|
||||
ccUrl = local_actor_url(http_prefix, nickname, fromDomain) + '/followers'
|
||||
|
@ -222,7 +222,7 @@ def sendAnnounceViaServer(base_dir: str, session,
|
|||
print('WARN: No session for sendAnnounceViaServer')
|
||||
return 6
|
||||
|
||||
fromDomainFull = getFullDomain(fromDomain, fromPort)
|
||||
fromDomainFull = get_full_domain(fromDomain, fromPort)
|
||||
|
||||
toUrl = 'https://www.w3.org/ns/activitystreams#Public'
|
||||
actorStr = local_actor_url(http_prefix, fromNickname, fromDomainFull)
|
||||
|
@ -315,7 +315,7 @@ def sendUndoAnnounceViaServer(base_dir: str, session,
|
|||
print('WARN: No session for sendUndoAnnounceViaServer')
|
||||
return 6
|
||||
|
||||
domain_full = getFullDomain(domain, port)
|
||||
domain_full = get_full_domain(domain, port)
|
||||
|
||||
actor = local_actor_url(http_prefix, nickname, domain_full)
|
||||
handle = replaceUsersWithAt(actor)
|
||||
|
|
|
@ -13,7 +13,7 @@ from auth import createBasicAuthHeader
|
|||
from posts import getPersonBox
|
||||
from session import postJson
|
||||
from utils import hasObjectString
|
||||
from utils import getFullDomain
|
||||
from utils import get_full_domain
|
||||
from utils import getNicknameFromActor
|
||||
from utils import getDomainFromActor
|
||||
from utils import loadJson
|
||||
|
@ -90,7 +90,7 @@ def sendAvailabilityViaServer(base_dir: str, session,
|
|||
print('WARN: No session for sendAvailabilityViaServer')
|
||||
return 6
|
||||
|
||||
domain_full = getFullDomain(domain, port)
|
||||
domain_full = get_full_domain(domain, port)
|
||||
|
||||
toUrl = local_actor_url(http_prefix, nickname, domain_full)
|
||||
ccUrl = toUrl + '/followers'
|
||||
|
|
14
blocking.py
14
blocking.py
|
@ -23,7 +23,7 @@ from utils import saveJson
|
|||
from utils import fileLastModified
|
||||
from utils import setConfigParam
|
||||
from utils import has_users_path
|
||||
from utils import getFullDomain
|
||||
from utils import get_full_domain
|
||||
from utils import removeIdEnding
|
||||
from utils import isEvil
|
||||
from utils import locatePost
|
||||
|
@ -453,7 +453,7 @@ def outboxBlock(base_dir: str, http_prefix: str,
|
|||
print('WARN: unable to find nickname in ' + message_json['object'])
|
||||
return False
|
||||
domainBlocked, portBlocked = getDomainFromActor(message_json['object'])
|
||||
domainBlockedFull = getFullDomain(domainBlocked, portBlocked)
|
||||
domainBlockedFull = get_full_domain(domainBlocked, portBlocked)
|
||||
|
||||
addBlock(base_dir, nickname, domain,
|
||||
nicknameBlocked, domainBlockedFull)
|
||||
|
@ -511,7 +511,7 @@ def outboxUndoBlock(base_dir: str, http_prefix: str,
|
|||
return
|
||||
domainObject = message_json['object']['object']
|
||||
domainBlocked, portBlocked = getDomainFromActor(domainObject)
|
||||
domainBlockedFull = getFullDomain(domainBlocked, portBlocked)
|
||||
domainBlockedFull = get_full_domain(domainBlocked, portBlocked)
|
||||
|
||||
removeBlock(base_dir, nickname, domain,
|
||||
nicknameBlocked, domainBlockedFull)
|
||||
|
@ -543,7 +543,7 @@ def mutePost(base_dir: str, nickname: str, domain: str, port: int,
|
|||
if hasObjectString(post_json_object, debug):
|
||||
alsoUpdatePostId = removeIdEnding(post_json_object['object'])
|
||||
|
||||
domain_full = getFullDomain(domain, port)
|
||||
domain_full = get_full_domain(domain, port)
|
||||
actor = local_actor_url(http_prefix, nickname, domain_full)
|
||||
|
||||
if postJsonObj.get('conversation'):
|
||||
|
@ -687,7 +687,7 @@ def unmutePost(base_dir: str, nickname: str, domain: str, port: int,
|
|||
postJsonObj['conversation'])
|
||||
|
||||
if postJsonObj.get('ignores'):
|
||||
domain_full = getFullDomain(domain, port)
|
||||
domain_full = get_full_domain(domain, port)
|
||||
actor = local_actor_url(http_prefix, nickname, domain_full)
|
||||
totalItems = 0
|
||||
if postJsonObj['ignores'].get('totalItems'):
|
||||
|
@ -778,7 +778,7 @@ def outboxMute(base_dir: str, http_prefix: str,
|
|||
return
|
||||
if not hasActor(message_json, debug):
|
||||
return
|
||||
domain_full = getFullDomain(domain, port)
|
||||
domain_full = get_full_domain(domain, port)
|
||||
if not message_json['actor'].endswith(domain_full + '/users/' + nickname):
|
||||
return
|
||||
if not message_json['type'] == 'Ignore':
|
||||
|
@ -827,7 +827,7 @@ def outboxUndoMute(base_dir: str, http_prefix: str,
|
|||
return
|
||||
if not hasActor(message_json, debug):
|
||||
return
|
||||
domain_full = getFullDomain(domain, port)
|
||||
domain_full = get_full_domain(domain, port)
|
||||
if not message_json['actor'].endswith(domain_full + '/users/' + nickname):
|
||||
return
|
||||
if not message_json['type'] == 'Undo':
|
||||
|
|
10
blog.py
10
blog.py
|
@ -24,7 +24,7 @@ from utils import get_content_from_post
|
|||
from utils import isAccountDir
|
||||
from utils import removeHtml
|
||||
from utils import getConfigParam
|
||||
from utils import getFullDomain
|
||||
from utils import get_full_domain
|
||||
from utils import getMediaFormats
|
||||
from utils import getNicknameFromActor
|
||||
from utils import getDomainFromActor
|
||||
|
@ -538,7 +538,7 @@ def htmlBlogPage(authorized: bool, session,
|
|||
if not timelineJson:
|
||||
return blogStr + htmlFooter()
|
||||
|
||||
domain_full = getFullDomain(domain, port)
|
||||
domain_full = get_full_domain(domain, port)
|
||||
|
||||
# show previous and next buttons
|
||||
if pageNumber is not None:
|
||||
|
@ -608,7 +608,7 @@ def htmlBlogPageRSS2(authorized: bool, session,
|
|||
'\n' in nickname or '\r' in nickname:
|
||||
return None
|
||||
|
||||
domain_full = getFullDomain(domain, port)
|
||||
domain_full = get_full_domain(domain, port)
|
||||
|
||||
blogRSS2 = ''
|
||||
if includeHeader:
|
||||
|
@ -663,7 +663,7 @@ def htmlBlogPageRSS3(authorized: bool, session,
|
|||
'\n' in nickname or '\r' in nickname:
|
||||
return None
|
||||
|
||||
domain_full = getFullDomain(domain, port)
|
||||
domain_full = get_full_domain(domain, port)
|
||||
|
||||
blogRSS3 = ''
|
||||
|
||||
|
@ -753,7 +753,7 @@ def htmlBlogView(authorized: bool,
|
|||
noOfItems, 1, peertube_instances,
|
||||
system_language, person_cache, debug)
|
||||
|
||||
domain_full = getFullDomain(domain, port)
|
||||
domain_full = get_full_domain(domain, port)
|
||||
|
||||
for subdir, dirs, files in os.walk(base_dir + '/accounts'):
|
||||
for acct in dirs:
|
||||
|
|
14
bookmarks.py
14
bookmarks.py
|
@ -13,7 +13,7 @@ from webfinger import webfingerHandle
|
|||
from auth import createBasicAuthHeader
|
||||
from utils import removeDomainPort
|
||||
from utils import has_users_path
|
||||
from utils import getFullDomain
|
||||
from utils import get_full_domain
|
||||
from utils import removeIdEnding
|
||||
from utils import removePostFromCache
|
||||
from utils import urlPermitted
|
||||
|
@ -265,7 +265,7 @@ def bookmark(recentPostsCache: {},
|
|||
if not urlPermitted(objectUrl, federation_list):
|
||||
return None
|
||||
|
||||
fullDomain = getFullDomain(domain, port)
|
||||
fullDomain = get_full_domain(domain, port)
|
||||
|
||||
newBookmarkJson = {
|
||||
"@context": "https://www.w3.org/ns/activitystreams",
|
||||
|
@ -324,7 +324,7 @@ def undoBookmark(recentPostsCache: {},
|
|||
if not urlPermitted(objectUrl, federation_list):
|
||||
return None
|
||||
|
||||
fullDomain = getFullDomain(domain, port)
|
||||
fullDomain = get_full_domain(domain, port)
|
||||
|
||||
newUndoBookmarkJson = {
|
||||
"@context": "https://www.w3.org/ns/activitystreams",
|
||||
|
@ -383,7 +383,7 @@ def sendBookmarkViaServer(base_dir: str, session,
|
|||
print('WARN: No session for sendBookmarkViaServer')
|
||||
return 6
|
||||
|
||||
domain_full = getFullDomain(domain, fromPort)
|
||||
domain_full = get_full_domain(domain, fromPort)
|
||||
|
||||
actor = local_actor_url(http_prefix, nickname, domain_full)
|
||||
|
||||
|
@ -473,7 +473,7 @@ def sendUndoBookmarkViaServer(base_dir: str, session,
|
|||
print('WARN: No session for sendUndoBookmarkViaServer')
|
||||
return 6
|
||||
|
||||
domain_full = getFullDomain(domain, fromPort)
|
||||
domain_full = get_full_domain(domain, fromPort)
|
||||
|
||||
actor = local_actor_url(http_prefix, nickname, domain_full)
|
||||
|
||||
|
@ -572,7 +572,7 @@ def outboxBookmark(recentPostsCache: {},
|
|||
if debug:
|
||||
print('DEBUG: bookmark Add target is not string')
|
||||
return
|
||||
domain_full = getFullDomain(domain, port)
|
||||
domain_full = get_full_domain(domain, port)
|
||||
if not message_json['target'].endswith('://' + domain_full +
|
||||
'/users/' + nickname +
|
||||
'/tlbookmarks'):
|
||||
|
@ -628,7 +628,7 @@ def outboxUndoBookmark(recentPostsCache: {},
|
|||
if debug:
|
||||
print('DEBUG: unbookmark Remove target is not string')
|
||||
return
|
||||
domain_full = getFullDomain(domain, port)
|
||||
domain_full = get_full_domain(domain, port)
|
||||
if not message_json['target'].endswith('://' + domain_full +
|
||||
'/users/' + nickname +
|
||||
'/tlbookmarks'):
|
||||
|
|
31
daemon.py
31
daemon.py
|
@ -272,7 +272,7 @@ from utils import decoded_host
|
|||
from utils import isPublicPost
|
||||
from utils import get_locked_account
|
||||
from utils import has_users_path
|
||||
from utils import getFullDomain
|
||||
from utils import get_full_domain
|
||||
from utils import removeHtml
|
||||
from utils import isEditor
|
||||
from utils import isArtist
|
||||
|
@ -1969,7 +1969,8 @@ class PubServer(BaseHTTPRequestHandler):
|
|||
# https://domain
|
||||
blockDomain, blockPort = \
|
||||
getDomainFromActor(moderationText)
|
||||
fullBlockDomain = getFullDomain(blockDomain, blockPort)
|
||||
fullBlockDomain = \
|
||||
get_full_domain(blockDomain, blockPort)
|
||||
if '@' in moderationText:
|
||||
# nick@domain or *@domain
|
||||
fullBlockDomain = moderationText.split('@')[1]
|
||||
|
@ -1987,7 +1988,8 @@ class PubServer(BaseHTTPRequestHandler):
|
|||
# https://domain
|
||||
blockDomain, blockPort = \
|
||||
getDomainFromActor(moderationText)
|
||||
fullBlockDomain = getFullDomain(blockDomain, blockPort)
|
||||
fullBlockDomain = \
|
||||
get_full_domain(blockDomain, blockPort)
|
||||
if '@' in moderationText:
|
||||
# nick@domain or *@domain
|
||||
fullBlockDomain = moderationText.split('@')[1]
|
||||
|
@ -2368,7 +2370,7 @@ class PubServer(BaseHTTPRequestHandler):
|
|||
return
|
||||
|
||||
optionsDomain, optionsPort = getDomainFromActor(optionsActor)
|
||||
optionsDomainFull = getFullDomain(optionsDomain, optionsPort)
|
||||
optionsDomainFull = get_full_domain(optionsDomain, optionsPort)
|
||||
if chooserNickname == optionsNickname and \
|
||||
optionsDomain == domain and \
|
||||
optionsPort == port:
|
||||
|
@ -2926,7 +2928,8 @@ class PubServer(BaseHTTPRequestHandler):
|
|||
followingNickname = getNicknameFromActor(followingActor)
|
||||
followingDomain, followingPort = \
|
||||
getDomainFromActor(followingActor)
|
||||
followingDomainFull = getFullDomain(followingDomain, followingPort)
|
||||
followingDomainFull = \
|
||||
get_full_domain(followingDomain, followingPort)
|
||||
if followerNickname == followingNickname and \
|
||||
followingDomain == domain and \
|
||||
followingPort == port:
|
||||
|
@ -3123,7 +3126,7 @@ class PubServer(BaseHTTPRequestHandler):
|
|||
return
|
||||
blockingDomain, blockingPort = \
|
||||
getDomainFromActor(blockingActor)
|
||||
blockingDomainFull = getFullDomain(blockingDomain, blockingPort)
|
||||
blockingDomainFull = get_full_domain(blockingDomain, blockingPort)
|
||||
if blockerNickname == blockingNickname and \
|
||||
blockingDomain == domain and \
|
||||
blockingPort == port:
|
||||
|
@ -3210,7 +3213,7 @@ class PubServer(BaseHTTPRequestHandler):
|
|||
return
|
||||
blockingDomain, blockingPort = \
|
||||
getDomainFromActor(blockingActor)
|
||||
blockingDomainFull = getFullDomain(blockingDomain, blockingPort)
|
||||
blockingDomainFull = get_full_domain(blockingDomain, blockingPort)
|
||||
if blockerNickname == blockingNickname and \
|
||||
blockingDomain == domain and \
|
||||
blockingPort == port:
|
||||
|
@ -3513,7 +3516,7 @@ class PubServer(BaseHTTPRequestHandler):
|
|||
searchDomain, searchPort = \
|
||||
getDomainFromActor(searchStr)
|
||||
searchDomainFull = \
|
||||
getFullDomain(searchDomain, searchPort)
|
||||
get_full_domain(searchDomain, searchPort)
|
||||
actor = \
|
||||
local_actor_url(http_prefix, searchNickname,
|
||||
searchDomainFull)
|
||||
|
@ -7902,7 +7905,8 @@ class PubServer(BaseHTTPRequestHandler):
|
|||
handleNickname = getNicknameFromActor(followingHandle)
|
||||
handleDomain, handlePort = getDomainFromActor(followingHandle)
|
||||
followingHandle = \
|
||||
handleNickname + '@' + getFullDomain(handleDomain, handlePort)
|
||||
handleNickname + '@' + \
|
||||
get_full_domain(handleDomain, handlePort)
|
||||
if '@' in followingHandle:
|
||||
if not self._establishSession("followApproveButton"):
|
||||
self._404()
|
||||
|
@ -8060,7 +8064,8 @@ class PubServer(BaseHTTPRequestHandler):
|
|||
handleNickname = getNicknameFromActor(followingHandle)
|
||||
handleDomain, handlePort = getDomainFromActor(followingHandle)
|
||||
followingHandle = \
|
||||
handleNickname + '@' + getFullDomain(handleDomain, handlePort)
|
||||
handleNickname + '@' + \
|
||||
get_full_domain(handleDomain, handlePort)
|
||||
if '@' in followingHandle:
|
||||
manualDenyFollowRequestThread(self.server.session,
|
||||
base_dir, http_prefix,
|
||||
|
@ -13258,11 +13263,11 @@ class PubServer(BaseHTTPRequestHandler):
|
|||
if self.headers.get('referer'):
|
||||
refererDomain, refererPort = \
|
||||
getDomainFromActor(self.headers['referer'])
|
||||
refererDomain = getFullDomain(refererDomain, refererPort)
|
||||
refererDomain = get_full_domain(refererDomain, refererPort)
|
||||
elif self.headers.get('Referer'):
|
||||
refererDomain, refererPort = \
|
||||
getDomainFromActor(self.headers['Referer'])
|
||||
refererDomain = getFullDomain(refererDomain, refererPort)
|
||||
refererDomain = get_full_domain(refererDomain, refererPort)
|
||||
elif self.headers.get('Signature'):
|
||||
if 'keyId="' in self.headers['Signature']:
|
||||
refererDomain = self.headers['Signature'].split('keyId="')[1]
|
||||
|
@ -18735,7 +18740,7 @@ def runDaemon(content_license_url: str,
|
|||
httpd.maxPostsInBox = 32000
|
||||
httpd.domain = domain
|
||||
httpd.port = port
|
||||
httpd.domain_full = getFullDomain(domain, port)
|
||||
httpd.domain_full = get_full_domain(domain, port)
|
||||
save_domain_qrcode(base_dir, http_prefix, httpd.domain_full)
|
||||
httpd.http_prefix = http_prefix
|
||||
httpd.debug = debug
|
||||
|
|
|
@ -12,7 +12,7 @@ from datetime import datetime
|
|||
from utils import hasObjectString
|
||||
from utils import removeDomainPort
|
||||
from utils import has_users_path
|
||||
from utils import getFullDomain
|
||||
from utils import get_full_domain
|
||||
from utils import removeIdEnding
|
||||
from utils import getNicknameFromActor
|
||||
from utils import getDomainFromActor
|
||||
|
@ -39,7 +39,7 @@ def sendDeleteViaServer(base_dir: str, session,
|
|||
print('WARN: No session for sendDeleteViaServer')
|
||||
return 6
|
||||
|
||||
fromDomainFull = getFullDomain(fromDomain, fromPort)
|
||||
fromDomainFull = get_full_domain(fromDomain, fromPort)
|
||||
|
||||
actor = local_actor_url(http_prefix, fromNickname, fromDomainFull)
|
||||
toUrl = 'https://www.w3.org/ns/activitystreams#Public'
|
||||
|
|
|
@ -18,7 +18,7 @@ from pathlib import Path
|
|||
from random import randint
|
||||
from utils import get_base_content_from_post
|
||||
from utils import has_object_dict
|
||||
from utils import getFullDomain
|
||||
from utils import get_full_domain
|
||||
from utils import isDM
|
||||
from utils import loadTranslationsFromFile
|
||||
from utils import removeHtml
|
||||
|
@ -806,7 +806,7 @@ def _desktopShowActor(base_dir: str, actor_json: {}, translate: {},
|
|||
actor = actor_json['id']
|
||||
actorNickname = getNicknameFromActor(actor)
|
||||
actorDomain, actorPort = getDomainFromActor(actor)
|
||||
actorDomainFull = getFullDomain(actorDomain, actorPort)
|
||||
actorDomainFull = get_full_domain(actorDomain, actorPort)
|
||||
handle = '@' + actorNickname + '@' + actorDomainFull
|
||||
|
||||
sayStr = 'Profile for ' + html.unescape(handle)
|
||||
|
@ -1284,7 +1284,7 @@ def _desktopShowFollowRequests(followRequestsJson: {}, translate: {}) -> None:
|
|||
handleNickname = getNicknameFromActor(item)
|
||||
handleDomain, handlePort = getDomainFromActor(item)
|
||||
handleDomainFull = \
|
||||
getFullDomain(handleDomain, handlePort)
|
||||
get_full_domain(handleDomain, handlePort)
|
||||
print(indent + ' 👤 ' +
|
||||
handleNickname + '@' + handleDomainFull)
|
||||
|
||||
|
@ -1310,7 +1310,7 @@ def _desktopShowFollowing(followingJson: {}, translate: {},
|
|||
handleNickname = getNicknameFromActor(item)
|
||||
handleDomain, handlePort = getDomainFromActor(item)
|
||||
handleDomainFull = \
|
||||
getFullDomain(handleDomain, handlePort)
|
||||
get_full_domain(handleDomain, handlePort)
|
||||
print(indent + ' 👤 ' +
|
||||
handleNickname + '@' + handleDomainFull)
|
||||
|
||||
|
@ -1409,7 +1409,7 @@ def runDesktopClient(base_dir: str, proxy_type: str, http_prefix: str,
|
|||
_sayCommand(sayStr, sayStr, screenreader,
|
||||
system_language, espeak)
|
||||
|
||||
domain_full = getFullDomain(domain, port)
|
||||
domain_full = get_full_domain(domain, port)
|
||||
yourActor = local_actor_url(http_prefix, nickname, domain_full)
|
||||
actor_json = None
|
||||
|
||||
|
|
10
epicyon.py
10
epicyon.py
|
@ -68,7 +68,7 @@ from auth import createPassword
|
|||
from utils import removeDomainPort
|
||||
from utils import getPortFromDomain
|
||||
from utils import has_users_path
|
||||
from utils import getFullDomain
|
||||
from utils import get_full_domain
|
||||
from utils import setConfigParam
|
||||
from utils import getConfigParam
|
||||
from utils import getDomainFromActor
|
||||
|
@ -704,7 +704,7 @@ if args.posts:
|
|||
postsNickname = getNicknameFromActor(args.posts)
|
||||
postsDomain, postsPort = getDomainFromActor(args.posts)
|
||||
args.posts = \
|
||||
getFullDomain(postsNickname + '@' + postsDomain, postsPort)
|
||||
get_full_domain(postsNickname + '@' + postsDomain, postsPort)
|
||||
else:
|
||||
print('Syntax: --posts nickname@domain')
|
||||
sys.exit()
|
||||
|
@ -738,7 +738,7 @@ if args.postDomains:
|
|||
postsNickname = getNicknameFromActor(args.postDomains)
|
||||
postsDomain, postsPort = getDomainFromActor(args.postDomains)
|
||||
args.postDomains = \
|
||||
getFullDomain(postsNickname + '@' + postsDomain, postsPort)
|
||||
get_full_domain(postsNickname + '@' + postsDomain, postsPort)
|
||||
else:
|
||||
print('Syntax: --postDomains nickname@domain')
|
||||
sys.exit()
|
||||
|
@ -790,7 +790,7 @@ if args.postDomainsBlocked:
|
|||
postsDomain, postsPort = \
|
||||
getDomainFromActor(args.postDomainsBlocked)
|
||||
args.postDomainsBlocked = \
|
||||
getFullDomain(postsNickname + '@' + postsDomain, postsPort)
|
||||
get_full_domain(postsNickname + '@' + postsDomain, postsPort)
|
||||
else:
|
||||
print('Syntax: --postDomainsBlocked nickname@domain')
|
||||
sys.exit()
|
||||
|
@ -836,7 +836,7 @@ if args.checkDomains:
|
|||
postsNickname = getNicknameFromActor(args.posts)
|
||||
postsDomain, postsPort = getDomainFromActor(args.posts)
|
||||
args.checkDomains = \
|
||||
getFullDomain(postsNickname + '@' + postsDomain, postsPort)
|
||||
get_full_domain(postsNickname + '@' + postsDomain, postsPort)
|
||||
else:
|
||||
print('Syntax: --checkDomains nickname@domain')
|
||||
sys.exit()
|
||||
|
|
39
follow.py
39
follow.py
|
@ -13,7 +13,7 @@ from utils import hasObjectStringObject
|
|||
from utils import hasObjectStringType
|
||||
from utils import removeDomainPort
|
||||
from utils import has_users_path
|
||||
from utils import getFullDomain
|
||||
from utils import get_full_domain
|
||||
from utils import getFollowersList
|
||||
from utils import validNickname
|
||||
from utils import domainPermitted
|
||||
|
@ -184,7 +184,8 @@ def isFollowingActor(base_dir: str,
|
|||
return False
|
||||
followingDomain, followingPort = getDomainFromActor(actor)
|
||||
followingHandle = \
|
||||
getFullDomain(followingNickname + '@' + followingDomain, followingPort)
|
||||
get_full_domain(followingNickname + '@' + followingDomain,
|
||||
followingPort)
|
||||
if followingHandle.lower() in open(followingFile).read().lower():
|
||||
return True
|
||||
return False
|
||||
|
@ -464,7 +465,7 @@ def getFollowingFeed(base_dir: str, domain: str, port: int, path: str,
|
|||
if not validNickname(domain, nickname):
|
||||
return None
|
||||
|
||||
domain = getFullDomain(domain, port)
|
||||
domain = get_full_domain(domain, port)
|
||||
|
||||
if headerOnly:
|
||||
firstStr = \
|
||||
|
@ -632,8 +633,8 @@ def storeFollowRequest(base_dir: str,
|
|||
if not os.path.isdir(accountsDir):
|
||||
return False
|
||||
|
||||
domain_full = getFullDomain(domain, fromPort)
|
||||
approveHandle = getFullDomain(nickname + '@' + domain, fromPort)
|
||||
domain_full = get_full_domain(domain, fromPort)
|
||||
approveHandle = get_full_domain(nickname + '@' + domain, fromPort)
|
||||
|
||||
if group_account:
|
||||
approveHandle = '!' + approveHandle
|
||||
|
@ -819,7 +820,7 @@ def followedAccountRejects(session, base_dir: str, http_prefix: str,
|
|||
' port ' + str(port) + ' to ' +
|
||||
nickname + '@' + domain + ' port ' + str(fromPort))
|
||||
client_to_server = False
|
||||
denyHandle = getFullDomain(nickname + '@' + domain, fromPort)
|
||||
denyHandle = get_full_domain(nickname + '@' + domain, fromPort)
|
||||
group_account = False
|
||||
if hasGroupType(base_dir, personUrl, person_cache):
|
||||
group_account = True
|
||||
|
@ -862,10 +863,10 @@ def sendFollowRequest(session, base_dir: str,
|
|||
print('You are not permitted to follow the domain ' + followDomain)
|
||||
return None
|
||||
|
||||
fullDomain = getFullDomain(domain, port)
|
||||
fullDomain = get_full_domain(domain, port)
|
||||
followActor = local_actor_url(http_prefix, nickname, fullDomain)
|
||||
|
||||
requestDomain = getFullDomain(followDomain, followPort)
|
||||
requestDomain = get_full_domain(followDomain, followPort)
|
||||
|
||||
statusNumber, published = getStatusNumber()
|
||||
|
||||
|
@ -952,9 +953,9 @@ def sendFollowRequestViaServer(base_dir: str, session,
|
|||
print('WARN: No session for sendFollowRequestViaServer')
|
||||
return 6
|
||||
|
||||
fromDomainFull = getFullDomain(fromDomain, fromPort)
|
||||
fromDomainFull = get_full_domain(fromDomain, fromPort)
|
||||
|
||||
followDomainFull = getFullDomain(followDomain, followPort)
|
||||
followDomainFull = get_full_domain(followDomain, followPort)
|
||||
|
||||
followActor = local_actor_url(http_prefix, fromNickname, fromDomainFull)
|
||||
followedId = \
|
||||
|
@ -1042,8 +1043,8 @@ def sendUnfollowRequestViaServer(base_dir: str, session,
|
|||
print('WARN: No session for sendUnfollowRequestViaServer')
|
||||
return 6
|
||||
|
||||
fromDomainFull = getFullDomain(fromDomain, fromPort)
|
||||
followDomainFull = getFullDomain(followDomain, followPort)
|
||||
fromDomainFull = get_full_domain(fromDomain, fromPort)
|
||||
followDomainFull = get_full_domain(followDomain, followPort)
|
||||
|
||||
followActor = local_actor_url(http_prefix, fromNickname, fromDomainFull)
|
||||
followedId = \
|
||||
|
@ -1137,7 +1138,7 @@ def getFollowingViaServer(base_dir: str, session,
|
|||
print('WARN: No session for getFollowingViaServer')
|
||||
return 6
|
||||
|
||||
domain_full = getFullDomain(domain, port)
|
||||
domain_full = get_full_domain(domain, port)
|
||||
followActor = local_actor_url(http_prefix, nickname, domain_full)
|
||||
|
||||
authHeader = createBasicAuthHeader(nickname, password)
|
||||
|
@ -1178,7 +1179,7 @@ def getFollowersViaServer(base_dir: str, session,
|
|||
print('WARN: No session for getFollowersViaServer')
|
||||
return 6
|
||||
|
||||
domain_full = getFullDomain(domain, port)
|
||||
domain_full = get_full_domain(domain, port)
|
||||
followActor = local_actor_url(http_prefix, nickname, domain_full)
|
||||
|
||||
authHeader = createBasicAuthHeader(nickname, password)
|
||||
|
@ -1219,7 +1220,7 @@ def getFollowRequestsViaServer(base_dir: str, session,
|
|||
print('WARN: No session for getFollowRequestsViaServer')
|
||||
return 6
|
||||
|
||||
domain_full = getFullDomain(domain, port)
|
||||
domain_full = get_full_domain(domain, port)
|
||||
|
||||
followActor = local_actor_url(http_prefix, nickname, domain_full)
|
||||
authHeader = createBasicAuthHeader(nickname, password)
|
||||
|
@ -1262,7 +1263,7 @@ def approveFollowRequestViaServer(base_dir: str, session,
|
|||
print('WARN: No session for approveFollowRequestViaServer')
|
||||
return 6
|
||||
|
||||
domain_full = getFullDomain(domain, port)
|
||||
domain_full = get_full_domain(domain, port)
|
||||
actor = local_actor_url(http_prefix, nickname, domain_full)
|
||||
|
||||
authHeader = createBasicAuthHeader(nickname, password)
|
||||
|
@ -1303,7 +1304,7 @@ def denyFollowRequestViaServer(base_dir: str, session,
|
|||
print('WARN: No session for denyFollowRequestViaServer')
|
||||
return 6
|
||||
|
||||
domain_full = getFullDomain(domain, port)
|
||||
domain_full = get_full_domain(domain, port)
|
||||
actor = local_actor_url(http_prefix, nickname, domain_full)
|
||||
|
||||
authHeader = createBasicAuthHeader(nickname, password)
|
||||
|
@ -1403,7 +1404,7 @@ def outboxUndoFollow(base_dir: str, message_json: {}, debug: bool) -> None:
|
|||
return
|
||||
domainFollower, portFollower = \
|
||||
getDomainFromActor(message_json['object']['actor'])
|
||||
domainFollowerFull = getFullDomain(domainFollower, portFollower)
|
||||
domainFollowerFull = get_full_domain(domainFollower, portFollower)
|
||||
|
||||
nicknameFollowing = getNicknameFromActor(message_json['object']['object'])
|
||||
if not nicknameFollowing:
|
||||
|
@ -1412,7 +1413,7 @@ def outboxUndoFollow(base_dir: str, message_json: {}, debug: bool) -> None:
|
|||
return
|
||||
domainFollowing, portFollowing = \
|
||||
getDomainFromActor(message_json['object']['object'])
|
||||
domainFollowingFull = getFullDomain(domainFollowing, portFollowing)
|
||||
domainFollowingFull = get_full_domain(domainFollowing, portFollowing)
|
||||
|
||||
group_account = \
|
||||
hasGroupType(base_dir, message_json['object']['object'], None)
|
||||
|
|
12
httpsig.py
12
httpsig.py
|
@ -22,7 +22,7 @@ from cryptography.hazmat.primitives.asymmetric import utils as hazutils
|
|||
import base64
|
||||
from time import gmtime, strftime
|
||||
import datetime
|
||||
from utils import getFullDomain
|
||||
from utils import get_full_domain
|
||||
from utils import get_sha_256
|
||||
from utils import get_sha_512
|
||||
from utils import local_actor_url
|
||||
|
@ -76,9 +76,9 @@ def signPostHeaders(dateStr: str, privateKeyPem: str,
|
|||
"""Returns a raw signature string that can be plugged into a header and
|
||||
used to verify the authenticity of an HTTP transmission.
|
||||
"""
|
||||
domain = getFullDomain(domain, port)
|
||||
domain = get_full_domain(domain, port)
|
||||
|
||||
toDomain = getFullDomain(toDomain, toPort)
|
||||
toDomain = get_full_domain(toDomain, toPort)
|
||||
|
||||
if not dateStr:
|
||||
dateStr = strftime("%a, %d %b %Y %H:%M:%S %Z", gmtime())
|
||||
|
@ -156,9 +156,9 @@ def signPostHeadersNew(dateStr: str, privateKeyPem: str,
|
|||
used to verify the authenticity of an HTTP transmission.
|
||||
See https://tools.ietf.org/html/draft-ietf-httpbis-message-signatures
|
||||
"""
|
||||
domain = getFullDomain(domain, port)
|
||||
domain = get_full_domain(domain, port)
|
||||
|
||||
toDomain = getFullDomain(toDomain, toPort)
|
||||
toDomain = get_full_domain(toDomain, toPort)
|
||||
|
||||
timeFormat = "%a, %d %b %Y %H:%M:%S %Z"
|
||||
if not dateStr:
|
||||
|
@ -247,7 +247,7 @@ def createSignedHeader(dateStr: str, privateKeyPem: str, nickname: str,
|
|||
"""
|
||||
algorithm = 'rsa-sha256'
|
||||
digestAlgorithm = 'rsa-sha256'
|
||||
headerDomain = getFullDomain(toDomain, toPort)
|
||||
headerDomain = get_full_domain(toDomain, toPort)
|
||||
|
||||
# if no date is given then create one
|
||||
if not dateStr:
|
||||
|
|
40
inbox.py
40
inbox.py
|
@ -38,7 +38,7 @@ from utils import isRecentPost
|
|||
from utils import getConfigParam
|
||||
from utils import has_users_path
|
||||
from utils import valid_post_date
|
||||
from utils import getFullDomain
|
||||
from utils import get_full_domain
|
||||
from utils import removeIdEnding
|
||||
from utils import getProtocolPrefixes
|
||||
from utils import isBlogPost
|
||||
|
@ -491,7 +491,7 @@ def savePostToInboxQueue(base_dir: str, http_prefix: str,
|
|||
if debug:
|
||||
print('DEBUG: post from ' + postNickname + ' blocked')
|
||||
return None
|
||||
postDomain = getFullDomain(postDomain, postPort)
|
||||
postDomain = get_full_domain(postDomain, postPort)
|
||||
|
||||
if has_object_dict(post_json_object):
|
||||
if post_json_object['object'].get('inReplyTo'):
|
||||
|
@ -646,7 +646,7 @@ def _inboxPostRecipients(base_dir: str, post_json_object: {},
|
|||
|
||||
domain = removeDomainPort(domain)
|
||||
domainBase = domain
|
||||
domain = getFullDomain(domain, port)
|
||||
domain = get_full_domain(domain, port)
|
||||
domainMatch = '/' + domain + '/users/'
|
||||
|
||||
actor = post_json_object['actor']
|
||||
|
@ -764,7 +764,7 @@ def _receiveUndoFollow(session, base_dir: str, http_prefix: str,
|
|||
return False
|
||||
domainFollower, portFollower = \
|
||||
getDomainFromActor(message_json['object']['actor'])
|
||||
domainFollowerFull = getFullDomain(domainFollower, portFollower)
|
||||
domainFollowerFull = get_full_domain(domainFollower, portFollower)
|
||||
|
||||
nicknameFollowing = \
|
||||
getNicknameFromActor(message_json['object']['object'])
|
||||
|
@ -774,7 +774,7 @@ def _receiveUndoFollow(session, base_dir: str, http_prefix: str,
|
|||
return False
|
||||
domainFollowing, portFollowing = \
|
||||
getDomainFromActor(message_json['object']['object'])
|
||||
domainFollowingFull = getFullDomain(domainFollowing, portFollowing)
|
||||
domainFollowingFull = get_full_domain(domainFollowing, portFollowing)
|
||||
|
||||
group_account = \
|
||||
hasGroupType(base_dir, message_json['object']['actor'], None)
|
||||
|
@ -834,8 +834,8 @@ def _personReceiveUpdate(base_dir: str,
|
|||
if debug:
|
||||
print('Receiving actor update for ' + personJson['url'] +
|
||||
' ' + str(personJson))
|
||||
domain_full = getFullDomain(domain, port)
|
||||
updateDomainFull = getFullDomain(updateDomain, updatePort)
|
||||
domain_full = get_full_domain(domain, port)
|
||||
updateDomainFull = get_full_domain(updateDomain, updatePort)
|
||||
usersPaths = get_user_paths()
|
||||
usersStrFound = False
|
||||
for usersStr in usersPaths:
|
||||
|
@ -1536,7 +1536,7 @@ def _receiveBookmark(recentPostsCache: {},
|
|||
if debug:
|
||||
print('DEBUG: inbox bookmark Add target is not string')
|
||||
return False
|
||||
domain_full = getFullDomain(domain, port)
|
||||
domain_full = get_full_domain(domain, port)
|
||||
nickname = handle.split('@')[0]
|
||||
if not message_json['actor'].endswith(domain_full + '/users/' + nickname):
|
||||
if debug:
|
||||
|
@ -1648,7 +1648,7 @@ def _receiveUndoBookmark(recentPostsCache: {},
|
|||
if debug:
|
||||
print('DEBUG: inbox Remove bookmark target is not string')
|
||||
return False
|
||||
domain_full = getFullDomain(domain, port)
|
||||
domain_full = get_full_domain(domain, port)
|
||||
nickname = handle.split('@')[0]
|
||||
if not message_json['actor'].endswith(domain_full + '/users/' + nickname):
|
||||
if debug:
|
||||
|
@ -1741,7 +1741,7 @@ def _receiveDelete(session, handle: str, isGroup: bool, base_dir: str,
|
|||
print('DEBUG: Delete activity arrived')
|
||||
if not hasObjectString(message_json, debug):
|
||||
return False
|
||||
domain_full = getFullDomain(domain, port)
|
||||
domain_full = get_full_domain(domain, port)
|
||||
deletePrefix = http_prefix + '://' + domain_full + '/'
|
||||
if (not allow_deletion and
|
||||
(not message_json['object'].startswith(deletePrefix) or
|
||||
|
@ -1899,7 +1899,7 @@ def _receiveAnnounce(recentPostsCache: {},
|
|||
if debug:
|
||||
print('DEBUG: Downloading announce post ' + message_json['actor'] +
|
||||
' -> ' + message_json['object'])
|
||||
domain_full = getFullDomain(domain, port)
|
||||
domain_full = get_full_domain(domain, port)
|
||||
|
||||
# Generate html. This also downloads the announced post.
|
||||
pageNumber = 1
|
||||
|
@ -1990,7 +1990,7 @@ def _receiveAnnounce(recentPostsCache: {},
|
|||
|
||||
if isRecentPost(post_json_object, 3):
|
||||
if not os.path.isfile(postFilename + '.tts'):
|
||||
domain_full = getFullDomain(domain, port)
|
||||
domain_full = get_full_domain(domain, port)
|
||||
updateSpeaker(base_dir, http_prefix,
|
||||
nickname, domain, domain_full,
|
||||
post_json_object, person_cache,
|
||||
|
@ -2650,7 +2650,7 @@ def _sendToGroupMembers(session, base_dir: str, handle: str, port: int,
|
|||
return
|
||||
nickname = handle.split('@')[0].replace('!', '')
|
||||
domain = handle.split('@')[1]
|
||||
domain_full = getFullDomain(domain, port)
|
||||
domain_full = get_full_domain(domain, port)
|
||||
groupActor = local_actor_url(http_prefix, nickname, domain_full)
|
||||
if groupActor not in post_json_object['to']:
|
||||
return
|
||||
|
@ -3142,11 +3142,11 @@ def _lowFrequencyPostNotification(base_dir: str, http_prefix: str,
|
|||
return
|
||||
fromNickname = getNicknameFromActor(attributedTo)
|
||||
fromDomain, fromPort = getDomainFromActor(attributedTo)
|
||||
fromDomainFull = getFullDomain(fromDomain, fromPort)
|
||||
fromDomainFull = get_full_domain(fromDomain, fromPort)
|
||||
if notifyWhenPersonPosts(base_dir, nickname, domain,
|
||||
fromNickname, fromDomainFull):
|
||||
postId = removeIdEnding(jsonObj['id'])
|
||||
domFull = getFullDomain(domain, port)
|
||||
domFull = get_full_domain(domain, port)
|
||||
postLink = \
|
||||
local_actor_url(http_prefix, nickname, domFull) + \
|
||||
'?notifypost=' + postId.replace('/', '-')
|
||||
|
@ -3170,7 +3170,7 @@ def _checkForGitPatches(base_dir: str, nickname: str, domain: str,
|
|||
return 0
|
||||
fromNickname = getNicknameFromActor(attributedTo)
|
||||
fromDomain, fromPort = getDomainFromActor(attributedTo)
|
||||
fromDomainFull = getFullDomain(fromDomain, fromPort)
|
||||
fromDomainFull = get_full_domain(fromDomain, fromPort)
|
||||
if receiveGitPatch(base_dir, nickname, domain,
|
||||
jsonObj['type'], jsonObj['summary'],
|
||||
jsonObj['content'],
|
||||
|
@ -3422,7 +3422,7 @@ def _inboxAfterInitial(recentPostsCache: {}, max_recent_posts: int,
|
|||
|
||||
nickname = handle.split('@')[0]
|
||||
jsonObj = None
|
||||
domain_full = getFullDomain(domain, port)
|
||||
domain_full = get_full_domain(domain, port)
|
||||
if _validPostContent(base_dir, nickname, domain,
|
||||
post_json_object, max_mentions, max_emoji,
|
||||
allow_local_network_access, debug,
|
||||
|
@ -3550,7 +3550,7 @@ def _inboxAfterInitial(recentPostsCache: {}, max_recent_posts: int,
|
|||
else:
|
||||
if boxname == 'inbox':
|
||||
if isRecentPost(post_json_object, 3):
|
||||
domain_full = getFullDomain(domain, port)
|
||||
domain_full = get_full_domain(domain, port)
|
||||
updateSpeaker(base_dir, http_prefix,
|
||||
nickname, domain, domain_full,
|
||||
post_json_object, person_cache,
|
||||
|
@ -3874,7 +3874,7 @@ def _receiveFollowRequest(session, base_dir: str, http_prefix: str,
|
|||
return False
|
||||
domain, tempPort = getDomainFromActor(message_json['actor'])
|
||||
fromPort = port
|
||||
domain_full = getFullDomain(domain, tempPort)
|
||||
domain_full = get_full_domain(domain, tempPort)
|
||||
if tempPort:
|
||||
fromPort = tempPort
|
||||
if not domainPermitted(domain, federation_list):
|
||||
|
@ -3900,7 +3900,7 @@ def _receiveFollowRequest(session, base_dir: str, http_prefix: str,
|
|||
if debug:
|
||||
print('DEBUG: follow domain not permitted ' + domainToFollow)
|
||||
return True
|
||||
domainToFollowFull = getFullDomain(domainToFollow, tempPort)
|
||||
domainToFollowFull = get_full_domain(domainToFollow, tempPort)
|
||||
nicknameToFollow = getNicknameFromActor(message_json['object'])
|
||||
if not nicknameToFollow:
|
||||
if debug:
|
||||
|
|
10
like.py
10
like.py
|
@ -15,7 +15,7 @@ from utils import hasObjectStringType
|
|||
from utils import removeDomainPort
|
||||
from utils import has_object_dict
|
||||
from utils import has_users_path
|
||||
from utils import getFullDomain
|
||||
from utils import get_full_domain
|
||||
from utils import removeIdEnding
|
||||
from utils import urlPermitted
|
||||
from utils import getNicknameFromActor
|
||||
|
@ -86,7 +86,7 @@ def _like(recentPostsCache: {},
|
|||
if not urlPermitted(objectUrl, federation_list):
|
||||
return None
|
||||
|
||||
fullDomain = getFullDomain(domain, port)
|
||||
fullDomain = get_full_domain(domain, port)
|
||||
|
||||
newLikeJson = {
|
||||
"@context": "https://www.w3.org/ns/activitystreams",
|
||||
|
@ -156,7 +156,7 @@ def likePost(recentPostsCache: {},
|
|||
signing_priv_key_pem: str) -> {}:
|
||||
"""Likes a given status post. This is only used by unit tests
|
||||
"""
|
||||
likeDomain = getFullDomain(likeDomain, likePort)
|
||||
likeDomain = get_full_domain(likeDomain, likePort)
|
||||
|
||||
actorLiked = local_actor_url(http_prefix, likeNickname, likeDomain)
|
||||
objectUrl = actorLiked + '/statuses/' + str(likeStatusNumber)
|
||||
|
@ -181,7 +181,7 @@ def sendLikeViaServer(base_dir: str, session,
|
|||
print('WARN: No session for sendLikeViaServer')
|
||||
return 6
|
||||
|
||||
fromDomainFull = getFullDomain(fromDomain, fromPort)
|
||||
fromDomainFull = get_full_domain(fromDomain, fromPort)
|
||||
|
||||
actor = local_actor_url(http_prefix, fromNickname, fromDomainFull)
|
||||
|
||||
|
@ -264,7 +264,7 @@ def sendUndoLikeViaServer(base_dir: str, session,
|
|||
print('WARN: No session for sendUndoLikeViaServer')
|
||||
return 6
|
||||
|
||||
fromDomainFull = getFullDomain(fromDomain, fromPort)
|
||||
fromDomainFull = get_full_domain(fromDomain, fromPort)
|
||||
|
||||
actor = local_actor_url(http_prefix, fromNickname, fromDomainFull)
|
||||
|
||||
|
|
4
media.py
4
media.py
|
@ -16,7 +16,7 @@ from random import randint
|
|||
from hashlib import sha1
|
||||
from auth import createPassword
|
||||
from utils import get_base_content_from_post
|
||||
from utils import getFullDomain
|
||||
from utils import get_full_domain
|
||||
from utils import getImageExtensions
|
||||
from utils import getVideoExtensions
|
||||
from utils import getAudioExtensions
|
||||
|
@ -324,7 +324,7 @@ def attachMedia(base_dir: str, http_prefix: str,
|
|||
if mediaType == 'audio/mpeg':
|
||||
fileExtension = 'mp3'
|
||||
|
||||
domain = getFullDomain(domain, port)
|
||||
domain = get_full_domain(domain, port)
|
||||
|
||||
mPath = getMediaPath()
|
||||
mediaPath = mPath + '/' + createPassword(32) + '.' + fileExtension
|
||||
|
|
|
@ -27,7 +27,7 @@ from posts import archivePostsForPerson
|
|||
from content import validHashTag
|
||||
from utils import get_base_content_from_post
|
||||
from utils import removeHtml
|
||||
from utils import getFullDomain
|
||||
from utils import get_full_domain
|
||||
from utils import loadJson
|
||||
from utils import saveJson
|
||||
from utils import getStatusNumber
|
||||
|
@ -394,7 +394,7 @@ def _newswireHashtagProcessing(session, base_dir: str, post_json_object: {},
|
|||
with open(rulesFilename, 'r') as f:
|
||||
rules = f.readlines()
|
||||
|
||||
domain_full = getFullDomain(domain, port)
|
||||
domain_full = get_full_domain(domain, port)
|
||||
|
||||
# get the full text content of the post
|
||||
content = ''
|
||||
|
@ -672,7 +672,7 @@ def _convertRSStoActivityPub(base_dir: str, http_prefix: str,
|
|||
blog['object']['content'] = rssDescription
|
||||
blog['object']['contentMap'][system_language] = rssDescription
|
||||
|
||||
domain_full = getFullDomain(domain, port)
|
||||
domain_full = get_full_domain(domain, port)
|
||||
|
||||
hashtags = item[6]
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ from utils import hasObjectStringType
|
|||
from utils import get_base_content_from_post
|
||||
from utils import has_object_dict
|
||||
from utils import getLocalNetworkAddresses
|
||||
from utils import getFullDomain
|
||||
from utils import get_full_domain
|
||||
from utils import removeIdEnding
|
||||
from utils import getDomainFromActor
|
||||
from utils import dangerousMarkup
|
||||
|
@ -100,7 +100,7 @@ def _outboxPersonReceiveUpdate(recentPostsCache: {},
|
|||
if debug:
|
||||
print('DEBUG: c2s actor update id is not a string')
|
||||
return
|
||||
domain_full = getFullDomain(domain, port)
|
||||
domain_full = get_full_domain(domain, port)
|
||||
actor = local_actor_url(http_prefix, nickname, domain_full)
|
||||
if len(message_json['to']) != 1:
|
||||
if debug:
|
||||
|
@ -280,7 +280,7 @@ def postMessageToOutbox(session, translate: {},
|
|||
return False
|
||||
|
||||
testDomain, testPort = getDomainFromActor(message_json['actor'])
|
||||
testDomain = getFullDomain(testDomain, testPort)
|
||||
testDomain = get_full_domain(testDomain, testPort)
|
||||
if isBlockedDomain(base_dir, testDomain):
|
||||
if debug:
|
||||
print('DEBUG: domain is blocked: ' + message_json['actor'])
|
||||
|
|
12
person.py
12
person.py
|
@ -44,7 +44,7 @@ from utils import replaceUsersWithAt
|
|||
from utils import removeLineEndings
|
||||
from utils import removeDomainPort
|
||||
from utils import getStatusNumber
|
||||
from utils import getFullDomain
|
||||
from utils import get_full_domain
|
||||
from utils import validNickname
|
||||
from utils import loadJson
|
||||
from utils import saveJson
|
||||
|
@ -108,7 +108,7 @@ def setProfileImage(base_dir: str, http_prefix: str,
|
|||
imageFilename = imageFilename.replace('~/', str(Path.home()) + '/')
|
||||
|
||||
domain = removeDomainPort(domain)
|
||||
fullDomain = getFullDomain(domain, port)
|
||||
fullDomain = get_full_domain(domain, port)
|
||||
|
||||
handle = nickname + '@' + domain
|
||||
personFilename = base_dir + '/accounts/' + handle + '.json'
|
||||
|
@ -366,7 +366,7 @@ def _createPersonBase(base_dir: str, nickname: str, domain: str, port: int,
|
|||
|
||||
handle = nickname + '@' + domain
|
||||
originalDomain = domain
|
||||
domain = getFullDomain(domain, port)
|
||||
domain = get_full_domain(domain, port)
|
||||
|
||||
personType = 'Person'
|
||||
if group_account:
|
||||
|
@ -586,7 +586,7 @@ def savePersonQrcode(base_dir: str,
|
|||
qrcodeFilename = acct_dir(base_dir, nickname, domain) + '/qrcode.png'
|
||||
if os.path.isfile(qrcodeFilename):
|
||||
return
|
||||
handle = getFullDomain('@' + nickname + '@' + domain, port)
|
||||
handle = get_full_domain('@' + nickname + '@' + domain, port)
|
||||
url = pyqrcode.create(handle)
|
||||
url.png(qrcodeFilename, scale)
|
||||
|
||||
|
@ -1115,7 +1115,7 @@ def canRemovePost(base_dir: str, nickname: str,
|
|||
if '/statuses/' not in postId:
|
||||
return False
|
||||
|
||||
domain_full = getFullDomain(domain, port)
|
||||
domain_full = get_full_domain(domain, port)
|
||||
|
||||
# is the post by the admin?
|
||||
adminNickname = getConfigParam(base_dir, 'admin')
|
||||
|
@ -1141,7 +1141,7 @@ def _removeTagsForNickname(base_dir: str, nickname: str,
|
|||
"""
|
||||
if not os.path.isdir(base_dir + '/tags'):
|
||||
return
|
||||
domain_full = getFullDomain(domain, port)
|
||||
domain_full = get_full_domain(domain, port)
|
||||
matchStr = domain_full + '/users/' + nickname + '/'
|
||||
directory = os.fsencode(base_dir + '/tags/')
|
||||
for f in os.scandir(directory):
|
||||
|
|
4
pgp.py
4
pgp.py
|
@ -13,7 +13,7 @@ from pathlib import Path
|
|||
from person import getActorJson
|
||||
from utils import containsPGPPublicKey
|
||||
from utils import isPGPEncrypted
|
||||
from utils import getFullDomain
|
||||
from utils import get_full_domain
|
||||
from utils import getStatusNumber
|
||||
from utils import local_actor_url
|
||||
from utils import replaceUsersWithAt
|
||||
|
@ -480,7 +480,7 @@ def pgpPublicKeyUpload(base_dir: str, session,
|
|||
PGPpubKey = test
|
||||
PGPpubKeyId = None
|
||||
|
||||
domain_full = getFullDomain(domain, port)
|
||||
domain_full = get_full_domain(domain, port)
|
||||
if debug:
|
||||
print('PGP test domain: ' + domain_full)
|
||||
|
||||
|
|
67
posts.py
67
posts.py
|
@ -48,7 +48,7 @@ from utils import fileLastModified
|
|||
from utils import isPublicPost
|
||||
from utils import has_users_path
|
||||
from utils import valid_post_date
|
||||
from utils import getFullDomain
|
||||
from utils import get_full_domain
|
||||
from utils import getFollowersList
|
||||
from utils import isEvil
|
||||
from utils import getStatusNumber
|
||||
|
@ -1151,7 +1151,7 @@ def _createPostC2S(base_dir: str, nickname: str, domain: str, port: int,
|
|||
content_license_url: str) -> {}:
|
||||
"""Creates a new client-to-server post
|
||||
"""
|
||||
domain_full = getFullDomain(domain, port)
|
||||
domain_full = get_full_domain(domain, port)
|
||||
idStr = \
|
||||
local_actor_url(http_prefix, nickname, domain_full) + \
|
||||
'/statuses/' + statusNumber + '/replies'
|
||||
|
@ -1398,7 +1398,7 @@ def _createPostBase(base_dir: str,
|
|||
tags = []
|
||||
hashtagsDict = {}
|
||||
|
||||
domain = getFullDomain(domain, port)
|
||||
domain = get_full_domain(domain, port)
|
||||
|
||||
# add tags
|
||||
if nickname != 'news':
|
||||
|
@ -1569,7 +1569,7 @@ def outboxMessageCreateWrap(http_prefix: str,
|
|||
https://www.w3.org/TR/activitypub/#object-without-create
|
||||
"""
|
||||
|
||||
domain = getFullDomain(domain, port)
|
||||
domain = get_full_domain(domain, port)
|
||||
statusNumber, published = getStatusNumber()
|
||||
if message_json.get('published'):
|
||||
published = message_json['published']
|
||||
|
@ -1604,7 +1604,7 @@ def _postIsAddressedToFollowers(base_dir: str,
|
|||
post_json_object: {}) -> bool:
|
||||
"""Returns true if the given post is addressed to followers of the nickname
|
||||
"""
|
||||
domain_full = getFullDomain(domain, port)
|
||||
domain_full = get_full_domain(domain, port)
|
||||
|
||||
if not post_json_object.get('object'):
|
||||
return False
|
||||
|
@ -1771,7 +1771,7 @@ def createPublicPost(base_dir: str,
|
|||
content_license_url: str) -> {}:
|
||||
"""Public post
|
||||
"""
|
||||
domain_full = getFullDomain(domain, port)
|
||||
domain_full = get_full_domain(domain, port)
|
||||
isModerationReport = False
|
||||
eventUUID = None
|
||||
category = None
|
||||
|
@ -1907,7 +1907,7 @@ def createQuestionPost(base_dir: str,
|
|||
content_license_url: str) -> {}:
|
||||
"""Question post with multiple choice options
|
||||
"""
|
||||
domain_full = getFullDomain(domain, port)
|
||||
domain_full = get_full_domain(domain, port)
|
||||
localActor = local_actor_url(http_prefix, nickname, domain_full)
|
||||
message_json = \
|
||||
_createPostBase(base_dir, nickname, domain, port,
|
||||
|
@ -1957,7 +1957,7 @@ def createUnlistedPost(base_dir: str,
|
|||
content_license_url: str) -> {}:
|
||||
"""Unlisted post. This has the #Public and followers links inverted.
|
||||
"""
|
||||
domain_full = getFullDomain(domain, port)
|
||||
domain_full = get_full_domain(domain, port)
|
||||
localActor = local_actor_url(http_prefix, nickname, domain_full)
|
||||
return _createPostBase(base_dir, nickname, domain, port,
|
||||
localActor + '/followers',
|
||||
|
@ -1992,7 +1992,7 @@ def createFollowersOnlyPost(base_dir: str,
|
|||
content_license_url: str) -> {}:
|
||||
"""Followers only post
|
||||
"""
|
||||
domain_full = getFullDomain(domain, port)
|
||||
domain_full = get_full_domain(domain, port)
|
||||
localActor = local_actor_url(http_prefix, nickname, domain_full)
|
||||
return _createPostBase(base_dir, nickname, domain, port,
|
||||
localActor + '/followers',
|
||||
|
@ -2110,7 +2110,7 @@ def createReportPost(base_dir: str,
|
|||
content_license_url: str) -> {}:
|
||||
"""Send a report to moderators
|
||||
"""
|
||||
domain_full = getFullDomain(domain, port)
|
||||
domain_full = get_full_domain(domain, port)
|
||||
|
||||
# add a title to distinguish moderation reports from other posts
|
||||
reportTitle = 'Moderation Report'
|
||||
|
@ -2290,7 +2290,7 @@ def sendPost(signing_priv_key_pem: str, project_version: str,
|
|||
# shared inbox actor on @domain@domain
|
||||
toNickname = toDomain
|
||||
|
||||
toDomain = getFullDomain(toDomain, toPort)
|
||||
toDomain = get_full_domain(toDomain, toPort)
|
||||
|
||||
handle = http_prefix + '://' + toDomain + '/@' + toNickname
|
||||
|
||||
|
@ -2380,7 +2380,7 @@ def sendPost(signing_priv_key_pem: str, project_version: str,
|
|||
# federation list then send the token for this domain
|
||||
# so that it can request a catalog
|
||||
if toDomain in shared_items_federated_domains:
|
||||
domain_full = getFullDomain(domain, port)
|
||||
domain_full = get_full_domain(domain, port)
|
||||
if sharedItemFederationTokens.get(domain_full):
|
||||
signatureHeaderJson['Origin'] = domain_full
|
||||
signatureHeaderJson['SharesCatalog'] = \
|
||||
|
@ -2439,7 +2439,7 @@ def sendPostViaServer(signing_priv_key_pem: str, project_version: str,
|
|||
print('WARN: No session for sendPostViaServer')
|
||||
return 6
|
||||
|
||||
fromDomainFull = getFullDomain(fromDomain, fromPort)
|
||||
fromDomainFull = get_full_domain(fromDomain, fromPort)
|
||||
|
||||
handle = http_prefix + '://' + fromDomainFull + '/@' + fromNickname
|
||||
|
||||
|
@ -2497,7 +2497,7 @@ def sendPostViaServer(signing_priv_key_pem: str, project_version: str,
|
|||
local_actor_url(http_prefix, fromNickname, fromDomainFull) + \
|
||||
'/followers'
|
||||
else:
|
||||
toDomainFull = getFullDomain(toDomain, toPort)
|
||||
toDomainFull = get_full_domain(toDomain, toPort)
|
||||
toPersonId = local_actor_url(http_prefix, toNickname, toDomainFull)
|
||||
|
||||
post_json_object = \
|
||||
|
@ -2636,7 +2636,7 @@ def sendSignedJson(post_json_object: {}, session, base_dir: str,
|
|||
# shared inbox actor on @domain@domain
|
||||
toNickname = toDomain
|
||||
|
||||
toDomain = getFullDomain(toDomain, toPort)
|
||||
toDomain = get_full_domain(toDomain, toPort)
|
||||
|
||||
toDomainUrl = http_prefix + '://' + toDomain
|
||||
if not siteIsActive(toDomainUrl, 10):
|
||||
|
@ -2752,7 +2752,7 @@ def sendSignedJson(post_json_object: {}, session, base_dir: str,
|
|||
# optionally add a token so that the receiving instance may access
|
||||
# your shared items catalog
|
||||
if sharedItemsToken:
|
||||
signatureHeaderJson['Origin'] = getFullDomain(domain, port)
|
||||
signatureHeaderJson['Origin'] = get_full_domain(domain, port)
|
||||
signatureHeaderJson['SharesCatalog'] = sharedItemsToken
|
||||
elif debug:
|
||||
print('Not sending shared items federation token')
|
||||
|
@ -2960,8 +2960,8 @@ def _sendToNamedAddresses(session, base_dir: str,
|
|||
continue
|
||||
# Don't send profile/actor updates to yourself
|
||||
if isProfileUpdate:
|
||||
domain_full = getFullDomain(domain, port)
|
||||
toDomainFull = getFullDomain(toDomain, toPort)
|
||||
domain_full = get_full_domain(domain, port)
|
||||
toDomainFull = get_full_domain(toDomain, toPort)
|
||||
if nickname == toNickname and \
|
||||
domain_full == toDomainFull:
|
||||
if debug:
|
||||
|
@ -2969,8 +2969,8 @@ def _sendToNamedAddresses(session, base_dir: str,
|
|||
nickname + '@' + domain_full)
|
||||
continue
|
||||
if debug:
|
||||
domain_full = getFullDomain(domain, port)
|
||||
toDomainFull = getFullDomain(toDomain, toPort)
|
||||
domain_full = get_full_domain(domain, port)
|
||||
toDomainFull = get_full_domain(toDomain, toPort)
|
||||
print('DEBUG: Post sending s2s: ' + nickname + '@' + domain_full +
|
||||
' to ' + toNickname + '@' + toDomainFull)
|
||||
|
||||
|
@ -2978,7 +2978,7 @@ def _sendToNamedAddresses(session, base_dir: str,
|
|||
# another onion domain then switch the clearnet
|
||||
# domain for the onion one
|
||||
fromDomain = domain
|
||||
fromDomainFull = getFullDomain(domain, port)
|
||||
fromDomainFull = get_full_domain(domain, port)
|
||||
fromHttpPrefix = http_prefix
|
||||
if onion_domain:
|
||||
if toDomain.endswith('.onion'):
|
||||
|
@ -3144,7 +3144,7 @@ def sendToFollowers(session, base_dir: str,
|
|||
# so that it can request a catalog
|
||||
sharedItemsToken = None
|
||||
if followerDomain in shared_items_federated_domains:
|
||||
domain_full = getFullDomain(domain, port)
|
||||
domain_full = get_full_domain(domain, port)
|
||||
if sharedItemFederationTokens.get(domain_full):
|
||||
sharedItemsToken = sharedItemFederationTokens[domain_full]
|
||||
|
||||
|
@ -3396,7 +3396,7 @@ def createModeration(base_dir: str, nickname: str, domain: str, port: int,
|
|||
boxDir = createPersonDir(nickname, domain, base_dir, 'inbox')
|
||||
boxname = 'moderation'
|
||||
|
||||
domain = getFullDomain(domain, port)
|
||||
domain = get_full_domain(domain, port)
|
||||
|
||||
if not pageNumber:
|
||||
pageNumber = 1
|
||||
|
@ -3688,7 +3688,7 @@ def _createBoxIndexed(recentPostsCache: {},
|
|||
timelineNickname = 'news'
|
||||
|
||||
originalDomain = domain
|
||||
domain = getFullDomain(domain, port)
|
||||
domain = get_full_domain(domain, port)
|
||||
|
||||
boxActor = local_actor_url(http_prefix, nickname, domain)
|
||||
|
||||
|
@ -4088,7 +4088,7 @@ def getPublicPostsOfPerson(base_dir: str, nickname: str, domain: str,
|
|||
if nickname.startswith('!'):
|
||||
nickname = nickname[1:]
|
||||
group_account = True
|
||||
domain_full = getFullDomain(domain, port)
|
||||
domain_full = get_full_domain(domain, port)
|
||||
handle = http_prefix + "://" + domain_full + "/@" + nickname
|
||||
|
||||
wfRequest = \
|
||||
|
@ -4146,7 +4146,7 @@ def getPublicPostDomains(session, base_dir: str, nickname: str, domain: str,
|
|||
cached_webfingers = {}
|
||||
federation_list = []
|
||||
|
||||
domain_full = getFullDomain(domain, port)
|
||||
domain_full = get_full_domain(domain, port)
|
||||
handle = http_prefix + "://" + domain_full + "/@" + nickname
|
||||
wfRequest = \
|
||||
webfingerHandle(session, handle, http_prefix, cached_webfingers,
|
||||
|
@ -4242,7 +4242,7 @@ def getPublicPostInfo(session, base_dir: str, nickname: str, domain: str,
|
|||
cached_webfingers = {}
|
||||
federation_list = []
|
||||
|
||||
domain_full = getFullDomain(domain, port)
|
||||
domain_full = get_full_domain(domain, port)
|
||||
handle = http_prefix + "://" + domain_full + "/@" + nickname
|
||||
wfRequest = \
|
||||
webfingerHandle(session, handle, http_prefix, cached_webfingers,
|
||||
|
@ -4725,7 +4725,8 @@ def downloadAnnounce(session, base_dir: str, http_prefix: str,
|
|||
attributedDomain, attributedPort = \
|
||||
getDomainFromActor(announcedJson['object']['id'])
|
||||
if attributedNickname and attributedDomain:
|
||||
attributedDomain = getFullDomain(attributedDomain, attributedPort)
|
||||
attributedDomain = \
|
||||
get_full_domain(attributedDomain, attributedPort)
|
||||
if isBlocked(base_dir, nickname, domain,
|
||||
attributedNickname, attributedDomain):
|
||||
_rejectAnnounce(announceFilename,
|
||||
|
@ -4772,7 +4773,7 @@ def sendBlockViaServer(base_dir: str, session,
|
|||
print('WARN: No session for sendBlockViaServer')
|
||||
return 6
|
||||
|
||||
fromDomainFull = getFullDomain(fromDomain, fromPort)
|
||||
fromDomainFull = get_full_domain(fromDomain, fromPort)
|
||||
|
||||
blockActor = local_actor_url(http_prefix, fromNickname, fromDomainFull)
|
||||
toUrl = 'https://www.w3.org/ns/activitystreams#Public'
|
||||
|
@ -4856,7 +4857,7 @@ def sendMuteViaServer(base_dir: str, session,
|
|||
print('WARN: No session for sendMuteViaServer')
|
||||
return 6
|
||||
|
||||
fromDomainFull = getFullDomain(fromDomain, fromPort)
|
||||
fromDomainFull = get_full_domain(fromDomain, fromPort)
|
||||
|
||||
actor = local_actor_url(http_prefix, fromNickname, fromDomainFull)
|
||||
handle = replaceUsersWithAt(actor)
|
||||
|
@ -4936,7 +4937,7 @@ def sendUndoMuteViaServer(base_dir: str, session,
|
|||
print('WARN: No session for sendUndoMuteViaServer')
|
||||
return 6
|
||||
|
||||
fromDomainFull = getFullDomain(fromDomain, fromPort)
|
||||
fromDomainFull = get_full_domain(fromDomain, fromPort)
|
||||
|
||||
actor = local_actor_url(http_prefix, fromNickname, fromDomainFull)
|
||||
handle = replaceUsersWithAt(actor)
|
||||
|
@ -5022,7 +5023,7 @@ def sendUndoBlockViaServer(base_dir: str, session,
|
|||
print('WARN: No session for sendBlockViaServer')
|
||||
return 6
|
||||
|
||||
fromDomainFull = getFullDomain(fromDomain, fromPort)
|
||||
fromDomainFull = get_full_domain(fromDomain, fromPort)
|
||||
|
||||
blockActor = local_actor_url(http_prefix, fromNickname, fromDomainFull)
|
||||
toUrl = 'https://www.w3.org/ns/activitystreams#Public'
|
||||
|
@ -5139,7 +5140,7 @@ def c2sBoxJson(base_dir: str, session,
|
|||
print('WARN: No session for c2sBoxJson')
|
||||
return None
|
||||
|
||||
domain_full = getFullDomain(domain, port)
|
||||
domain_full = get_full_domain(domain, port)
|
||||
actor = local_actor_url(http_prefix, nickname, domain_full)
|
||||
|
||||
authHeader = createBasicAuthHeader(nickname, password)
|
||||
|
|
10
reaction.py
10
reaction.py
|
@ -17,7 +17,7 @@ from utils import hasObjectStringType
|
|||
from utils import removeDomainPort
|
||||
from utils import has_object_dict
|
||||
from utils import has_users_path
|
||||
from utils import getFullDomain
|
||||
from utils import get_full_domain
|
||||
from utils import removeIdEnding
|
||||
from utils import urlPermitted
|
||||
from utils import getNicknameFromActor
|
||||
|
@ -82,7 +82,7 @@ def _reaction(recentPostsCache: {},
|
|||
print('_reaction: Invalid emoji reaction: "' + emojiContent + '"')
|
||||
return
|
||||
|
||||
fullDomain = getFullDomain(domain, port)
|
||||
fullDomain = get_full_domain(domain, port)
|
||||
|
||||
newReactionJson = {
|
||||
"@context": "https://www.w3.org/ns/activitystreams",
|
||||
|
@ -158,7 +158,7 @@ def reactionPost(recentPostsCache: {},
|
|||
signing_priv_key_pem: str) -> {}:
|
||||
"""Adds a reaction to a given status post. This is only used by unit tests
|
||||
"""
|
||||
reactionDomain = getFullDomain(reactionDomain, reactionPort)
|
||||
reactionDomain = get_full_domain(reactionDomain, reactionPort)
|
||||
|
||||
actorReaction = \
|
||||
local_actor_url(http_prefix, reactionNickname, reactionDomain)
|
||||
|
@ -191,7 +191,7 @@ def sendReactionViaServer(base_dir: str, session,
|
|||
emojiContent + '"')
|
||||
return 7
|
||||
|
||||
fromDomainFull = getFullDomain(fromDomain, fromPort)
|
||||
fromDomainFull = get_full_domain(fromDomain, fromPort)
|
||||
|
||||
actor = local_actor_url(http_prefix, fromNickname, fromDomainFull)
|
||||
|
||||
|
@ -277,7 +277,7 @@ def sendUndoReactionViaServer(base_dir: str, session,
|
|||
print('WARN: No session for sendUndoReactionViaServer')
|
||||
return 6
|
||||
|
||||
fromDomainFull = getFullDomain(fromDomain, fromPort)
|
||||
fromDomainFull = get_full_domain(fromDomain, fromPort)
|
||||
|
||||
actor = local_actor_url(http_prefix, fromNickname, fromDomainFull)
|
||||
|
||||
|
|
20
shares.py
20
shares.py
|
@ -26,7 +26,7 @@ from utils import hasObjectStringType
|
|||
from utils import dateStringToSeconds
|
||||
from utils import dateSecondsToString
|
||||
from utils import getConfigParam
|
||||
from utils import getFullDomain
|
||||
from utils import get_full_domain
|
||||
from utils import validNickname
|
||||
from utils import loadJson
|
||||
from utils import saveJson
|
||||
|
@ -326,7 +326,7 @@ def addShare(base_dir: str,
|
|||
published = int(time.time())
|
||||
durationSec = _addShareDurationSec(duration, published)
|
||||
|
||||
domain_full = getFullDomain(domain, port)
|
||||
domain_full = get_full_domain(domain, port)
|
||||
actor = local_actor_url(http_prefix, nickname, domain_full)
|
||||
itemID = _getValidSharedItemID(actor, displayName)
|
||||
dfcId = _getshareDfcId(base_dir, system_language,
|
||||
|
@ -345,7 +345,7 @@ def addShare(base_dir: str,
|
|||
imageFilename = sharesImageFilename + '.' + ext
|
||||
moveImage = True
|
||||
|
||||
domain_full = getFullDomain(domain, port)
|
||||
domain_full = get_full_domain(domain, port)
|
||||
|
||||
# copy or move the image for the shared item to its destination
|
||||
if imageFilename:
|
||||
|
@ -486,7 +486,7 @@ def getSharesFeedForPerson(base_dir: str,
|
|||
if not validNickname(domain, nickname):
|
||||
return None
|
||||
|
||||
domain = getFullDomain(domain, port)
|
||||
domain = get_full_domain(domain, port)
|
||||
|
||||
handleDomain = removeDomainPort(domain)
|
||||
sharesFilename = \
|
||||
|
@ -576,7 +576,7 @@ def sendShareViaServer(base_dir, session,
|
|||
if newItemCurrency != itemCurrency:
|
||||
itemCurrency = newItemCurrency
|
||||
|
||||
fromDomainFull = getFullDomain(fromDomain, fromPort)
|
||||
fromDomainFull = get_full_domain(fromDomain, fromPort)
|
||||
|
||||
actor = local_actor_url(http_prefix, fromNickname, fromDomainFull)
|
||||
toUrl = 'https://www.w3.org/ns/activitystreams#Public'
|
||||
|
@ -689,7 +689,7 @@ def sendUndoShareViaServer(base_dir: str, session,
|
|||
print('WARN: No session for sendUndoShareViaServer')
|
||||
return 6
|
||||
|
||||
fromDomainFull = getFullDomain(fromDomain, fromPort)
|
||||
fromDomainFull = get_full_domain(fromDomain, fromPort)
|
||||
|
||||
actor = local_actor_url(http_prefix, fromNickname, fromDomainFull)
|
||||
toUrl = 'https://www.w3.org/ns/activitystreams#Public'
|
||||
|
@ -796,7 +796,7 @@ def sendWantedViaServer(base_dir, session,
|
|||
if newItemCurrency != itemCurrency:
|
||||
itemCurrency = newItemCurrency
|
||||
|
||||
fromDomainFull = getFullDomain(fromDomain, fromPort)
|
||||
fromDomainFull = get_full_domain(fromDomain, fromPort)
|
||||
|
||||
actor = local_actor_url(http_prefix, fromNickname, fromDomainFull)
|
||||
toUrl = 'https://www.w3.org/ns/activitystreams#Public'
|
||||
|
@ -909,7 +909,7 @@ def sendUndoWantedViaServer(base_dir: str, session,
|
|||
print('WARN: No session for sendUndoWantedViaServer')
|
||||
return 6
|
||||
|
||||
fromDomainFull = getFullDomain(fromDomain, fromPort)
|
||||
fromDomainFull = get_full_domain(fromDomain, fromPort)
|
||||
|
||||
actor = local_actor_url(http_prefix, fromNickname, fromDomainFull)
|
||||
toUrl = 'https://www.w3.org/ns/activitystreams#Public'
|
||||
|
@ -1010,7 +1010,7 @@ def getSharedItemsCatalogViaServer(base_dir, session,
|
|||
'Authorization': authHeader,
|
||||
'Accept': 'application/json'
|
||||
}
|
||||
domain_full = getFullDomain(domain, port)
|
||||
domain_full = get_full_domain(domain, port)
|
||||
url = local_actor_url(http_prefix, nickname, domain_full) + '/catalog'
|
||||
if debug:
|
||||
print('Shared items catalog request to: ' + url)
|
||||
|
@ -1118,7 +1118,7 @@ def outboxUndoShareUpload(base_dir: str, http_prefix: str,
|
|||
if debug:
|
||||
print('DEBUG: displayName missing from Offer')
|
||||
return
|
||||
domain_full = getFullDomain(domain, port)
|
||||
domain_full = get_full_domain(domain, port)
|
||||
removeSharedItem(base_dir, nickname, domain,
|
||||
message_json['object']['displayName'],
|
||||
http_prefix, domain_full, 'shares')
|
||||
|
|
|
@ -13,7 +13,7 @@ from auth import createBasicAuthHeader
|
|||
from posts import getPersonBox
|
||||
from session import postJson
|
||||
from utils import hasObjectString
|
||||
from utils import getFullDomain
|
||||
from utils import get_full_domain
|
||||
from utils import getNicknameFromActor
|
||||
from utils import getDomainFromActor
|
||||
from utils import loadJson
|
||||
|
@ -185,7 +185,7 @@ def sendSkillViaServer(base_dir: str, session, nickname: str, password: str,
|
|||
print('WARN: No session for sendSkillViaServer')
|
||||
return 6
|
||||
|
||||
domain_full = getFullDomain(domain, port)
|
||||
domain_full = get_full_domain(domain, port)
|
||||
|
||||
actor = local_actor_url(http_prefix, nickname, domain_full)
|
||||
toUrl = actor
|
||||
|
|
|
@ -11,7 +11,7 @@ from session import createSession
|
|||
from webfinger import webfingerHandle
|
||||
from posts import getPersonBox
|
||||
from posts import getPostDomains
|
||||
from utils import getFullDomain
|
||||
from utils import get_full_domain
|
||||
|
||||
|
||||
def instancesGraph(base_dir: str, handles: str,
|
||||
|
@ -49,7 +49,7 @@ def instancesGraph(base_dir: str, handles: str,
|
|||
nickname = handle.split('@')[0]
|
||||
domain = handle.split('@')[1]
|
||||
|
||||
domain_full = getFullDomain(domain, port)
|
||||
domain_full = get_full_domain(domain, port)
|
||||
handle = http_prefix + "://" + domain_full + "/@" + nickname
|
||||
wfRequest = \
|
||||
webfingerHandle(session, handle, http_prefix,
|
||||
|
|
8
tests.py
8
tests.py
|
@ -69,7 +69,7 @@ from utils import validPassword
|
|||
from utils import userAgentDomain
|
||||
from utils import camelCaseSplit
|
||||
from utils import decoded_host
|
||||
from utils import getFullDomain
|
||||
from utils import get_full_domain
|
||||
from utils import validNickname
|
||||
from utils import firstParagraphFromString
|
||||
from utils import removeIdEnding
|
||||
|
@ -270,7 +270,7 @@ def _testHttpSignedGET(base_dir: str):
|
|||
assert publicKeyPem
|
||||
messageBodyJsonStr = ''
|
||||
|
||||
headersDomain = getFullDomain(hostDomain, port)
|
||||
headersDomain = get_full_domain(hostDomain, port)
|
||||
|
||||
dateStr = 'Tue, 14 Sep 2021 16:19:00 GMT'
|
||||
boxpath = '/inbox'
|
||||
|
@ -555,7 +555,7 @@ def _testHttpsigBase(withDigest: bool, base_dir: str):
|
|||
else:
|
||||
messageBodyJsonStr = ''
|
||||
|
||||
headersDomain = getFullDomain(hostDomain, port)
|
||||
headersDomain = get_full_domain(hostDomain, port)
|
||||
|
||||
dateStr = strftime("%a, %d %b %Y %H:%M:%S %Z", gmtime())
|
||||
boxpath = '/inbox'
|
||||
|
@ -5939,7 +5939,7 @@ def _testHttpsigBaseNew(withDigest: bool, base_dir: str,
|
|||
else:
|
||||
messageBodyJsonStr = ''
|
||||
|
||||
headersDomain = getFullDomain(hostDomain, port)
|
||||
headersDomain = get_full_domain(hostDomain, port)
|
||||
|
||||
dateStr = strftime("%a, %d %b %Y %H:%M:%S %Z", gmtime())
|
||||
boxpath = '/inbox'
|
||||
|
|
10
utils.py
10
utils.py
|
@ -228,22 +228,22 @@ def valid_post_date(published: str, max_age_days: int, debug: bool) -> bool:
|
|||
str(published))
|
||||
return False
|
||||
|
||||
daysDiff = post_time_object - baseline_time
|
||||
postDaysSinceEpoch = daysDiff.days
|
||||
days_diff = post_time_object - baseline_time
|
||||
post_days_since_epoch = days_diff.days
|
||||
|
||||
if postDaysSinceEpoch > now_days_since_epoch:
|
||||
if post_days_since_epoch > now_days_since_epoch:
|
||||
if debug:
|
||||
print("Inbox post has a published date in the future!")
|
||||
return False
|
||||
|
||||
if now_days_since_epoch - postDaysSinceEpoch >= max_age_days:
|
||||
if now_days_since_epoch - post_days_since_epoch >= max_age_days:
|
||||
if debug:
|
||||
print("Inbox post is not recent enough")
|
||||
return False
|
||||
return True
|
||||
|
||||
|
||||
def getFullDomain(domain: str, port: int) -> str:
|
||||
def get_full_domain(domain: str, port: int) -> str:
|
||||
"""Returns the full domain name, including port number
|
||||
"""
|
||||
if not port:
|
||||
|
|
4
video.py
4
video.py
|
@ -7,7 +7,7 @@ __email__ = "bob@libreserver.org"
|
|||
__status__ = "Production"
|
||||
__module_group__ = "Timeline"
|
||||
|
||||
from utils import getFullDomain
|
||||
from utils import get_full_domain
|
||||
from utils import getNicknameFromActor
|
||||
from utils import getDomainFromActor
|
||||
from utils import removeIdEnding
|
||||
|
@ -67,7 +67,7 @@ def convertVideoToNote(base_dir: str, nickname: str, domain: str,
|
|||
postDomain, postDomainPort = getDomainFromActor(attributedTo)
|
||||
if not postDomain:
|
||||
return None
|
||||
postDomainFull = getFullDomain(postDomain, postDomainPort)
|
||||
postDomainFull = get_full_domain(postDomain, postDomainPort)
|
||||
if isBlocked(base_dir, nickname, domain,
|
||||
postNickname, postDomainFull, blockedCache):
|
||||
return None
|
||||
|
|
|
@ -9,7 +9,7 @@ __module_group__ = "Web Interface"
|
|||
|
||||
import os
|
||||
from shutil import copyfile
|
||||
from utils import getFullDomain
|
||||
from utils import get_full_domain
|
||||
from utils import getNicknameFromActor
|
||||
from utils import getDomainFromActor
|
||||
from utils import locatePost
|
||||
|
@ -45,7 +45,7 @@ def htmlConfirmDelete(cssCache: {},
|
|||
actor = messageId.split('/statuses/')[0]
|
||||
nickname = getNicknameFromActor(actor)
|
||||
domain, port = getDomainFromActor(actor)
|
||||
domain_full = getFullDomain(domain, port)
|
||||
domain_full = get_full_domain(domain, port)
|
||||
|
||||
postFilename = locatePost(base_dir, nickname, domain, messageId)
|
||||
if not postFilename:
|
||||
|
@ -114,7 +114,7 @@ def htmlConfirmRemoveSharedItem(cssCache: {}, translate: {}, base_dir: str,
|
|||
"""
|
||||
nickname = getNicknameFromActor(actor)
|
||||
domain, port = getDomainFromActor(actor)
|
||||
domain_full = getFullDomain(domain, port)
|
||||
domain_full = get_full_domain(domain, port)
|
||||
sharesFile = \
|
||||
acct_dir(base_dir, nickname, domain) + '/' + sharesFileType + '.json'
|
||||
if not os.path.isfile(sharesFile):
|
||||
|
|
|
@ -10,7 +10,7 @@ __module_group__ = "Moderation"
|
|||
import os
|
||||
from utils import isArtist
|
||||
from utils import isAccountDir
|
||||
from utils import getFullDomain
|
||||
from utils import get_full_domain
|
||||
from utils import isEditor
|
||||
from utils import loadJson
|
||||
from utils import getNicknameFromActor
|
||||
|
@ -143,7 +143,7 @@ def htmlAccountInfo(cssCache: {}, translate: {},
|
|||
for followerActor in followersList:
|
||||
followerNickname = getNicknameFromActor(followerActor)
|
||||
followerDomain, followerPort = getDomainFromActor(followerActor)
|
||||
followerDomainFull = getFullDomain(followerDomain, followerPort)
|
||||
followerDomainFull = get_full_domain(followerDomain, followerPort)
|
||||
if isBlocked(base_dir, nickname, domain,
|
||||
followerNickname, followerDomainFull):
|
||||
blockedFollowers.append(followerActor)
|
||||
|
@ -157,7 +157,7 @@ def htmlAccountInfo(cssCache: {}, translate: {},
|
|||
for followingActor in followingList:
|
||||
followingNickname = getNicknameFromActor(followingActor)
|
||||
followingDomain, followingPort = getDomainFromActor(followingActor)
|
||||
followingDomainFull = getFullDomain(followingDomain, followingPort)
|
||||
followingDomainFull = get_full_domain(followingDomain, followingPort)
|
||||
if isBlocked(base_dir, nickname, domain,
|
||||
followingNickname, followingDomainFull):
|
||||
blockedFollowing.append(followingActor)
|
||||
|
@ -219,7 +219,7 @@ def htmlAccountInfo(cssCache: {}, translate: {},
|
|||
followingNickname = getNicknameFromActor(actor)
|
||||
followingDomain, followingPort = getDomainFromActor(actor)
|
||||
followingDomainFull = \
|
||||
getFullDomain(followingDomain, followingPort)
|
||||
get_full_domain(followingDomain, followingPort)
|
||||
infoForm += '<a href="' + actor + '" ' + \
|
||||
'target="_blank" rel="nofollow noopener noreferrer">' + \
|
||||
followingNickname + '@' + followingDomainFull + \
|
||||
|
@ -237,7 +237,7 @@ def htmlAccountInfo(cssCache: {}, translate: {},
|
|||
for actor in blockedFollowers:
|
||||
followerNickname = getNicknameFromActor(actor)
|
||||
followerDomain, followerPort = getDomainFromActor(actor)
|
||||
followerDomainFull = getFullDomain(followerDomain, followerPort)
|
||||
followerDomainFull = get_full_domain(followerDomain, followerPort)
|
||||
infoForm += '<a href="' + actor + '" ' + \
|
||||
'target="_blank" rel="nofollow noopener noreferrer">' + \
|
||||
followerNickname + '@' + followerDomainFull + '</a><br><br>\n'
|
||||
|
|
|
@ -12,7 +12,7 @@ from shutil import copyfile
|
|||
from petnames import getPetName
|
||||
from person import isPersonSnoozed
|
||||
from posts import isModerator
|
||||
from utils import getFullDomain
|
||||
from utils import get_full_domain
|
||||
from utils import getConfigParam
|
||||
from utils import isDormant
|
||||
from utils import removeHtml
|
||||
|
@ -66,7 +66,7 @@ def htmlPersonOptions(defaultTimeline: str,
|
|||
"""Show options for a person: view/follow/block/report
|
||||
"""
|
||||
optionsDomain, optionsPort = getDomainFromActor(optionsActor)
|
||||
optionsDomainFull = getFullDomain(optionsDomain, optionsPort)
|
||||
optionsDomainFull = get_full_domain(optionsDomain, optionsPort)
|
||||
|
||||
if os.path.isfile(base_dir + '/accounts/options-background-custom.jpg'):
|
||||
if not os.path.isfile(base_dir + '/accounts/options-background.jpg'):
|
||||
|
@ -97,7 +97,7 @@ def htmlPersonOptions(defaultTimeline: str,
|
|||
dormant_months)
|
||||
|
||||
optionsNickname = getNicknameFromActor(optionsActor)
|
||||
optionsDomainFull = getFullDomain(optionsDomain, optionsPort)
|
||||
optionsDomainFull = get_full_domain(optionsDomain, optionsPort)
|
||||
followsYou = \
|
||||
isFollowerOfPerson(base_dir,
|
||||
nickname, domain,
|
||||
|
|
|
@ -35,7 +35,7 @@ from utils import isDM
|
|||
from utils import rejectPostId
|
||||
from utils import isRecentPost
|
||||
from utils import getConfigParam
|
||||
from utils import getFullDomain
|
||||
from utils import get_full_domain
|
||||
from utils import isEditor
|
||||
from utils import locatePost
|
||||
from utils import loadJson
|
||||
|
@ -1381,7 +1381,7 @@ def individualPostAsHtml(signing_priv_key_pem: str,
|
|||
if messageId:
|
||||
messageIdStr = ';' + messageId
|
||||
|
||||
domain_full = getFullDomain(domain, port)
|
||||
domain_full = get_full_domain(domain, port)
|
||||
|
||||
pageNumberParam = ''
|
||||
if pageNumber:
|
||||
|
@ -1426,7 +1426,7 @@ def individualPostAsHtml(signing_priv_key_pem: str,
|
|||
# lookup the correct webfinger for the postActor
|
||||
postActorNickname = getNicknameFromActor(postActor)
|
||||
postActorDomain, postActorPort = getDomainFromActor(postActor)
|
||||
postActorDomainFull = getFullDomain(postActorDomain, postActorPort)
|
||||
postActorDomainFull = get_full_domain(postActorDomain, postActorPort)
|
||||
postActorHandle = postActorNickname + '@' + postActorDomainFull
|
||||
postActorWf = \
|
||||
webfingerHandle(session, postActorHandle, http_prefix,
|
||||
|
@ -1848,7 +1848,7 @@ def individualPostAsHtml(signing_priv_key_pem: str,
|
|||
post_json_object['object']['contentMap'][system_language] = \
|
||||
post_json_object['object']['content']
|
||||
|
||||
domain_full = getFullDomain(domain, port)
|
||||
domain_full = get_full_domain(domain, port)
|
||||
personUrl = local_actor_url(http_prefix, nickname, domain_full)
|
||||
actor_json = \
|
||||
getPersonFromCache(base_dir, personUrl, person_cache, False)
|
||||
|
@ -2025,7 +2025,7 @@ def htmlIndividualPost(cssCache: {},
|
|||
if byStr:
|
||||
byStrNickname = getNicknameFromActor(byStr)
|
||||
byStrDomain, byStrPort = getDomainFromActor(byStr)
|
||||
byStrDomain = getFullDomain(byStrDomain, byStrPort)
|
||||
byStrDomain = get_full_domain(byStrDomain, byStrPort)
|
||||
byStrHandle = byStrNickname + '@' + byStrDomain
|
||||
if translate.get(byText):
|
||||
byText = translate[byText]
|
||||
|
@ -2033,7 +2033,7 @@ def htmlIndividualPost(cssCache: {},
|
|||
'<p>' + byText + ' <a href="' + byStr + '">@' + \
|
||||
byStrHandle + '</a>' + byTextExtra + '\n'
|
||||
|
||||
domain_full = getFullDomain(domain, port)
|
||||
domain_full = get_full_domain(domain, port)
|
||||
actor = '/users/' + nickname
|
||||
followStr = ' <form method="POST" ' + \
|
||||
'accept-charset="UTF-8" action="' + actor + '/searchhandle">\n'
|
||||
|
|
|
@ -15,7 +15,7 @@ from utils import isGroupAccount
|
|||
from utils import has_object_dict
|
||||
from utils import getOccupationName
|
||||
from utils import get_locked_account
|
||||
from utils import getFullDomain
|
||||
from utils import get_full_domain
|
||||
from utils import isArtist
|
||||
from utils import isDormant
|
||||
from utils import getNicknameFromActor
|
||||
|
@ -162,7 +162,7 @@ def htmlProfileAfterSearch(cssCache: {},
|
|||
searchNickname = getNicknameFromActor(personUrl)
|
||||
if not searchNickname:
|
||||
return None
|
||||
searchDomainFull = getFullDomain(searchDomain, searchPort)
|
||||
searchDomainFull = get_full_domain(searchDomain, searchPort)
|
||||
|
||||
profileStr = ''
|
||||
cssFilename = base_dir + '/epicyon-profile.css'
|
||||
|
@ -271,7 +271,7 @@ def htmlProfileAfterSearch(cssCache: {},
|
|||
alsoKnownAs, accessKeys,
|
||||
joinedDate)
|
||||
|
||||
domain_full = getFullDomain(domain, port)
|
||||
domain_full = get_full_domain(domain, port)
|
||||
|
||||
followIsPermitted = True
|
||||
if not profile_json.get('followers'):
|
||||
|
@ -409,7 +409,7 @@ def _getProfileHeader(base_dir: str, http_prefix: str,
|
|||
if movedTo:
|
||||
newNickname = getNicknameFromActor(movedTo)
|
||||
newDomain, newPort = getDomainFromActor(movedTo)
|
||||
newDomainFull = getFullDomain(newDomain, newPort)
|
||||
newDomainFull = get_full_domain(newDomain, newPort)
|
||||
if newNickname and newDomain:
|
||||
htmlStr += \
|
||||
' <p>' + translate['New account'] + ': ' + \
|
||||
|
@ -503,7 +503,7 @@ def _getProfileHeaderAfterSearch(base_dir: str,
|
|||
if movedTo:
|
||||
newNickname = getNicknameFromActor(movedTo)
|
||||
newDomain, newPort = getDomainFromActor(movedTo)
|
||||
newDomainFull = getFullDomain(newDomain, newPort)
|
||||
newDomainFull = get_full_domain(newDomain, newPort)
|
||||
if newNickname and newDomain:
|
||||
newHandle = newNickname + '@' + newDomainFull
|
||||
htmlStr += ' <p>' + translate['New account'] + \
|
||||
|
@ -596,7 +596,7 @@ def htmlProfile(signing_priv_key_pem: str,
|
|||
addEmojiToDisplayName(session, base_dir, http_prefix,
|
||||
nickname, domain,
|
||||
profile_json['name'], True)
|
||||
domain_full = getFullDomain(domain, port)
|
||||
domain_full = get_full_domain(domain, port)
|
||||
profileDescription = \
|
||||
addEmojiToDisplayName(session, base_dir, http_prefix,
|
||||
nickname, domain,
|
||||
|
@ -2105,7 +2105,7 @@ def htmlEditProfile(cssCache: {}, translate: {}, base_dir: str, path: str,
|
|||
nickname = getNicknameFromActor(path)
|
||||
if not nickname:
|
||||
return ''
|
||||
domain_full = getFullDomain(domain, port)
|
||||
domain_full = get_full_domain(domain, port)
|
||||
|
||||
actorFilename = acct_dir(base_dir, nickname, domain) + '.json'
|
||||
if not os.path.isfile(actorFilename):
|
||||
|
@ -2355,7 +2355,7 @@ def _individualFollowAsHtml(signing_priv_key_pem: str,
|
|||
"""
|
||||
followUrlNickname = getNicknameFromActor(followUrl)
|
||||
followUrlDomain, followUrlPort = getDomainFromActor(followUrl)
|
||||
followUrlDomainFull = getFullDomain(followUrlDomain, followUrlPort)
|
||||
followUrlDomainFull = get_full_domain(followUrlDomain, followUrlPort)
|
||||
titleStr = '@' + followUrlNickname + '@' + followUrlDomainFull
|
||||
avatarUrl = getPersonAvatarUrl(base_dir, followUrl, person_cache, True)
|
||||
if not avatarUrl:
|
||||
|
|
|
@ -14,7 +14,7 @@ from datetime import datetime
|
|||
from utils import get_base_content_from_post
|
||||
from utils import isAccountDir
|
||||
from utils import getConfigParam
|
||||
from utils import getFullDomain
|
||||
from utils import get_full_domain
|
||||
from utils import isEditor
|
||||
from utils import loadJson
|
||||
from utils import getDomainFromActor
|
||||
|
@ -629,7 +629,7 @@ def htmlHistorySearch(cssCache: {}, translate: {}, base_dir: str,
|
|||
htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None)
|
||||
|
||||
# add the page title
|
||||
domain_full = getFullDomain(domain, port)
|
||||
domain_full = get_full_domain(domain, port)
|
||||
actor = local_actor_url(http_prefix, nickname, domain_full)
|
||||
historySearchTitle = '🔍 ' + translate['Your Posts']
|
||||
if boxName == 'bookmarks':
|
||||
|
@ -933,7 +933,7 @@ def rssHashtagSearch(nickname: str, domain: str, port: int,
|
|||
if not lines:
|
||||
return None
|
||||
|
||||
domain_full = getFullDomain(domain, port)
|
||||
domain_full = get_full_domain(domain, port)
|
||||
|
||||
maxFeedLength = 10
|
||||
hashtagFeed = \
|
||||
|
|
|
@ -13,7 +13,7 @@ from shutil import copyfile
|
|||
from utils import isArtist
|
||||
from utils import dangerousMarkup
|
||||
from utils import getConfigParam
|
||||
from utils import getFullDomain
|
||||
from utils import get_full_domain
|
||||
from utils import isEditor
|
||||
from utils import removeIdEnding
|
||||
from utils import acct_dir
|
||||
|
@ -611,7 +611,7 @@ def htmlTimeline(cssCache: {}, defaultTimeline: str,
|
|||
bookmarksButton = 'buttonselected'
|
||||
|
||||
# get the full domain, including any port number
|
||||
fullDomain = getFullDomain(domain, port)
|
||||
fullDomain = get_full_domain(domain, port)
|
||||
|
||||
usersPath = '/users/' + nickname
|
||||
actor = http_prefix + '://' + fullDomain + usersPath
|
||||
|
@ -741,7 +741,7 @@ def htmlTimeline(cssCache: {}, defaultTimeline: str,
|
|||
' <tbody>\n' + \
|
||||
' <tr>\n'
|
||||
|
||||
domain_full = getFullDomain(domain, port)
|
||||
domain_full = get_full_domain(domain, port)
|
||||
|
||||
# left column
|
||||
leftColumnStr = \
|
||||
|
@ -1053,7 +1053,7 @@ def _htmlSharesTimeline(translate: {}, pageNumber: int, itemsPerPage: int,
|
|||
sharesTimelineJson(actor, pageNumber, itemsPerPage,
|
||||
base_dir, domain, nickname, maxSharesPerAccount,
|
||||
shared_items_federated_domains, sharesFileType)
|
||||
domain_full = getFullDomain(domain, port)
|
||||
domain_full = get_full_domain(domain, port)
|
||||
actor = local_actor_url(http_prefix, nickname, domain_full)
|
||||
adminNickname = getConfigParam(base_dir, 'admin')
|
||||
adminActor = ''
|
||||
|
|
|
@ -12,7 +12,7 @@ import urllib.parse
|
|||
from session import getJson
|
||||
from cache import storeWebfingerInCache
|
||||
from cache import getWebfingerFromCache
|
||||
from utils import getFullDomain
|
||||
from utils import get_full_domain
|
||||
from utils import loadJson
|
||||
from utils import loadJsonOnionify
|
||||
from utils import saveJson
|
||||
|
@ -116,7 +116,7 @@ def storeWebfingerEndpoint(nickname: str, domain: str, port: int,
|
|||
"""Stores webfinger endpoint for a user to a file
|
||||
"""
|
||||
originalDomain = domain
|
||||
domain = getFullDomain(domain, port)
|
||||
domain = get_full_domain(domain, port)
|
||||
handle = nickname + '@' + domain
|
||||
wfSubdir = '/wfendpoints'
|
||||
if not os.path.isdir(base_dir + wfSubdir):
|
||||
|
@ -136,7 +136,7 @@ def createWebfingerEndpoint(nickname: str, domain: str, port: int,
|
|||
"""Creates a webfinger endpoint for a user
|
||||
"""
|
||||
originalDomain = domain
|
||||
domain = getFullDomain(domain, port)
|
||||
domain = get_full_domain(domain, port)
|
||||
|
||||
personName = nickname
|
||||
personId = local_actor_url(http_prefix, personName, domain)
|
||||
|
@ -244,7 +244,7 @@ def webfingerLookup(path: str, base_dir: str,
|
|||
if debug:
|
||||
print('DEBUG: WEBFINGER no @ in handle ' + handle)
|
||||
return None
|
||||
handle = getFullDomain(handle, port)
|
||||
handle = get_full_domain(handle, port)
|
||||
# convert @domain@domain to inbox@domain
|
||||
if '@' in handle:
|
||||
handleDomain = handle.split('@')[1]
|
||||
|
|
Loading…
Reference in New Issue