diff --git a/daemon.py b/daemon.py index b72fa6984..aae4314b6 100644 --- a/daemon.py +++ b/daemon.py @@ -12285,7 +12285,6 @@ class PubServer(BaseHTTPRequestHandler): msglen, calling_domain) self._write(msg) self.server.getreq_busy = False - self._redirect_headers(post_id, None, calling_domain) return True def _show_individual_at_post(self, ssml_getreq: bool, authorized: bool, @@ -15768,11 +15767,11 @@ class PubServer(BaseHTTPRequestHandler): # for news instances if not logged in then show the # front page divert_path = '/users/news' - # if debug: - print('DEBUG: divert_to_login_screen=' + - str(divert_to_login_screen)) - print('DEBUG: authorized=' + str(authorized)) - print('DEBUG: path=' + path) + if debug: + print('DEBUG: divert_to_login_screen=' + + str(divert_to_login_screen)) + print('DEBUG: authorized=' + str(authorized)) + print('DEBUG: path=' + path) if calling_domain.endswith('.onion') and onion_domain: self._redirect_headers('http://' + onion_domain + divert_path, diff --git a/fonts/Atkinson-Hyperlegible-Bold.woff2 b/fonts/Atkinson-Hyperlegible-Bold.woff2 new file mode 100644 index 000000000..19a58eace Binary files /dev/null and b/fonts/Atkinson-Hyperlegible-Bold.woff2 differ diff --git a/fonts/AtkinsonHyperlegible-Bold.ttf b/fonts/AtkinsonHyperlegible-Bold.ttf deleted file mode 100644 index c72b4889f..000000000 Binary files a/fonts/AtkinsonHyperlegible-Bold.ttf and /dev/null differ diff --git a/httpsig.py b/httpsig.py index 8b6b7083b..5ddac2122 100644 --- a/httpsig.py +++ b/httpsig.py @@ -117,7 +117,13 @@ def sign_post_headers(date_str: str, private_key_pem: str, # strip the trailing linefeed signed_header_text = signed_header_text.rstrip('\n') # signed_header_text.encode('ascii') matches - header_digest = get_sha_256(signed_header_text.encode('ascii')) + try: + sig_header_encoded = signed_header_text.encode('ascii') + except UnicodeEncodeError: + sig_header_encoded = signed_header_text + print('WARN: sign_post_headers unable to ascii encode ' + + signed_header_text) + header_digest = get_sha_256(sig_header_encoded) # print('header_digest2: ' + str(header_digest)) # Sign the digest diff --git a/newswire.py b/newswire.py index d80e7546b..9ed6c9c22 100644 --- a/newswire.py +++ b/newswire.py @@ -337,16 +337,17 @@ def parse_feed_date(pub_date: str, unique_string_identifier: str) -> str: continue # remove any fraction of a second - if '.' in pub_date: - ending = pub_date.split('.')[1] + pub_date2 = pub_date + if '.' in pub_date2: + ending = pub_date2.split('.')[1] timezone_str = '' - for ending_char in ending: - if not ending_char.isdigit(): - timezone_str += ending_char - if timezone_str: - pub_date = pub_date.split('.')[0] + timezone_str + if '+' in ending: + timezone_str = '+' + ending.split('+')[1] + elif '-' in ending: + timezone_str = '-' + ending.split('-')[1] + pub_date2 = pub_date2.split('.')[0] + timezone_str try: - published_date = datetime.strptime(pub_date, date_format) + published_date = datetime.strptime(pub_date2, date_format) except BaseException: continue diff --git a/scripts/blocked b/scripts/blocked index 31cdfcde0..662f7fdef 100755 --- a/scripts/blocked +++ b/scripts/blocked @@ -1,5 +1,5 @@ #!/bin/bash -journalctl -u epicyon | grep 'get_json Forbidden ' > .blocked_events.txt +journalctl -u epicyon | grep -i 'get_json forbidden \|blocked' > .blocked_events.txt if [ ! -f .blocked_events.txt ]; then echo 'No blocking events' else diff --git a/webapp_conversation.py b/webapp_conversation.py index c15f26c64..120844494 100644 --- a/webapp_conversation.py +++ b/webapp_conversation.py @@ -63,7 +63,7 @@ def html_conversation_view(post_id: str, html_header_with_external_style(css_filename, instance_title, None) separator_str = html_post_separator(base_dir, None) - text_mode_separator = '

' + text_mode_separator = '

\n' minimize_all_images = False if nickname in min_images_for_accounts: @@ -99,9 +99,7 @@ def html_conversation_view(post_id: str, minimize_all_images, None, buy_sites) if post_str: - # check for "HTTP/1.1 303 See Other Server" - if 'X-AP-Instance-ID' not in post_str: - conv_str += text_mode_separator + separator_str + post_str + conv_str += text_mode_separator + separator_str + post_str conv_str += text_mode_separator + html_footer() return conv_str diff --git a/webapp_create_post.py b/webapp_create_post.py index bcb559003..6eb814714 100644 --- a/webapp_create_post.py +++ b/webapp_create_post.py @@ -775,7 +775,7 @@ def html_new_post(edit_post_params: {}, ' \n' replies_section += languages_dropdown - buy_link_str = '🛒 ' + translate['Buy link'] + buy_link_str = translate['Buy link'] replies_section += edit_text_field(buy_link_str, 'buyUrl', default_buy_site, 'https://...') replies_section += '\n' diff --git a/webapp_search.py b/webapp_search.py index b9204371d..cd3abfcd7 100644 --- a/webapp_search.py +++ b/webapp_search.py @@ -1082,7 +1082,7 @@ def html_hashtag_search_remote(nickname: str, domain: str, port: int, debug: bool, buy_sites: {}) -> str: """Show a page containing search results for a remote hashtag """ - hashtag = hashtag_url.split('/')[-1] + hashtag = urllib.parse.unquote(hashtag_url.split('/')[-1]) profile_str = 'https://www.w3.org/ns/activitystreams' as_header = {