diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d6501a39a..d3e2d1587 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -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 diff --git a/daemon.py b/daemon.py index f2515ad8e..8f1dfd3aa 100644 --- a/daemon.py +++ b/daemon.py @@ -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] diff --git a/epicyon-blog.css b/epicyon-blog.css index 94caa1b5c..8c5a82e86 100644 --- a/epicyon-blog.css +++ b/epicyon-blog.css @@ -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; } diff --git a/posts.py b/posts.py index fa0d72452..d2187a04d 100644 --- a/posts.py +++ b/posts.py @@ -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 diff --git a/setup.py b/setup.py new file mode 100644 index 000000000..6819ec0fd --- /dev/null +++ b/setup.py @@ -0,0 +1,6 @@ +#!/usr/bin/python3 + +import setuptools + +if __name__ == "__main__": + setuptools.setup()