Bob Mottram 2023-01-03 18:22:30 +00:00
commit 1925b3d765
87 changed files with 102 additions and 32 deletions

View File

@ -1717,6 +1717,22 @@ h3 {
cursor: pointer; cursor: pointer;
margin: 5px; margin: 5px;
} }
.followApproveHandle {
border-radius: var(--button-corner-radius);
background-color: var(--main-bg-color);
border: none;
color: var(--main-fg-color);
text-align: center;
font-size: var(--font-size-header);
font-family: 'Arial, Helvetica, sans-serif';
padding: var(--button-height-padding);
width: 20%;
max-width: 200px;
min-width: 80px;
cursor: pointer;
margin: 0 5px;
float: right;
}
.followApprove { .followApprove {
border-radius: var(--button-corner-radius); border-radius: var(--button-corner-radius);
background-color: var(--button-approve); background-color: var(--button-approve);
@ -2516,6 +2532,22 @@ h3 {
cursor: pointer; cursor: pointer;
margin: 15px; margin: 15px;
} }
.followApprove {
border-radius: var(--button-corner-radius);
background-color: var(--main-bg-color);
border: none;
color: var(--main-fg-color);
text-align: center;
font-size: var(--font-size3);
font-family: 'Arial, Helvetica, sans-serif';
padding: var(--button-height-padding-mobile);
width: 20%;
max-width: 400px;
min-width: 80px;
cursor: pointer;
margin: 0 15px;
float: right;
}
.followApprove { .followApprove {
border-radius: var(--button-corner-radius); border-radius: var(--button-corner-radius);
background-color: var(--button-approve); background-color: var(--button-approve);
@ -3313,6 +3345,22 @@ h3 {
cursor: pointer; cursor: pointer;
margin: 15px; margin: 15px;
} }
.followApproveHandle {
border-radius: var(--button-corner-radius);
background-color: var(--main-bg-color);
border: none;
color: var(--main-fg-color);
text-align: center;
font-size: var(--font-size3);
font-family: 'Arial, Helvetica, sans-serif';
padding: var(--button-height-padding-tiny);
width: 20%;
max-width: 400px;
min-width: 80px;
cursor: pointer;
margin: 0 15px;
float: right;
}
.followApprove { .followApprove {
border-radius: var(--button-corner-radius); border-radius: var(--button-corner-radius);
background-color: var(--button-approve); background-color: var(--button-approve);

View File

@ -658,11 +658,14 @@ def save_post_to_inbox_queue(base_dir: str, http_prefix: str,
return None return None
post_domain = get_full_domain(post_domain, post_port) post_domain = get_full_domain(post_domain, post_port)
content_str = \
get_base_content_from_post(post_json_object, system_language)
if has_object_dict(post_json_object): if has_object_dict(post_json_object):
if is_quote_toot(post_json_object): if is_quote_toot(post_json_object, content_str):
if debug:
print('REJECT: inbox quote toot ' + str(post_json_object)) print('REJECT: inbox quote toot ' + str(post_json_object))
return None return None
if post_json_object['object'].get('inReplyTo'): if post_json_object['object'].get('inReplyTo'):
if isinstance(post_json_object['object']['inReplyTo'], str): if isinstance(post_json_object['object']['inReplyTo'], str):
in_reply_to = \ in_reply_to = \
@ -690,8 +693,6 @@ def save_post_to_inbox_queue(base_dir: str, http_prefix: str,
return None return None
# filter on the content of the post # filter on the content of the post
content_str = \
get_base_content_from_post(post_json_object, system_language)
if content_str: if content_str:
summary_str = \ summary_str = \
get_summary_from_post(post_json_object, get_summary_from_post(post_json_object,
@ -3312,6 +3313,7 @@ def _like_notify(base_dir: str, domain: str,
liker_handle = actor liker_handle = actor
if liker_handle == handle: if liker_handle == handle:
return return
like_str = liker_handle + ' ' + url + '?likedBy=' + actor like_str = liker_handle + ' ' + url + '?likedBy=' + actor
prev_like_file = account_dir + '/.prevLike' prev_like_file = account_dir + '/.prevLike'
# was there a previous like notification? # was there a previous like notification?

View File

@ -341,7 +341,7 @@ If you want to block particular fediverse accounts or instances then you can ent
Within the *filtering and blocking* section you can also set a city which will be used for geolocation spoofing. When you post a photo, instead of removing all metadata spoofed metadata will be added in order to consistently fool the machine learning systems behind web crawlers or scrapers, and create a [confirmation bias](https://en.wikipedia.org/wiki/Confirmation_bias) effect where the surveillance systems become increasingly confident in an erroneous conclusion. Setting a city somewhere near to your [time zone](https://en.wikipedia.org/wiki/Time_zone) is preferable, so that it matches your typical pattern of daily posting activity without giving away your real location. Within the *filtering and blocking* section you can also set a city which will be used for geolocation spoofing. When you post a photo, instead of removing all metadata spoofed metadata will be added in order to consistently fool the machine learning systems behind web crawlers or scrapers, and create a [confirmation bias](https://en.wikipedia.org/wiki/Confirmation_bias) effect where the surveillance systems become increasingly confident in an erroneous conclusion. Setting a city somewhere near to your [time zone](https://en.wikipedia.org/wiki/Time_zone) is preferable, so that it matches your typical pattern of daily posting activity without giving away your real location.
### Verifying your website or blog ### Verifying your website or blog
It is possible to indicate that a website of blog belongs to you by linking it to your profile screen. Within the *head* html section of your website or blog index page include a line similar to: It is possible to indicate that a website or blog belongs to you by linking it to your profile screen. Within the *head* html section of your website or blog index page include a line similar to:
``` html ``` html
<link rel="me" href="https://YourEpicyonDomain/@YourNickname" /> <link rel="me" href="https://YourEpicyonDomain/@YourNickname" />
``` ```

View File

@ -265,7 +265,7 @@ def post_message_to_outbox(session, translate: {},
# check that the outgoing post doesn't contain any markup # check that the outgoing post doesn't contain any markup
# which can be used to implement exploits # which can be used to implement exploits
if has_object_dict(message_json): if has_object_dict(message_json):
if is_quote_toot(message_json): if is_quote_toot(message_json, ''):
print('REJECT: POST quote toot ' + str(message_json)) print('REJECT: POST quote toot ' + str(message_json))
return False return False

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

View File

@ -4161,7 +4161,7 @@ def save_reverse_timeline(base_dir: str, reverse_sequence: []) -> []:
break break
def is_quote_toot(post_json_object: str) -> bool: def is_quote_toot(post_json_object: str, content: str) -> bool:
"""Returns true if the given post is a quote toot """Returns true if the given post is a quote toot
""" """
# Pleroma implementation # Pleroma implementation
@ -4187,6 +4187,9 @@ def is_quote_toot(post_json_object: str) -> bool:
if 'json' not in item['mediaType']: if 'json' not in item['mediaType']:
continue continue
return True return True
if content:
if 'QT: ' in content:
return True
return False return False

View File

@ -1649,7 +1649,8 @@ def _get_footer_with_icons(show_icons: bool,
delete_str: str, mute_str: str, edit_str: str, delete_str: str, mute_str: str, edit_str: str,
post_json_object: {}, published_link: str, post_json_object: {}, published_link: str,
time_class: str, published_str: str, time_class: str, published_str: str,
nickname: str, content_license_url: str) -> str: nickname: str, content_license_url: str,
translate: {}) -> str:
"""Returns the html for a post footer containing icons """Returns the html for a post footer containing icons
""" """
if not show_icons: if not show_icons:
@ -1664,7 +1665,7 @@ def _get_footer_with_icons(show_icons: bool,
footer_str += ' ' footer_str += ' '
if content_license_url: if content_license_url:
footer_str += _get_copyright_footer(content_license_url, footer_str += _get_copyright_footer(content_license_url,
time_class) translate)
# show the date # show the date
date_link = '/users/' + nickname + '?convthread=' + \ date_link = '/users/' + nickname + '?convthread=' + \
published_link.replace('/', '--') published_link.replace('/', '--')
@ -1806,24 +1807,30 @@ def _get_content_license(post_json_object: {}) -> str:
def _get_copyright_footer(content_license_url: str, def _get_copyright_footer(content_license_url: str,
time_class: str) -> str: translate: {}) -> str:
"""Returns the footer copyright link """Returns the footer copyright link
""" """
# show the CC symbol # show the CC symbol
copyright_symbol = '🅭 ' icon_filename = 'license_cc.png'
if '/zero/' in content_license_url: if '/zero/' in content_license_url:
copyright_symbol = '🄍 ' icon_filename = 'license_cc0.png'
elif 'unlicense' in content_license_url: elif 'unlicense' in content_license_url:
copyright_symbol = '🅮' icon_filename = 'license_un.png'
elif 'wtfpl' in content_license_url: elif 'wtfpl' in content_license_url:
copyright_symbol = '🅮' icon_filename = 'license_wtf.png'
elif '/fdl' in content_license_url: elif '/fdl' in content_license_url:
copyright_symbol = '🄎' icon_filename = 'license_fdl.png'
return '<a href="' + \
content_license_url + '" class="' + \ description = translate['Content License']
time_class + '" tabindex="10">' + \ copyright_str = \
'<span itemprop="license">' + \ ' ' + \
copyright_symbol + '</span></a> ' '<a class="imageAnchor" href="' + content_license_url + \
'" title="' + description + '" tabindex="10">' + \
'<img loading="lazy" decoding="async" title="' + \
description + '" alt="' + description + \
' |" src="/icons/' + icon_filename + '"/></a>\n'
return copyright_str
def individual_post_as_html(signing_priv_key_pem: str, def individual_post_as_html(signing_priv_key_pem: str,
@ -2366,15 +2373,20 @@ def individual_post_as_html(signing_priv_key_pem: str,
content_license_url = _get_content_license(post_json_object) content_license_url = _get_content_license(post_json_object)
if not is_news_post(post_json_object): if not is_news_post(post_json_object):
if show_icons:
footer_str = '' footer_str = ''
else:
footer_str = '<div class="' + container_class_icons + '">\n'
if content_license_url: if content_license_url:
footer_str += _get_copyright_footer(content_license_url, footer_str += _get_copyright_footer(content_license_url,
time_class) translate)
conv_link = '/users/' + nickname + '?convthread=' + \ conv_link = '/users/' + nickname + '?convthread=' + \
published_link.replace('/', '--') published_link.replace('/', '--')
footer_str += '<a href="' + conv_link + \ footer_str += '<a href="' + conv_link + \
'" class="' + time_class + '" tabindex="10">' + \ '" class="' + time_class + '" tabindex="10">' + \
published_str + '</a>\n' published_str + '</a>\n'
if not show_icons:
footer_str += '</div>\n'
else: else:
footer_str = '<a href="' + \ footer_str = '<a href="' + \
published_link.replace('/news/', '/news/statuses/') + \ published_link.replace('/news/', '/news/statuses/') + \
@ -2463,7 +2475,7 @@ def individual_post_as_html(signing_priv_key_pem: str,
delete_str, mute_str, edit_str, delete_str, mute_str, edit_str,
post_json_object, published_link, post_json_object, published_link,
time_class, published_str, nickname, time_class, published_str, nickname,
content_license_url) content_license_url, translate)
if new_footer_str: if new_footer_str:
footer_str = new_footer_str footer_str = new_footer_str

View File

@ -896,16 +896,21 @@ def html_profile(signing_priv_key_pem: str,
if follower_domain not in curr_follower_domains: if follower_domain not in curr_follower_domains:
new_follower_domain = '' new_follower_domain = ''
# Show the handle of the potential follower
# being approved, linking to search on that handle
base_path = '/users/' + nickname base_path = '/users/' + nickname
follow_approvals_section += \ follow_approvals_section += \
'<div class="container">' '<div class="container">\n' + \
follow_approvals_section += \ ' <form method="POST" action="' + \
'<a href="' + follower_actor + \ base_path + '/searchhandle?page=1">\n' + \
'" tabindex="2">' ' <input type="hidden" ' + \
follow_approvals_section += \ 'name="actor" value="' + \
'<span class="followRequestHandle">' + \ follower_actor + '">\n' + \
follower_handle + \ ' <button type="submit" ' + \
new_follower_domain + '</span></a>' 'class="followApproveHandle" ' + \
'name="submitSearch" tabindex="2">' + \
follower_handle + new_follower_domain + \
'</button>\n </form>\n'
# show Approve and Deny buttons # show Approve and Deny buttons
follow_approvals_section += \ follow_approvals_section += \