mirror of https://gitlab.com/bashrc2/epicyon
More debug
parent
6a653a182c
commit
9e62bbd686
|
|
@ -21,7 +21,7 @@ def show_blog_page(self, authorized: bool,
|
|||
domain: str, port: int,
|
||||
getreq_start_time,
|
||||
proxy_type: str, cookie: str,
|
||||
translate: {}, debug: str,
|
||||
translate: {}, debug: bool,
|
||||
curr_session,
|
||||
max_posts_in_blogs_feed: int,
|
||||
peertube_instances: [],
|
||||
|
|
|
|||
|
|
@ -217,7 +217,7 @@ def delete_button(self, calling_domain: str, path: str,
|
|||
yggdrasil_domain: str,
|
||||
getreq_start_time,
|
||||
proxy_type: str, cookie: str,
|
||||
debug: str, curr_session,
|
||||
debug: bool, curr_session,
|
||||
recent_posts_cache: {},
|
||||
max_recent_posts: int,
|
||||
translate: {},
|
||||
|
|
|
|||
|
|
@ -201,7 +201,7 @@ def announce_button(self, calling_domain: str, path: str,
|
|||
post_to_outbox(self, announce_json,
|
||||
project_version,
|
||||
self.post_to_nickname,
|
||||
curr_session, proxy_type)
|
||||
curr_session, proxy_type, debug)
|
||||
|
||||
fitness_performance(getreq_start_time, fitness,
|
||||
'_GET', '_announce_button postToOutboxThread',
|
||||
|
|
@ -437,7 +437,7 @@ def announce_button_undo(self, calling_domain: str, path: str,
|
|||
post_to_outbox(self, new_undo_announce,
|
||||
project_version,
|
||||
self.post_to_nickname,
|
||||
curr_session, proxy_type)
|
||||
curr_session, proxy_type, debug)
|
||||
|
||||
actor_absolute = \
|
||||
get_instance_url(calling_domain,
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ def bookmark_button(self, calling_domain: str, path: str,
|
|||
yggdrasil_domain: str,
|
||||
getreq_start_time,
|
||||
proxy_type: str, cookie: str,
|
||||
debug: str,
|
||||
debug: bool,
|
||||
curr_session,
|
||||
signing_priv_key_pem: str,
|
||||
recent_posts_cache: {},
|
||||
|
|
@ -265,7 +265,7 @@ def bookmark_button_undo(self, calling_domain: str, path: str,
|
|||
yggdrasil_domain: str,
|
||||
getreq_start_time,
|
||||
proxy_type: str, cookie: str,
|
||||
debug: str,
|
||||
debug: bool,
|
||||
curr_session,
|
||||
signing_priv_key_pem: str,
|
||||
recent_posts_cache: {},
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ def like_button(self, calling_domain: str, path: str,
|
|||
yggdrasil_domain: str,
|
||||
getreq_start_time,
|
||||
proxy_type: str, cookie: str,
|
||||
debug: str,
|
||||
debug: bool,
|
||||
curr_session,
|
||||
signing_priv_key_pem: str,
|
||||
recent_posts_cache: {},
|
||||
|
|
@ -179,7 +179,7 @@ def like_button(self, calling_domain: str, path: str,
|
|||
|
||||
# send out the like to followers
|
||||
post_to_outbox(self, like_json, project_version, None,
|
||||
curr_session, proxy_type)
|
||||
curr_session, proxy_type, debug)
|
||||
|
||||
fitness_performance(getreq_start_time, fitness,
|
||||
'_GET', '_like_button postToOutbox',
|
||||
|
|
@ -319,7 +319,7 @@ def like_button_undo(self, calling_domain: str, path: str,
|
|||
yggdrasil_domain: str,
|
||||
getreq_start_time,
|
||||
proxy_type: str, cookie: str,
|
||||
debug: str,
|
||||
debug: bool,
|
||||
curr_session,
|
||||
signing_priv_key_pem: str,
|
||||
recent_posts_cache: {},
|
||||
|
|
@ -464,7 +464,7 @@ def like_button_undo(self, calling_domain: str, path: str,
|
|||
# send out the undo like to followers
|
||||
post_to_outbox(self, undo_like_json,
|
||||
project_version, None,
|
||||
curr_session, proxy_type)
|
||||
curr_session, proxy_type, debug)
|
||||
|
||||
# directly undo the like within the post file
|
||||
if not liked_post_filename:
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ def mute_button(self, calling_domain: str, path: str,
|
|||
onion_domain: str, i2p_domain: str,
|
||||
yggdrasil_domain: str,
|
||||
getreq_start_time, cookie: str,
|
||||
debug: str, curr_session,
|
||||
debug: bool, curr_session,
|
||||
signing_priv_key_pem: str,
|
||||
recent_posts_cache: {},
|
||||
max_recent_posts: int,
|
||||
|
|
@ -223,7 +223,7 @@ def mute_button_undo(self, calling_domain: str, path: str,
|
|||
onion_domain: str, i2p_domain: str,
|
||||
yggdrasil_domain: str,
|
||||
getreq_start_time, cookie: str,
|
||||
debug: str, curr_session,
|
||||
debug: bool, curr_session,
|
||||
signing_priv_key_pem: str,
|
||||
recent_posts_cache: {},
|
||||
max_recent_posts: int,
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ def reaction_button(self, calling_domain: str, path: str,
|
|||
yggdrasil_domain: str,
|
||||
getreq_start_time,
|
||||
proxy_type: str, cookie: str,
|
||||
debug: str,
|
||||
debug: bool,
|
||||
curr_session,
|
||||
signing_priv_key_pem: str,
|
||||
recent_posts_cache: {},
|
||||
|
|
@ -203,7 +203,7 @@ def reaction_button(self, calling_domain: str, path: str,
|
|||
|
||||
# send out the emoji reaction to followers
|
||||
post_to_outbox(self, reaction_json, project_version, None,
|
||||
curr_session, proxy_type)
|
||||
curr_session, proxy_type, debug)
|
||||
|
||||
fitness_performance(getreq_start_time, fitness,
|
||||
'_GET', '_reaction_button postToOutbox',
|
||||
|
|
@ -347,7 +347,7 @@ def reaction_button_undo(self, calling_domain: str, path: str,
|
|||
yggdrasil_domain: str,
|
||||
getreq_start_time,
|
||||
proxy_type: str, cookie: str,
|
||||
debug: str,
|
||||
debug: bool,
|
||||
curr_session,
|
||||
signing_priv_key_pem: str,
|
||||
recent_posts_cache: {},
|
||||
|
|
@ -514,7 +514,7 @@ def reaction_button_undo(self, calling_domain: str, path: str,
|
|||
# send out the undo emoji reaction to followers
|
||||
post_to_outbox(self, undo_reaction_json,
|
||||
project_version, None,
|
||||
curr_session, proxy_type)
|
||||
curr_session, proxy_type, debug)
|
||||
|
||||
# directly undo the emoji reaction within the post file
|
||||
if not reaction_post_filename:
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ def show_shares_feed(self, authorized: bool,
|
|||
path: str, base_dir: str, http_prefix: str,
|
||||
domain: str, port: int, getreq_start_time,
|
||||
proxy_type: str, cookie: str,
|
||||
debug: str, shares_file_type: str,
|
||||
debug: bool, shares_file_type: str,
|
||||
curr_session, shares_per_page: int,
|
||||
access_keys: {}, key_shortcuts: {},
|
||||
city: str,
|
||||
|
|
@ -224,7 +224,7 @@ def show_following_feed(self, authorized: bool,
|
|||
path: str, base_dir: str, http_prefix: str,
|
||||
domain: str, port: int, getreq_start_time,
|
||||
proxy_type: str, cookie: str,
|
||||
debug: str, curr_session,
|
||||
debug: bool, curr_session,
|
||||
follows_per_page: int,
|
||||
access_keys: {}, key_shortcuts: {},
|
||||
city: str, account_timezone: {},
|
||||
|
|
@ -430,7 +430,7 @@ def show_moved_feed(self, authorized: bool,
|
|||
path: str, base_dir: str, http_prefix: str,
|
||||
domain: str, port: int, getreq_start_time,
|
||||
proxy_type: str, cookie: str,
|
||||
debug: str, curr_session,
|
||||
debug: bool, curr_session,
|
||||
follows_per_page: int,
|
||||
access_keys: {},
|
||||
key_shortcuts: {}, city: str,
|
||||
|
|
@ -623,7 +623,7 @@ def show_inactive_feed(self, authorized: bool,
|
|||
path: str, base_dir: str, http_prefix: str,
|
||||
domain: str, port: int, getreq_start_time,
|
||||
proxy_type: str, cookie: str,
|
||||
debug: str, curr_session,
|
||||
debug: bool, curr_session,
|
||||
dormant_months: int,
|
||||
sites_unavailable: [],
|
||||
follows_per_page: int,
|
||||
|
|
@ -818,7 +818,7 @@ def show_followers_feed(self, authorized: bool,
|
|||
path: str, base_dir: str, http_prefix: str,
|
||||
domain: str, port: int, getreq_start_time,
|
||||
proxy_type: str, cookie: str,
|
||||
debug: str, curr_session,
|
||||
debug: bool, curr_session,
|
||||
follows_per_page: int,
|
||||
access_keys: {},
|
||||
key_shortcuts: {},
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ def show_instance_actor(self, calling_domain: str,
|
|||
onion_domain: str, i2p_domain: str,
|
||||
yggdrasil_domain: str,
|
||||
getreq_start_time,
|
||||
cookie: str, debug: str,
|
||||
cookie: str, debug: bool,
|
||||
enable_shared_inbox: bool,
|
||||
fitness: {}) -> bool:
|
||||
"""Shows the instance actor
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ def _show_post_from_file(self, post_filename: str, liked_by: str,
|
|||
domain: str, port: int,
|
||||
getreq_start_time,
|
||||
proxy_type: str, cookie: str,
|
||||
debug: str, include_create_wrapper: bool,
|
||||
debug: bool, include_create_wrapper: bool,
|
||||
curr_session, translate: {},
|
||||
account_timezone: {},
|
||||
bold_reading_nicknames: {},
|
||||
|
|
@ -232,7 +232,7 @@ def show_individual_post(self, ssml_getreq: bool, authorized: bool,
|
|||
domain: str, domain_full: str, port: int,
|
||||
getreq_start_time,
|
||||
proxy_type: str, cookie: str,
|
||||
debug: str,
|
||||
debug: bool,
|
||||
curr_session, translate: {},
|
||||
account_timezone: {},
|
||||
fitness: {},
|
||||
|
|
@ -579,7 +579,7 @@ def show_individual_at_post(self, ssml_getreq: bool, authorized: bool,
|
|||
domain: str, domain_full: str, port: int,
|
||||
getreq_start_time,
|
||||
proxy_type: str, cookie: str,
|
||||
debug: str,
|
||||
debug: bool,
|
||||
curr_session, translate: {},
|
||||
account_timezone: {},
|
||||
fitness: {},
|
||||
|
|
@ -737,7 +737,7 @@ def show_likers_of_post(self, authorized: bool,
|
|||
base_dir: str, http_prefix: str,
|
||||
domain: str, port: int,
|
||||
getreq_start_time, cookie: str,
|
||||
debug: str, curr_session,
|
||||
debug: bool, curr_session,
|
||||
bold_reading_nicknames: {},
|
||||
translate: {},
|
||||
theme_name: str,
|
||||
|
|
@ -840,7 +840,7 @@ def show_announcers_of_post(self, authorized: bool,
|
|||
base_dir: str, http_prefix: str,
|
||||
domain: str, port: int,
|
||||
getreq_start_time, cookie: str,
|
||||
debug: str, curr_session,
|
||||
debug: bool, curr_session,
|
||||
bold_reading_nicknames: {},
|
||||
translate: {},
|
||||
theme_name: str,
|
||||
|
|
@ -944,7 +944,7 @@ def show_replies_to_post(self, authorized: bool,
|
|||
domain: str, domain_full: str, port: int,
|
||||
getreq_start_time,
|
||||
proxy_type: str, cookie: str,
|
||||
debug: str, curr_session,
|
||||
debug: bool, curr_session,
|
||||
recent_posts_cache: {},
|
||||
max_recent_posts: int,
|
||||
translate: {},
|
||||
|
|
@ -1246,7 +1246,7 @@ def show_notify_post(self, authorized: bool,
|
|||
domain: str, port: int,
|
||||
getreq_start_time,
|
||||
proxy_type: str, cookie: str,
|
||||
debug: str,
|
||||
debug: bool,
|
||||
curr_session, translate: {},
|
||||
account_timezone: {},
|
||||
fitness: {},
|
||||
|
|
@ -1349,7 +1349,7 @@ def show_conversation_thread(self, authorized: bool,
|
|||
calling_domain: str, path: str,
|
||||
base_dir: str, http_prefix: str,
|
||||
domain: str, port: int,
|
||||
debug: str, curr_session,
|
||||
debug: bool, curr_session,
|
||||
cookie: str, ua_str: str,
|
||||
domain_full: str,
|
||||
onion_domain: str,
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ def show_person_profile(self, authorized: bool,
|
|||
yggdrasil_domain: str,
|
||||
getreq_start_time,
|
||||
proxy_type: str, cookie: str,
|
||||
debug: str,
|
||||
debug: bool,
|
||||
curr_session,
|
||||
access_keys: {},
|
||||
key_shortcuts: {}, city: str,
|
||||
|
|
@ -215,7 +215,7 @@ def show_person_profile(self, authorized: bool,
|
|||
def show_roles(self, calling_domain: str, referer_domain: str,
|
||||
path: str, base_dir: str, http_prefix: str,
|
||||
domain: str, getreq_start_time,
|
||||
proxy_type: str, cookie: str, debug: str,
|
||||
proxy_type: str, cookie: str, debug: bool,
|
||||
curr_session, default_timeline: str,
|
||||
recent_posts_cache: {},
|
||||
cached_webfingers: {},
|
||||
|
|
@ -375,7 +375,7 @@ def show_roles(self, calling_domain: str, referer_domain: str,
|
|||
def show_skills(self, calling_domain: str, referer_domain: str,
|
||||
path: str, base_dir: str, http_prefix: str,
|
||||
domain: str, getreq_start_time, proxy_type: str,
|
||||
cookie: str, debug: str, curr_session,
|
||||
cookie: str, debug: bool, curr_session,
|
||||
default_timeline: str,
|
||||
recent_posts_cache: {},
|
||||
cached_webfingers: {},
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ def reaction_picker2(self, calling_domain: str, path: str,
|
|||
base_dir: str, http_prefix: str,
|
||||
domain: str, domain_full: str, port: int,
|
||||
getreq_start_time, cookie: str,
|
||||
debug: str, curr_session,
|
||||
debug: bool, curr_session,
|
||||
onion_domain: str, i2p_domain: str,
|
||||
yggdrasil_domain: str,
|
||||
recent_posts_cache: {},
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ def show_media_timeline(self, authorized: bool,
|
|||
base_dir: str, http_prefix: str,
|
||||
domain: str, port: int,
|
||||
getreq_start_time,
|
||||
cookie: str, debug: str,
|
||||
cookie: str, debug: bool,
|
||||
curr_session, ua_str: str,
|
||||
max_posts_in_media_feed: int,
|
||||
recent_posts_cache: {},
|
||||
|
|
@ -264,7 +264,7 @@ def show_blogs_timeline(self, authorized: bool,
|
|||
base_dir: str, http_prefix: str,
|
||||
domain: str, port: int,
|
||||
getreq_start_time,
|
||||
cookie: str, debug: str,
|
||||
cookie: str, debug: bool,
|
||||
curr_session, ua_str: str,
|
||||
max_posts_in_blogs_feed: int,
|
||||
recent_posts_cache: {},
|
||||
|
|
@ -481,7 +481,7 @@ def show_news_timeline(self, authorized: bool,
|
|||
base_dir: str, http_prefix: str,
|
||||
domain: str, port: int,
|
||||
getreq_start_time,
|
||||
cookie: str, debug: str,
|
||||
cookie: str, debug: bool,
|
||||
curr_session, ua_str: str,
|
||||
max_posts_in_news_feed: int,
|
||||
recent_posts_cache: {},
|
||||
|
|
@ -702,7 +702,7 @@ def show_features_timeline(self, authorized: bool,
|
|||
path: str, base_dir: str, http_prefix: str,
|
||||
domain: str, port: int,
|
||||
getreq_start_time,
|
||||
cookie: str, debug: str,
|
||||
cookie: str, debug: bool,
|
||||
curr_session, ua_str: str,
|
||||
max_posts_in_news_feed: int,
|
||||
recent_posts_cache: {},
|
||||
|
|
@ -920,7 +920,7 @@ def show_shares_timeline(self, authorized: bool,
|
|||
base_dir: str, http_prefix: str,
|
||||
domain: str, port: int,
|
||||
getreq_start_time,
|
||||
cookie: str, debug: str,
|
||||
cookie: str, debug: bool,
|
||||
curr_session, ua_str: str,
|
||||
max_posts_in_feed: int,
|
||||
access_keys: {},
|
||||
|
|
@ -1072,7 +1072,7 @@ def show_wanted_timeline(self, authorized: bool,
|
|||
base_dir: str, http_prefix: str,
|
||||
domain: str, port: int,
|
||||
getreq_start_time,
|
||||
cookie: str, debug: str,
|
||||
cookie: str, debug: bool,
|
||||
curr_session, ua_str: str,
|
||||
max_posts_in_feed: int,
|
||||
access_keys: {},
|
||||
|
|
@ -1224,7 +1224,7 @@ def show_bookmarks_timeline(self, authorized: bool,
|
|||
base_dir: str, http_prefix: str,
|
||||
domain: str, port: int,
|
||||
getreq_start_time,
|
||||
cookie: str, debug: str,
|
||||
cookie: str, debug: bool,
|
||||
curr_session, ua_str: str,
|
||||
max_posts_in_feed: int,
|
||||
recent_posts_cache: {},
|
||||
|
|
@ -1436,7 +1436,7 @@ def show_outbox_timeline(self, authorized: bool,
|
|||
base_dir: str, http_prefix: str,
|
||||
domain: str, port: int,
|
||||
getreq_start_time,
|
||||
cookie: str, debug: str,
|
||||
cookie: str, debug: bool,
|
||||
curr_session, ua_str: str,
|
||||
proxy_type: str,
|
||||
max_posts_in_feed: int,
|
||||
|
|
@ -1650,7 +1650,7 @@ def show_mod_timeline(self, authorized: bool,
|
|||
calling_domain: str, referer_domain: str,
|
||||
path: str, base_dir: str, http_prefix: str,
|
||||
domain: str, port: int, getreq_start_time,
|
||||
cookie: str, debug: str,
|
||||
cookie: str, debug: bool,
|
||||
curr_session, ua_str: str,
|
||||
max_posts_in_feed: int,
|
||||
recent_posts_cache: {},
|
||||
|
|
@ -1858,7 +1858,7 @@ def show_dms(self, authorized: bool,
|
|||
path: str, base_dir: str, http_prefix: str,
|
||||
domain: str, port: int,
|
||||
getreq_start_time,
|
||||
cookie: str, debug: str,
|
||||
cookie: str, debug: bool,
|
||||
curr_session, ua_str: str,
|
||||
max_posts_in_feed: int,
|
||||
recent_posts_cache: {},
|
||||
|
|
@ -2074,7 +2074,7 @@ def show_replies(self, authorized: bool,
|
|||
base_dir: str, http_prefix: str,
|
||||
domain: str, port: int,
|
||||
getreq_start_time,
|
||||
cookie: str, debug: str,
|
||||
cookie: str, debug: bool,
|
||||
curr_session, ua_str: str,
|
||||
max_posts_in_feed: int,
|
||||
recent_posts_cache: {},
|
||||
|
|
@ -2290,7 +2290,7 @@ def show_inbox(self, authorized: bool,
|
|||
base_dir: str, http_prefix: str,
|
||||
domain: str, port: int,
|
||||
getreq_start_time,
|
||||
cookie: str, debug: str,
|
||||
cookie: str, debug: bool,
|
||||
recent_posts_cache: {}, curr_session,
|
||||
default_timeline: str,
|
||||
max_recent_posts: int,
|
||||
|
|
|
|||
|
|
@ -1321,7 +1321,8 @@ def daemon_http_post(self) -> None:
|
|||
if self.outbox_authenticated:
|
||||
if post_to_outbox(self, message_json,
|
||||
self.server.project_version, None,
|
||||
curr_session, proxy_type):
|
||||
curr_session, proxy_type,
|
||||
self.server.debug):
|
||||
if message_json.get('id'):
|
||||
locn_str = remove_id_ending(message_json['id'])
|
||||
self.headers['Location'] = locn_str
|
||||
|
|
|
|||
|
|
@ -210,7 +210,8 @@ def _profile_post_save_actor(base_dir: str, http_prefix: str,
|
|||
print('Sending actor update: ' + str(update_actor_json))
|
||||
post_to_outbox(self, update_actor_json,
|
||||
project_version, nickname,
|
||||
curr_session, proxy_type)
|
||||
curr_session, proxy_type,
|
||||
self.server.debug)
|
||||
# send move activity if necessary
|
||||
if send_move_activity:
|
||||
move_actor_json = get_actor_move_json(actor_json)
|
||||
|
|
@ -218,7 +219,8 @@ def _profile_post_save_actor(base_dir: str, http_prefix: str,
|
|||
post_to_outbox(self, move_actor_json,
|
||||
project_version,
|
||||
nickname,
|
||||
curr_session, proxy_type)
|
||||
curr_session, proxy_type,
|
||||
self.server.debug)
|
||||
|
||||
|
||||
def _profile_post_memorial(base_dir: str, nickname: str,
|
||||
|
|
|
|||
|
|
@ -276,7 +276,7 @@ def _send_reply_to_question(self, base_dir: str,
|
|||
message_json['object']['name'] = answer
|
||||
if post_to_outbox(self, message_json,
|
||||
project_version, nickname,
|
||||
curr_session, proxy_type):
|
||||
curr_session, proxy_type, debug):
|
||||
post_filename = \
|
||||
locate_post(base_dir, nickname, domain, message_id)
|
||||
if post_filename:
|
||||
|
|
|
|||
|
|
@ -129,6 +129,8 @@ def _receive_new_post_process_newpost(self, fields: {},
|
|||
if not fields['message']:
|
||||
# remove the pinned content from profile screen
|
||||
undo_pinned_post(base_dir, nickname, domain)
|
||||
if debug:
|
||||
print('DEBUG: _receive_new_post_process_newpost no message')
|
||||
return NEW_POST_SUCCESS
|
||||
|
||||
city = get_spoofed_city(city, base_dir, nickname, domain)
|
||||
|
|
@ -255,7 +257,7 @@ def _receive_new_post_process_newpost(self, fields: {},
|
|||
if post_to_outbox(self, message_json,
|
||||
project_version,
|
||||
nickname,
|
||||
curr_session, proxy_type):
|
||||
curr_session, proxy_type, debug):
|
||||
populate_replies(base_dir,
|
||||
http_prefix,
|
||||
domain_full,
|
||||
|
|
@ -263,6 +265,8 @@ def _receive_new_post_process_newpost(self, fields: {},
|
|||
max_replies,
|
||||
debug)
|
||||
return NEW_POST_SUCCESS
|
||||
if debug:
|
||||
print('DEBUG: failed to post to outbox')
|
||||
return NEW_POST_FAILED
|
||||
|
||||
|
||||
|
|
@ -379,7 +383,7 @@ def _receive_new_post_process_newblog(self, fields: {},
|
|||
if post_to_outbox(self, message_json,
|
||||
project_version,
|
||||
nickname,
|
||||
curr_session, proxy_type):
|
||||
curr_session, proxy_type, debug):
|
||||
refresh_newswire(base_dir)
|
||||
populate_replies(base_dir, http_prefix, domain_full,
|
||||
message_json,
|
||||
|
|
@ -677,7 +681,7 @@ def _receive_new_post_process_newunlisted(self, fields: {},
|
|||
if post_to_outbox(self, message_json,
|
||||
project_version,
|
||||
nickname,
|
||||
curr_session, proxy_type):
|
||||
curr_session, proxy_type, debug):
|
||||
populate_replies(base_dir, http_prefix, domain,
|
||||
message_json,
|
||||
max_replies,
|
||||
|
|
@ -859,7 +863,7 @@ def _receive_new_post_process_newfollowers(self, fields: {},
|
|||
if post_to_outbox(self, message_json,
|
||||
project_version,
|
||||
nickname,
|
||||
curr_session, proxy_type):
|
||||
curr_session, proxy_type, debug):
|
||||
populate_replies(base_dir, http_prefix, domain,
|
||||
message_json,
|
||||
max_replies,
|
||||
|
|
@ -1052,7 +1056,7 @@ def _receive_new_post_process_newdm(self, fields: {},
|
|||
if post_to_outbox(self, message_json,
|
||||
project_version,
|
||||
nickname,
|
||||
curr_session, proxy_type):
|
||||
curr_session, proxy_type, debug):
|
||||
populate_replies(base_dir, http_prefix, domain,
|
||||
message_json,
|
||||
max_replies,
|
||||
|
|
@ -1222,7 +1226,7 @@ def _receive_new_post_process_newreminder(self, fields: {}, nickname: str,
|
|||
if post_to_outbox(self, message_json,
|
||||
project_version,
|
||||
nickname,
|
||||
curr_session, proxy_type):
|
||||
curr_session, proxy_type, debug):
|
||||
return NEW_POST_SUCCESS
|
||||
return NEW_POST_FAILED
|
||||
|
||||
|
|
@ -1289,7 +1293,7 @@ def _receive_new_post_process_newreport(self, fields: {},
|
|||
if post_to_outbox(self, message_json,
|
||||
project_version,
|
||||
nickname,
|
||||
curr_session, proxy_type):
|
||||
curr_session, proxy_type, debug):
|
||||
return NEW_POST_SUCCESS
|
||||
return NEW_POST_FAILED
|
||||
|
||||
|
|
@ -1395,7 +1399,7 @@ def _receive_new_post_process_newquestion(self, fields: {},
|
|||
if post_to_outbox(self, message_json,
|
||||
project_version,
|
||||
nickname,
|
||||
curr_session, proxy_type):
|
||||
curr_session, proxy_type, debug):
|
||||
return NEW_POST_SUCCESS
|
||||
return NEW_POST_FAILED
|
||||
|
||||
|
|
@ -1595,7 +1599,7 @@ def _receive_new_post_process_newreading(self, fields: {},
|
|||
if post_to_outbox(self, message_json,
|
||||
project_version,
|
||||
nickname,
|
||||
curr_session, proxy_type):
|
||||
curr_session, proxy_type, debug):
|
||||
populate_replies(base_dir, http_prefix,
|
||||
domain_full,
|
||||
message_json,
|
||||
|
|
@ -1736,7 +1740,8 @@ def _receive_new_post_process_newshare(self, fields: {},
|
|||
post_to_outbox(self, update_actor_json,
|
||||
project_version,
|
||||
nickname,
|
||||
curr_session, proxy_type)
|
||||
curr_session, proxy_type,
|
||||
debug)
|
||||
|
||||
if filename:
|
||||
if os.path.isfile(filename):
|
||||
|
|
|
|||
|
|
@ -221,7 +221,8 @@ def remove_share(self, calling_domain: str, cookie: str,
|
|||
project_version,
|
||||
share_nickname,
|
||||
curr_session,
|
||||
proxy_type)
|
||||
proxy_type,
|
||||
self.server.debug)
|
||||
|
||||
if calling_domain.endswith('.onion') and onion_domain:
|
||||
origin_path_str = 'http://' + onion_domain + users_path
|
||||
|
|
|
|||
|
|
@ -79,12 +79,15 @@ from siteactive import is_online
|
|||
|
||||
def post_to_outbox(self, message_json: {}, version: str,
|
||||
post_to_nickname: str,
|
||||
curr_session, proxy_type: str) -> bool:
|
||||
curr_session, proxy_type: str,
|
||||
debug: bool) -> bool:
|
||||
"""post is received by the outbox
|
||||
Client to server message post
|
||||
https://www.w3.org/TR/activitypub/#client-to-server-outbox-delivery
|
||||
"""
|
||||
if not curr_session:
|
||||
if debug:
|
||||
print('DEBUG: post_to_outbox no curr_session')
|
||||
return False
|
||||
|
||||
if not is_online():
|
||||
|
|
@ -130,7 +133,7 @@ def post_to_outbox(self, message_json: {}, version: str,
|
|||
self.server.person_cache,
|
||||
self.server.allow_deletion,
|
||||
proxy_type, version,
|
||||
self.server.debug,
|
||||
debug,
|
||||
self.server.yt_replace_domain,
|
||||
self.server.twitter_replacement_domain,
|
||||
self.server.show_published_date_only,
|
||||
|
|
@ -214,7 +217,8 @@ def post_to_outbox_thread(self, message_json: {},
|
|||
thread_with_trace(target=post_to_outbox,
|
||||
args=(self, message_json.copy(),
|
||||
self.server.project_version, None,
|
||||
curr_session, proxy_type),
|
||||
curr_session, proxy_type,
|
||||
self.server.debug),
|
||||
daemon=True)
|
||||
print('Starting outbox thread')
|
||||
outbox_thread = \
|
||||
|
|
|
|||
17
outbox.py
17
outbox.py
|
|
@ -19,6 +19,7 @@ from flags import is_featured_writer
|
|||
from flags import is_quote_toot
|
||||
from quote import quote_toots_allowed
|
||||
from timeFunctions import get_account_timezone
|
||||
from utils import resembles_url
|
||||
from utils import get_mutuals_of_person
|
||||
from utils import data_dir
|
||||
from utils import get_post_attachments
|
||||
|
|
@ -333,6 +334,8 @@ def post_message_to_outbox(session, translate: {},
|
|||
if has_object_dict(message_json):
|
||||
# if this is "local only" and it is not local then reject the post
|
||||
if _localonly_not_local(message_json, domain_full):
|
||||
if debug:
|
||||
print('DEBUG: local only message is not local')
|
||||
return False
|
||||
|
||||
# if quote toots are not allowed then reject the post
|
||||
|
|
@ -396,14 +399,21 @@ def post_message_to_outbox(session, translate: {},
|
|||
# actor should be a string
|
||||
actor_url = get_actor_from_post(message_json)
|
||||
if not actor_url:
|
||||
if debug:
|
||||
print('DEBUG: post_message_to_outbox no actor url')
|
||||
return False
|
||||
|
||||
# actor should look like a url
|
||||
if '://' not in actor_url or \
|
||||
'.' not in actor_url:
|
||||
if not resembles_url(actor_url):
|
||||
if debug:
|
||||
print('DEBUG: post_message_to_outbox ' +
|
||||
'actor does not resemble url')
|
||||
return False
|
||||
|
||||
if contains_invalid_actor_url_chars(actor_url):
|
||||
if debug:
|
||||
print('DEBUG: post_message_to_outbox ' +
|
||||
'actor_url contains invalid characters')
|
||||
return False
|
||||
|
||||
# sent by an actor on a local network address?
|
||||
|
|
@ -411,6 +421,9 @@ def post_message_to_outbox(session, translate: {},
|
|||
local_network_pattern_list = get_local_network_addresses()
|
||||
for local_network_pattern in local_network_pattern_list:
|
||||
if local_network_pattern in actor_url:
|
||||
if debug:
|
||||
print('DEBUG: post_message_to_outbox ' +
|
||||
'local network not permitted')
|
||||
return False
|
||||
|
||||
# is the post actor blocked?
|
||||
|
|
|
|||
Loading…
Reference in New Issue