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

merge-requests/30/head
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:
script:
- 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 --testsnetwork

View File

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

View File

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

View File

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

6
setup.py 100644
View File

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