mirror of https://gitlab.com/bashrc2/epicyon
merge-requests/30/head
commit
e5018e61c4
11
daemon.py
11
daemon.py
|
@ -12285,7 +12285,6 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
msglen, calling_domain)
|
msglen, calling_domain)
|
||||||
self._write(msg)
|
self._write(msg)
|
||||||
self.server.getreq_busy = False
|
self.server.getreq_busy = False
|
||||||
self._redirect_headers(post_id, None, calling_domain)
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def _show_individual_at_post(self, ssml_getreq: bool, authorized: bool,
|
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
|
# for news instances if not logged in then show the
|
||||||
# front page
|
# front page
|
||||||
divert_path = '/users/news'
|
divert_path = '/users/news'
|
||||||
# if debug:
|
if debug:
|
||||||
print('DEBUG: divert_to_login_screen=' +
|
print('DEBUG: divert_to_login_screen=' +
|
||||||
str(divert_to_login_screen))
|
str(divert_to_login_screen))
|
||||||
print('DEBUG: authorized=' + str(authorized))
|
print('DEBUG: authorized=' + str(authorized))
|
||||||
print('DEBUG: path=' + path)
|
print('DEBUG: path=' + path)
|
||||||
if calling_domain.endswith('.onion') and onion_domain:
|
if calling_domain.endswith('.onion') and onion_domain:
|
||||||
self._redirect_headers('http://' +
|
self._redirect_headers('http://' +
|
||||||
onion_domain + divert_path,
|
onion_domain + divert_path,
|
||||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -117,7 +117,13 @@ def sign_post_headers(date_str: str, private_key_pem: str,
|
||||||
# strip the trailing linefeed
|
# strip the trailing linefeed
|
||||||
signed_header_text = signed_header_text.rstrip('\n')
|
signed_header_text = signed_header_text.rstrip('\n')
|
||||||
# signed_header_text.encode('ascii') matches
|
# 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))
|
# print('header_digest2: ' + str(header_digest))
|
||||||
|
|
||||||
# Sign the digest
|
# Sign the digest
|
||||||
|
|
17
newswire.py
17
newswire.py
|
@ -337,16 +337,17 @@ def parse_feed_date(pub_date: str, unique_string_identifier: str) -> str:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
# remove any fraction of a second
|
# remove any fraction of a second
|
||||||
if '.' in pub_date:
|
pub_date2 = pub_date
|
||||||
ending = pub_date.split('.')[1]
|
if '.' in pub_date2:
|
||||||
|
ending = pub_date2.split('.')[1]
|
||||||
timezone_str = ''
|
timezone_str = ''
|
||||||
for ending_char in ending:
|
if '+' in ending:
|
||||||
if not ending_char.isdigit():
|
timezone_str = '+' + ending.split('+')[1]
|
||||||
timezone_str += ending_char
|
elif '-' in ending:
|
||||||
if timezone_str:
|
timezone_str = '-' + ending.split('-')[1]
|
||||||
pub_date = pub_date.split('.')[0] + timezone_str
|
pub_date2 = pub_date2.split('.')[0] + timezone_str
|
||||||
try:
|
try:
|
||||||
published_date = datetime.strptime(pub_date, date_format)
|
published_date = datetime.strptime(pub_date2, date_format)
|
||||||
except BaseException:
|
except BaseException:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/bin/bash
|
#!/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
|
if [ ! -f .blocked_events.txt ]; then
|
||||||
echo 'No blocking events'
|
echo 'No blocking events'
|
||||||
else
|
else
|
||||||
|
|
|
@ -63,7 +63,7 @@ def html_conversation_view(post_id: str,
|
||||||
html_header_with_external_style(css_filename, instance_title, None)
|
html_header_with_external_style(css_filename, instance_title, None)
|
||||||
|
|
||||||
separator_str = html_post_separator(base_dir, None)
|
separator_str = html_post_separator(base_dir, None)
|
||||||
text_mode_separator = '<div class="transparent"><hr></div>'
|
text_mode_separator = '<div class="transparent"><hr></div>\n'
|
||||||
|
|
||||||
minimize_all_images = False
|
minimize_all_images = False
|
||||||
if nickname in min_images_for_accounts:
|
if nickname in min_images_for_accounts:
|
||||||
|
@ -99,9 +99,7 @@ def html_conversation_view(post_id: str,
|
||||||
minimize_all_images, None,
|
minimize_all_images, None,
|
||||||
buy_sites)
|
buy_sites)
|
||||||
if post_str:
|
if post_str:
|
||||||
# check for "HTTP/1.1 303 See Other Server"
|
conv_str += text_mode_separator + separator_str + post_str
|
||||||
if 'X-AP-Instance-ID' not in post_str:
|
|
||||||
conv_str += text_mode_separator + separator_str + post_str
|
|
||||||
|
|
||||||
conv_str += text_mode_separator + html_footer()
|
conv_str += text_mode_separator + html_footer()
|
||||||
return conv_str
|
return conv_str
|
||||||
|
|
|
@ -775,7 +775,7 @@ def html_new_post(edit_post_params: {},
|
||||||
' <label class="labels">' + \
|
' <label class="labels">' + \
|
||||||
translate['Language used'] + '</label>\n'
|
translate['Language used'] + '</label>\n'
|
||||||
replies_section += languages_dropdown
|
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',
|
replies_section += edit_text_field(buy_link_str, 'buyUrl',
|
||||||
default_buy_site, 'https://...')
|
default_buy_site, 'https://...')
|
||||||
replies_section += '</div>\n'
|
replies_section += '</div>\n'
|
||||||
|
|
|
@ -1082,7 +1082,7 @@ def html_hashtag_search_remote(nickname: str, domain: str, port: int,
|
||||||
debug: bool, buy_sites: {}) -> str:
|
debug: bool, buy_sites: {}) -> str:
|
||||||
"""Show a page containing search results for a remote hashtag
|
"""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'
|
profile_str = 'https://www.w3.org/ns/activitystreams'
|
||||||
as_header = {
|
as_header = {
|
||||||
|
|
Loading…
Reference in New Issue