From afd5f92b997799b87c4b823203a16e00c2092dd7 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sun, 28 Feb 2021 10:22:13 +0000 Subject: [PATCH 01/18] Hacker theme banner --- theme/hacker/banner.txt | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/theme/hacker/banner.txt b/theme/hacker/banner.txt index db5cf9014..e26d52719 100644 --- a/theme/hacker/banner.txt +++ b/theme/hacker/banner.txt @@ -1,10 +1,6 @@ - 88888888888 88 - 88 "" - 88 - 88aaaaa 8b,dPPYba, 88 ,adPPYba, 8b d8 ,adPPYba, 8b,dPPYba, - 88""""" 88P' "8a 88 a8" "" `8b d8' a8" "8a 88P' `"8a - 88 88 d8 88 8b `8b d8' 8b d8 88 88 - 88 88b, ,a8" 88 "8a, ,aa `8b,d8' "8a, ,a8" 88 88 - 88888888888 88`YbbdP"' 88 `"Ybbd8"' Y88' `"YbbdP"' 88 88 - 88 d8' - 88 d8' + _____ __ _ __ _ _ E P I C Y O N + |_ _| /_/ | | /_/ _ __ ___ __ _ | |_ (_) __ _ _ _ ___ + | | / _ \ | | / _ \ | '_ ` _ \ / _` | | __| | | / _` | | | | | / _ \ + | | | __/ | | | __/ | | | | | | | (_| | | |_ | | | (_| | | |_| | | __/ + |_| \___| |_| \___| |_| |_| |_| \__,_| \__| |_| \__, | \__,_| \___| + |_| From d4e3fefda1d125b78726c919bdd04580d856c664 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sun, 28 Feb 2021 12:00:47 +0000 Subject: [PATCH 02/18] Debug --- daemon.py | 1 + 1 file changed, 1 insertion(+) diff --git a/daemon.py b/daemon.py index 0cfd5a2ca..81f5df727 100644 --- a/daemon.py +++ b/daemon.py @@ -13792,6 +13792,7 @@ class PubServer(BaseHTTPRequestHandler): "editblogpost", "newreminder", "newevent") for currPostType in postTypes: if not authorized: + print('POST was not authorized') break postRedirect = self.server.defaultTimeline From 87ca915e722a81f019f4d0cdf1a62b679df648e8 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sun, 28 Feb 2021 12:04:52 +0000 Subject: [PATCH 03/18] Debug --- daemon.py | 1 + 1 file changed, 1 insertion(+) diff --git a/daemon.py b/daemon.py index 81f5df727..fd7aef23d 100644 --- a/daemon.py +++ b/daemon.py @@ -13806,6 +13806,7 @@ class PubServer(BaseHTTPRequestHandler): callingDomain, cookie, authorized) if pageNumber: + print(currPostType + ' post received') nickname = self.path.split('/users/')[1] if '?' in nickname: nickname = nickname.split('?')[0] From 2752bddde15da223d4594cd2d3cb39f22324a886 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sun, 28 Feb 2021 12:25:32 +0000 Subject: [PATCH 04/18] Replace semicolons on outgoing posts --- outbox.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/outbox.py b/outbox.py index 11d595c6e..b95a2cd89 100644 --- a/outbox.py +++ b/outbox.py @@ -77,6 +77,13 @@ def postMessageToOutbox(messageJson: {}, postToNickname: str, if messageJson.get('object'): if isinstance(messageJson['object'], dict): if messageJson['object'].get('content'): + # replace all semicolons, because for mysterious + # reasons this appears to create a problem for + # webservers receiving the POST + if ';' in messageJson['object']['content']: + messageJson['object']['content'] = \ + messageJson['object']['content'].replace(';', ',') + if dangerousMarkup(messageJson['object']['content'], allowLocalNetworkAccess): print('POST to outbox contains dangerous markup: ' + From a7095442f453629d68d5848131a35285664089a5 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sun, 28 Feb 2021 12:34:39 +0000 Subject: [PATCH 05/18] Escape code --- outbox.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/outbox.py b/outbox.py index b95a2cd89..f45daa74a 100644 --- a/outbox.py +++ b/outbox.py @@ -77,12 +77,10 @@ def postMessageToOutbox(messageJson: {}, postToNickname: str, if messageJson.get('object'): if isinstance(messageJson['object'], dict): if messageJson['object'].get('content'): - # replace all semicolons, because for mysterious - # reasons this appears to create a problem for - # webservers receiving the POST + # semicolons are disliked, so escape them if ';' in messageJson['object']['content']: messageJson['object']['content'] = \ - messageJson['object']['content'].replace(';', ',') + messageJson['object']['content'].replace(';', '%3B') if dangerousMarkup(messageJson['object']['content'], allowLocalNetworkAccess): From 04b061e5c5c7edae258090bf2dce7dfe16ac7fd8 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sun, 28 Feb 2021 13:44:16 +0000 Subject: [PATCH 06/18] Spell check message text area --- webapp_create_post.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/webapp_create_post.py b/webapp_create_post.py index 0a682af4d..d43d64ca0 100644 --- a/webapp_create_post.py +++ b/webapp_create_post.py @@ -753,7 +753,8 @@ def htmlNewPost(cssCache: {}, mediaInstance: bool, translate: {}, newPostForm += \ ' \n' + str(messageBoxHeight) + 'px"' + selectedStr + ' spellcheck="true">' + \ + '\n' newPostForm += extraFields + citationsStr + dateAndLocation if not mediaInstance or replyStr: newPostForm += newPostImageSection From 0354674c108e032bb819973b9b488d05235320c4 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sun, 28 Feb 2021 13:52:45 +0000 Subject: [PATCH 07/18] Spell checking on text areas --- webapp_profile.py | 41 ++++++++++++++++++++++++----------------- 1 file changed, 24 insertions(+), 17 deletions(-) diff --git a/webapp_profile.py b/webapp_profile.py index dc01f0c98..4a1dff572 100644 --- a/webapp_profile.py +++ b/webapp_profile.py @@ -1260,12 +1260,12 @@ def htmlEditProfile(cssCache: {}, translate: {}, baseDir: str, path: str, if instanceDescription: instanceStr += \ ' ' else: instanceStr += \ ' ' + 'style="height:200px" spellcheck="true">' instanceStr += \ ' ' @@ -1306,7 +1306,8 @@ def htmlEditProfile(cssCache: {}, translate: {}, baseDir: str, path: str, moderatorsStr += \ ' ' + '..." style="height:200px" spellcheck="false">' + \ + moderators + '' moderatorsStr += '' editors = '' @@ -1320,7 +1321,8 @@ def htmlEditProfile(cssCache: {}, translate: {}, baseDir: str, path: str, translate['A list of editor nicknames. One per line.'] editorsStr += \ ' ' + 'style="height:200px" spellcheck="false">' + \ + editors + '' editorsStr += '' themes = getThemesList(baseDir) @@ -1369,8 +1371,8 @@ def htmlEditProfile(cssCache: {}, translate: {}, baseDir: str, path: str, peertubeInstancesStr += url + '\n' peertubeStr += \ ' \n' + 'style="height:200px" spellcheck="false">' + \ + peertubeInstancesStr + '\n' instanceTitle = \ getConfigParam(baseDir, 'instanceTitle') @@ -1429,8 +1431,8 @@ def htmlEditProfile(cssCache: {}, translate: {}, baseDir: str, path: str, editProfileForm += \ ' \n' editProfileForm += \ - ' \n' + ' \n' alsoKnownAsStr = '' if actorJson.get('alsoKnownAs'): @@ -1509,7 +1511,8 @@ def htmlEditProfile(cssCache: {}, translate: {}, baseDir: str, path: str, editProfileForm += \ ' \n' + 'style="height:100px" spellcheck="false">' + \ + PGPpubKey + '\n' editProfileForm += '
\n' @@ -1622,7 +1625,7 @@ def htmlEditProfile(cssCache: {}, translate: {}, baseDir: str, path: str, editProfileForm += '
\n' editProfileForm += ' \n' editProfileForm += \ @@ -1631,7 +1634,8 @@ def htmlEditProfile(cssCache: {}, translate: {}, baseDir: str, path: str, editProfileForm += '
\n' editProfileForm += \ ' \n' + 'style="height:200px" spellcheck="false">' + \ + switchStr + '\n' editProfileForm += \ '