mirror of https://gitlab.com/bashrc2/epicyon
Basedir in public posts
parent
503db492e5
commit
156e36aa66
|
@ -78,7 +78,7 @@ privateKeyPem,publicKeyPem,person,wfEndpoint=createPerson(baseDir,username,domai
|
|||
#deleteAllPosts(username,domain)
|
||||
setPreferredUsername(baseDir,username,domain,'badger')
|
||||
setBio(baseDir,username,domain,'Some personal info')
|
||||
#createPublicPost(username, domain, https, "G'day world!", False, True, None, None, 'Not suitable for Vogons')
|
||||
#createPublicPost(baseDir,username, domain, https, "G'day world!", False, True, None, None, 'Not suitable for Vogons')
|
||||
#archivePosts(username,domain,baseDir,4)
|
||||
#outboxJson=createOutbox(baseDir,username,domain,port,https,2,True,None)
|
||||
#pprint(outboxJson)
|
||||
|
|
6
posts.py
6
posts.py
|
@ -311,13 +311,13 @@ def createPostBase(baseDir: str,username: str, domain: str, toUrl: str, ccUrl: s
|
|||
commentjson.dump(newPost, fp, indent=4, sort_keys=False)
|
||||
return newPost
|
||||
|
||||
def createPublicPost(username: str, domain: str, https: bool, content: str, followersOnly: bool, saveToFile: bool, inReplyTo=None, inReplyToAtomUri=None, subject=None) -> {}:
|
||||
def createPublicPost(baseDir: str,username: str, domain: str, https: bool, content: str, followersOnly: bool, saveToFile: bool, inReplyTo=None, inReplyToAtomUri=None, subject=None) -> {}:
|
||||
"""Public post to the outbox
|
||||
"""
|
||||
prefix='https'
|
||||
if not https:
|
||||
prefix='http'
|
||||
return createPostBase(username, domain, 'https://www.w3.org/ns/activitystreams#Public', prefix+'://'+domain+'/users/'+username+'/followers', https, content, followersOnly, saveToFile, inReplyTo, inReplyToAtomUri, subject)
|
||||
return createPostBase(baseDir,username, domain, 'https://www.w3.org/ns/activitystreams#Public', prefix+'://'+domain+'/users/'+username+'/followers', https, content, followersOnly, saveToFile, inReplyTo, inReplyToAtomUri, subject)
|
||||
|
||||
def threadSendPost(session,postJsonObject: {},federationList: [],inboxUrl: str,baseDir: str,signatureHeaderJson: {},postLog: []) -> None:
|
||||
"""Sends a post with exponential backoff
|
||||
|
@ -372,7 +372,7 @@ def sendPost(session,baseDir: str,username: str, domain: str, port: int, toUsern
|
|||
|
||||
print('*************Creating post')
|
||||
print('toPersonId: '+toPersonId)
|
||||
postJsonObject=createPostBase(username, domain, toPersonId, cc, https, content, followersOnly, saveToFile, inReplyTo, inReplyToAtomUri, subject)
|
||||
postJsonObject=createPostBase(baseDir,username, domain, toPersonId, cc, https, content, followersOnly, saveToFile, inReplyTo, inReplyToAtomUri, subject)
|
||||
|
||||
# get the senders private key
|
||||
privateKeyPem=getPersonKey(username,domain,baseDir,'private')
|
||||
|
|
12
tests.py
12
tests.py
|
@ -112,9 +112,9 @@ def createServerAlice(path: str,port: int):
|
|||
deleteAllPosts(username,domain,path)
|
||||
followPerson(path,username,domain,'bob','127.0.0.1:61936',federationList)
|
||||
followerOfPerson(path,username,domain,'bob','127.0.0.1:61936',federationList)
|
||||
createPublicPost(username, domain, https, "No wise fish would go anywhere without a porpoise", False, True)
|
||||
createPublicPost(username, domain, https, "Curiouser and curiouser!", False, True)
|
||||
createPublicPost(username, domain, https, "In the gardens of memory, in the palace of dreams, that is where you and I shall meet", False, True)
|
||||
createPublicPost(path,username, domain, https, "No wise fish would go anywhere without a porpoise", False, True)
|
||||
createPublicPost(path,username, domain, https, "Curiouser and curiouser!", False, True)
|
||||
createPublicPost(path,username, domain, https, "In the gardens of memory, in the palace of dreams, that is where you and I shall meet", False, True)
|
||||
global testServerAliceRunning
|
||||
testServerAliceRunning = True
|
||||
print('Server running: Alice')
|
||||
|
@ -135,9 +135,9 @@ def createServerBob(path: str,port: int):
|
|||
deleteAllPosts(username,domain,path)
|
||||
followPerson(path,username,domain,'alice','127.0.0.1:61935',federationList)
|
||||
followerOfPerson(path,username,domain,'alice','127.0.0.1:61935',federationList)
|
||||
createPublicPost(username, domain, https, "It's your life, live it your way.", False, True)
|
||||
createPublicPost(username, domain, https, "One of the things I've realised is that I am very simple", False, True)
|
||||
createPublicPost(username, domain, https, "Quantum physics is a bit of a passion of mine", False, True)
|
||||
createPublicPost(path,username, domain, https, "It's your life, live it your way.", False, True)
|
||||
createPublicPost(path,username, domain, https, "One of the things I've realised is that I am very simple", False, True)
|
||||
createPublicPost(path,username, domain, https, "Quantum physics is a bit of a passion of mine", False, True)
|
||||
global testServerBobRunning
|
||||
testServerBobRunning = True
|
||||
print('Server running: Bob')
|
||||
|
|
Loading…
Reference in New Issue