Merge branch 'main' of ssh://code.freedombone.net:2222/bashrc/epicyon

main
Bob Mottram 2021-02-17 14:36:50 +00:00
commit 219211794b
5 changed files with 34 additions and 9 deletions

View File

@ -3,6 +3,6 @@ image: debian:testing
test: test:
script: script:
- apt-get update - apt-get update
- apt-get install -y python3-crypto python3-dateutil python3-idna python3-numpy python3-pil.imagetk python3-pycryptodome python3-requests python3-socks python3-setuptools python3-pyqrcode - apt-get install -y python3-cryptography python3-dateutil python3-idna python3-numpy python3-pil.imagetk python3-requests python3-socks python3-setuptools python3-pyqrcode
- python3 epicyon.py --tests - python3 epicyon.py --tests
- python3 epicyon.py --testsnetwork - python3 epicyon.py --testsnetwork

View File

@ -11602,7 +11602,7 @@ class PubServer(BaseHTTPRequestHandler):
# Edit a blog post # Edit a blog post
if authorized and \ if authorized and \
'/tlblogs' in self.path and \ '/users/' in self.path and \
'?editblogpost=' in self.path and \ '?editblogpost=' in self.path and \
'?actor=' in self.path: '?actor=' in self.path:
messageId = self.path.split('?editblogpost=')[1] messageId = self.path.split('?editblogpost=')[1]
@ -11611,7 +11611,7 @@ class PubServer(BaseHTTPRequestHandler):
actor = self.path.split('?actor=')[1] actor = self.path.split('?actor=')[1]
if '?' in actor: if '?' in actor:
actor = actor.split('?')[0] actor = actor.split('?')[0]
nickname = getNicknameFromActor(self.path) nickname = getNicknameFromActor(self.path.split('?')[0])
if nickname == actor: if nickname == actor:
postUrl = \ postUrl = \
self.server.httpPrefix + '://' + \ self.server.httpPrefix + '://' + \
@ -12316,12 +12316,21 @@ class PubServer(BaseHTTPRequestHandler):
if ' boundary=' in headers['Content-Type']: if ' boundary=' in headers['Content-Type']:
if self.server.debug: if self.server.debug:
print('DEBUG: receiving POST headers ' + print('DEBUG: receiving POST headers ' +
headers['Content-Type']) headers['Content-Type'] +
' path ' + path)
nickname = None nickname = None
nicknameStr = path.split('/users/')[1] nicknameStr = path.split('/users/')[1]
if '?' in nicknameStr:
nicknameStr = nicknameStr.split('?')[0]
if '/' in nicknameStr: if '/' in nicknameStr:
nickname = nicknameStr.split('/')[0] nickname = nicknameStr.split('/')[0]
else: else:
nickname = nicknameStr
if self.server.debug:
print('DEBUG: POST nickname ' + str(nickname))
if not nickname:
print('WARN: no nickname found when receiving ' + postType +
' path ' + path)
return -1 return -1
length = int(headers['Content-Length']) length = int(headers['Content-Length'])
if length > self.server.maxPostLength: if length > self.server.maxPostLength:
@ -12402,12 +12411,15 @@ class PubServer(BaseHTTPRequestHandler):
if not fields.get('message') and \ if not fields.get('message') and \
not fields.get('imageDescription') and \ not fields.get('imageDescription') and \
not fields.get('pinToProfile'): not fields.get('pinToProfile'):
print('WARN: no message, image description or pin')
return -1 return -1
if fields.get('submitPost'): if fields.get('submitPost'):
if fields['submitPost'] != \ if fields['submitPost'] != \
self.server.translate['Submit']: self.server.translate['Submit']:
print('WARN: no submit field ' + fields['submitPost'])
return -1 return -1
else: else:
print('WARN: no submitPost')
return 2 return 2
if not fields.get('imageDescription'): if not fields.get('imageDescription'):
@ -13562,6 +13574,8 @@ class PubServer(BaseHTTPRequestHandler):
authorized) authorized)
if pageNumber: if pageNumber:
nickname = self.path.split('/users/')[1] nickname = self.path.split('/users/')[1]
if '?' in nickname:
nickname = nickname.split('?')[0]
if '/' in nickname: if '/' in nickname:
nickname = nickname.split('/')[0] nickname = nickname.split('/')[0]

View File

@ -46,7 +46,7 @@
--timeline-border-radius: 30px; --timeline-border-radius: 30px;
--focus-color: white; --focus-color: white;
--line-spacing: 130%; --line-spacing: 130%;
--header-font: 'Bedstead'; --header-font: 'Arial, Helvetica, sans-serif';
--main-link-color-hover: #bbb; --main-link-color-hover: #bbb;
} }

View File

@ -1478,7 +1478,8 @@ def createBlogPost(baseDir: str,
inReplyTo, inReplyToAtomUri, subject, inReplyTo, inReplyToAtomUri, subject,
schedulePost, schedulePost,
eventDate, eventTime, location, True) eventDate, eventTime, location, True)
blogJson['object']['url'] = \
blogJson['object']['url'].replace('/@', '/users/')
_appendCitationsToBlogPost(baseDir, nickname, domain, blogJson) _appendCitationsToBlogPost(baseDir, nickname, domain, blogJson)
return blogJson return blogJson
@ -3100,10 +3101,12 @@ def _createBoxIndexed(recentPostsCache: {},
# but have their own separate index # but have their own separate index
indexBoxName = boxname indexBoxName = boxname
timelineNickname = nickname timelineNickname = nickname
tlFeatures = False
if boxname == "tlbookmarks": if boxname == "tlbookmarks":
boxname = "bookmarks" boxname = "bookmarks"
indexBoxName = boxname indexBoxName = boxname
elif boxname == "tlfeatures": elif boxname == "tlfeatures":
tlFeatures = True
boxname = "tlblogs" boxname = "tlblogs"
indexBoxName = boxname indexBoxName = boxname
timelineNickname = 'news' timelineNickname = 'news'
@ -3226,8 +3229,8 @@ def _createBoxIndexed(recentPostsCache: {},
_addPostToTimeline(fullPostFilename, boxname, _addPostToTimeline(fullPostFilename, boxname,
postsInBox, boxActor) postsInBox, boxActor)
else: else:
# if this is the features timeline
if timelineNickname != nickname: if timelineNickname != nickname:
# if this is the features timeline
fullPostFilename = \ fullPostFilename = \
locatePost(baseDir, timelineNickname, locatePost(baseDir, timelineNickname,
domain, postUrl, False) domain, postUrl, False)
@ -3235,9 +3238,11 @@ def _createBoxIndexed(recentPostsCache: {},
_addPostToTimeline(fullPostFilename, boxname, _addPostToTimeline(fullPostFilename, boxname,
postsInBox, boxActor) postsInBox, boxActor)
else: else:
print('WARN: unable to locate post ' + postUrl) print('WARN: features timeline. ' +
'Unable to locate post ' + postUrl)
else: else:
print('WARN: unable to locate post ' + postUrl) print('WARN: Unable to locate post ' + postUrl +
' nickname ' + nickname)
postsCtr += 1 postsCtr += 1

6
setup.py 100644
View File

@ -0,0 +1,6 @@
#!/usr/bin/python3
import setuptools
if __name__ == "__main__":
setuptools.setup()