mirror of https://gitlab.com/bashrc2/epicyon
Merge branch 'main' of gitlab.com:bashrc2/epicyon
commit
67c6f284da
224
daemon.py
224
daemon.py
|
@ -500,7 +500,6 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
def handle_error(self, request, client_address):
|
def handle_error(self, request, client_address):
|
||||||
print('ERROR: http server error: ' + str(request) + ', ' +
|
print('ERROR: http server error: ' + str(request) + ', ' +
|
||||||
str(client_address))
|
str(client_address))
|
||||||
pass
|
|
||||||
|
|
||||||
def _send_reply_to_question(self, nickname: str, message_id: str,
|
def _send_reply_to_question(self, nickname: str, message_id: str,
|
||||||
answer: str,
|
answer: str,
|
||||||
|
@ -2439,10 +2438,9 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
self.server.postreq_busy = False
|
self.server.postreq_busy = False
|
||||||
return
|
return
|
||||||
|
|
||||||
def _key_shortcuts(self, path: str,
|
def _key_shortcuts(self, calling_domain: str, cookie: str,
|
||||||
calling_domain: str, cookie: str,
|
|
||||||
base_dir: str, http_prefix: str, nickname: str,
|
base_dir: str, http_prefix: str, nickname: str,
|
||||||
domain: str, domain_full: str, port: int,
|
domain: str, domain_full: str,
|
||||||
onion_domain: str, i2p_domain: str,
|
onion_domain: str, i2p_domain: str,
|
||||||
debug: bool, access_keys: {},
|
debug: bool, access_keys: {},
|
||||||
default_timeline: str) -> None:
|
default_timeline: str) -> None:
|
||||||
|
@ -2529,12 +2527,10 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
self.server.postreq_busy = False
|
self.server.postreq_busy = False
|
||||||
return
|
return
|
||||||
|
|
||||||
def _theme_designer_edit(self, path: str,
|
def _theme_designer_edit(self, calling_domain: str, cookie: str,
|
||||||
calling_domain: str, cookie: str,
|
|
||||||
base_dir: str, http_prefix: str, nickname: str,
|
base_dir: str, http_prefix: str, nickname: str,
|
||||||
domain: str, domain_full: str, port: int,
|
domain: str, domain_full: str,
|
||||||
onion_domain: str, i2p_domain: str,
|
onion_domain: str, i2p_domain: str, debug: bool,
|
||||||
debug: bool, access_keys: {},
|
|
||||||
default_timeline: str, theme_name: str,
|
default_timeline: str, theme_name: str,
|
||||||
allow_local_network_access: bool,
|
allow_local_network_access: bool,
|
||||||
system_language: str,
|
system_language: str,
|
||||||
|
@ -3347,8 +3343,7 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
return
|
return
|
||||||
|
|
||||||
def _unfollow_confirm(self, calling_domain: str, cookie: str,
|
def _unfollow_confirm(self, calling_domain: str, cookie: str,
|
||||||
authorized: bool, path: str,
|
path: str, base_dir: str, http_prefix: str,
|
||||||
base_dir: str, http_prefix: str,
|
|
||||||
domain: str, domain_full: str, port: int,
|
domain: str, domain_full: str, port: int,
|
||||||
onion_domain: str, i2p_domain: str,
|
onion_domain: str, i2p_domain: str,
|
||||||
debug: bool,
|
debug: bool,
|
||||||
|
@ -3430,8 +3425,7 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
}
|
}
|
||||||
path_users_section = path.split('/users/')[1]
|
path_users_section = path.split('/users/')[1]
|
||||||
self.post_to_nickname = path_users_section.split('/')[0]
|
self.post_to_nickname = path_users_section.split('/')[0]
|
||||||
group_account = has_group_type(self.server.base_dir,
|
group_account = has_group_type(base_dir, following_actor,
|
||||||
following_actor,
|
|
||||||
self.server.person_cache)
|
self.server.person_cache)
|
||||||
unfollow_account(self.server.base_dir, self.post_to_nickname,
|
unfollow_account(self.server.base_dir, self.post_to_nickname,
|
||||||
self.server.domain,
|
self.server.domain,
|
||||||
|
@ -3448,8 +3442,7 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
self.server.postreq_busy = False
|
self.server.postreq_busy = False
|
||||||
|
|
||||||
def _follow_confirm(self, calling_domain: str, cookie: str,
|
def _follow_confirm(self, calling_domain: str, cookie: str,
|
||||||
authorized: bool, path: str,
|
path: str, base_dir: str, http_prefix: str,
|
||||||
base_dir: str, http_prefix: str,
|
|
||||||
domain: str, domain_full: str, port: int,
|
domain: str, domain_full: str, port: int,
|
||||||
onion_domain: str, i2p_domain: str,
|
onion_domain: str, i2p_domain: str,
|
||||||
debug: bool,
|
debug: bool,
|
||||||
|
@ -3621,8 +3614,7 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
self.server.postreq_busy = False
|
self.server.postreq_busy = False
|
||||||
|
|
||||||
def _block_confirm(self, calling_domain: str, cookie: str,
|
def _block_confirm(self, calling_domain: str, cookie: str,
|
||||||
authorized: bool, path: str,
|
path: str, base_dir: str, http_prefix: str,
|
||||||
base_dir: str, http_prefix: str,
|
|
||||||
domain: str, domain_full: str, port: int,
|
domain: str, domain_full: str, port: int,
|
||||||
onion_domain: str, i2p_domain: str,
|
onion_domain: str, i2p_domain: str,
|
||||||
debug: bool,
|
debug: bool,
|
||||||
|
@ -3711,8 +3703,7 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
self.server.postreq_busy = False
|
self.server.postreq_busy = False
|
||||||
|
|
||||||
def _unblock_confirm(self, calling_domain: str, cookie: str,
|
def _unblock_confirm(self, calling_domain: str, cookie: str,
|
||||||
authorized: bool, path: str,
|
path: str, base_dir: str, http_prefix: str,
|
||||||
base_dir: str, http_prefix: str,
|
|
||||||
domain: str, domain_full: str, port: int,
|
domain: str, domain_full: str, port: int,
|
||||||
onion_domain: str, i2p_domain: str,
|
onion_domain: str, i2p_domain: str,
|
||||||
debug: bool) -> None:
|
debug: bool) -> None:
|
||||||
|
@ -3805,8 +3796,7 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
domain: str, domain_full: str,
|
domain: str, domain_full: str,
|
||||||
port: int, search_for_emoji: bool,
|
port: int, search_for_emoji: bool,
|
||||||
onion_domain: str, i2p_domain: str,
|
onion_domain: str, i2p_domain: str,
|
||||||
getreq_start_time, getreq_timings: {},
|
getreq_start_time, debug: bool,
|
||||||
debug: bool,
|
|
||||||
curr_session, proxy_type: str) -> None:
|
curr_session, proxy_type: str) -> None:
|
||||||
"""Receive a search query
|
"""Receive a search query
|
||||||
"""
|
"""
|
||||||
|
@ -4338,11 +4328,8 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
self.server.postreq_busy = False
|
self.server.postreq_busy = False
|
||||||
|
|
||||||
def _receive_vote(self, calling_domain: str, cookie: str,
|
def _receive_vote(self, calling_domain: str, cookie: str,
|
||||||
authorized: bool, path: str,
|
path: str, http_prefix: str, domain_full: str,
|
||||||
base_dir: str, http_prefix: str,
|
onion_domain: str, i2p_domain: str, debug: bool,
|
||||||
domain: str, domain_full: str,
|
|
||||||
onion_domain: str, i2p_domain: str,
|
|
||||||
debug: bool,
|
|
||||||
curr_session, proxy_type: str) -> None:
|
curr_session, proxy_type: str) -> None:
|
||||||
"""Receive a vote via POST
|
"""Receive a vote via POST
|
||||||
"""
|
"""
|
||||||
|
@ -4425,13 +4412,8 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
self.server.postreq_busy = False
|
self.server.postreq_busy = False
|
||||||
return
|
return
|
||||||
|
|
||||||
def _receive_image(self, length: int,
|
def _receive_image(self, length: int, path: str, base_dir: str,
|
||||||
calling_domain: str, cookie: str,
|
domain: str, debug: bool) -> None:
|
||||||
authorized: bool, path: str,
|
|
||||||
base_dir: str, http_prefix: str,
|
|
||||||
domain: str, domain_full: str,
|
|
||||||
onion_domain: str, i2p_domain: str,
|
|
||||||
debug: bool) -> None:
|
|
||||||
"""Receives an image via POST
|
"""Receives an image via POST
|
||||||
"""
|
"""
|
||||||
if not self.outbox_authenticated:
|
if not self.outbox_authenticated:
|
||||||
|
@ -4491,8 +4473,7 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
def _remove_share(self, calling_domain: str, cookie: str,
|
def _remove_share(self, calling_domain: str, cookie: str,
|
||||||
authorized: bool, path: str,
|
authorized: bool, path: str,
|
||||||
base_dir: str, http_prefix: str,
|
base_dir: str, http_prefix: str,
|
||||||
domain: str, domain_full: str,
|
domain_full: str, onion_domain: str, i2p_domain: str,
|
||||||
onion_domain: str, i2p_domain: str,
|
|
||||||
debug: bool) -> None:
|
debug: bool) -> None:
|
||||||
"""Removes a shared item
|
"""Removes a shared item
|
||||||
"""
|
"""
|
||||||
|
@ -4564,8 +4545,7 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
def _remove_wanted(self, calling_domain: str, cookie: str,
|
def _remove_wanted(self, calling_domain: str, cookie: str,
|
||||||
authorized: bool, path: str,
|
authorized: bool, path: str,
|
||||||
base_dir: str, http_prefix: str,
|
base_dir: str, http_prefix: str,
|
||||||
domain: str, domain_full: str,
|
domain_full: str, onion_domain: str, i2p_domain: str,
|
||||||
onion_domain: str, i2p_domain: str,
|
|
||||||
debug: bool) -> None:
|
debug: bool) -> None:
|
||||||
"""Removes a wanted item
|
"""Removes a wanted item
|
||||||
"""
|
"""
|
||||||
|
@ -4635,8 +4615,7 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
self.server.postreq_busy = False
|
self.server.postreq_busy = False
|
||||||
|
|
||||||
def _receive_remove_post(self, calling_domain: str, cookie: str,
|
def _receive_remove_post(self, calling_domain: str, cookie: str,
|
||||||
authorized: bool, path: str,
|
path: str, base_dir: str, http_prefix: str,
|
||||||
base_dir: str, http_prefix: str,
|
|
||||||
domain: str, domain_full: str,
|
domain: str, domain_full: str,
|
||||||
onion_domain: str, i2p_domain: str,
|
onion_domain: str, i2p_domain: str,
|
||||||
debug: bool,
|
debug: bool,
|
||||||
|
@ -4743,10 +4722,7 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
self.server.postreq_busy = False
|
self.server.postreq_busy = False
|
||||||
|
|
||||||
def _links_update(self, calling_domain: str, cookie: str,
|
def _links_update(self, calling_domain: str, cookie: str,
|
||||||
authorized: bool, path: str,
|
path: str, base_dir: str, debug: bool,
|
||||||
base_dir: str, http_prefix: str,
|
|
||||||
domain: str, domain_full: str,
|
|
||||||
onion_domain: str, i2p_domain: str, debug: bool,
|
|
||||||
default_timeline: str,
|
default_timeline: str,
|
||||||
allow_local_network_access: bool) -> None:
|
allow_local_network_access: bool) -> None:
|
||||||
"""Updates the left links column of the timeline
|
"""Updates the left links column of the timeline
|
||||||
|
@ -4890,12 +4866,8 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
self.server.postreq_busy = False
|
self.server.postreq_busy = False
|
||||||
|
|
||||||
def _set_hashtag_category(self, calling_domain: str, cookie: str,
|
def _set_hashtag_category(self, calling_domain: str, cookie: str,
|
||||||
authorized: bool, path: str,
|
path: str, base_dir: str,
|
||||||
base_dir: str, http_prefix: str,
|
domain: str, debug: bool) -> None:
|
||||||
domain: str, domain_full: str,
|
|
||||||
onion_domain: str, i2p_domain: str, debug: bool,
|
|
||||||
default_timeline: str,
|
|
||||||
allow_local_network_access: bool) -> None:
|
|
||||||
"""On the screen after selecting a hashtag from the swarm, this sets
|
"""On the screen after selecting a hashtag from the swarm, this sets
|
||||||
the category for that tag
|
the category for that tag
|
||||||
"""
|
"""
|
||||||
|
@ -4993,10 +4965,8 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
self.server.postreq_busy = False
|
self.server.postreq_busy = False
|
||||||
|
|
||||||
def _newswire_update(self, calling_domain: str, cookie: str,
|
def _newswire_update(self, calling_domain: str, cookie: str,
|
||||||
authorized: bool, path: str,
|
path: str, base_dir: str,
|
||||||
base_dir: str, http_prefix: str,
|
domain: str, debug: bool,
|
||||||
domain: str, domain_full: str,
|
|
||||||
onion_domain: str, i2p_domain: str, debug: bool,
|
|
||||||
default_timeline: str) -> None:
|
default_timeline: str) -> None:
|
||||||
"""Updates the right newswire column of the timeline
|
"""Updates the right newswire column of the timeline
|
||||||
"""
|
"""
|
||||||
|
@ -5153,11 +5123,8 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
self.server.postreq_busy = False
|
self.server.postreq_busy = False
|
||||||
|
|
||||||
def _citations_update(self, calling_domain: str, cookie: str,
|
def _citations_update(self, calling_domain: str, cookie: str,
|
||||||
authorized: bool, path: str,
|
path: str, base_dir: str,
|
||||||
base_dir: str, http_prefix: str,
|
domain: str, debug: bool,
|
||||||
domain: str, domain_full: str,
|
|
||||||
onion_domain: str, i2p_domain: str, debug: bool,
|
|
||||||
default_timeline: str,
|
|
||||||
newswire: {}) -> None:
|
newswire: {}) -> None:
|
||||||
"""Updates the citations for a blog post after hitting
|
"""Updates the citations for a blog post after hitting
|
||||||
update button on the citations screen
|
update button on the citations screen
|
||||||
|
@ -5247,11 +5214,8 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
self.server.postreq_busy = False
|
self.server.postreq_busy = False
|
||||||
|
|
||||||
def _news_post_edit(self, calling_domain: str, cookie: str,
|
def _news_post_edit(self, calling_domain: str, cookie: str,
|
||||||
authorized: bool, path: str,
|
path: str, base_dir: str,
|
||||||
base_dir: str, http_prefix: str,
|
domain: str, debug: bool) -> None:
|
||||||
domain: str, domain_full: str,
|
|
||||||
onion_domain: str, i2p_domain: str, debug: bool,
|
|
||||||
default_timeline: str) -> None:
|
|
||||||
"""edits a news post after receiving POST
|
"""edits a news post after receiving POST
|
||||||
"""
|
"""
|
||||||
users_path = path.replace('/newseditdata', '')
|
users_path = path.replace('/newseditdata', '')
|
||||||
|
@ -5384,8 +5348,7 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
self.server.postreq_busy = False
|
self.server.postreq_busy = False
|
||||||
|
|
||||||
def _profile_edit(self, calling_domain: str, cookie: str,
|
def _profile_edit(self, calling_domain: str, cookie: str,
|
||||||
authorized: bool, path: str,
|
path: str, base_dir: str, http_prefix: str,
|
||||||
base_dir: str, http_prefix: str,
|
|
||||||
domain: str, domain_full: str,
|
domain: str, domain_full: str,
|
||||||
onion_domain: str, i2p_domain: str,
|
onion_domain: str, i2p_domain: str,
|
||||||
debug: bool, allow_local_network_access: bool,
|
debug: bool, allow_local_network_access: bool,
|
||||||
|
@ -5884,9 +5847,9 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
if fields.get('customSubmitText'):
|
if fields.get('customSubmitText'):
|
||||||
if fields['customSubmitText'] != \
|
if fields['customSubmitText'] != \
|
||||||
curr_custom_submit_text:
|
curr_custom_submit_text:
|
||||||
customText = fields['customSubmitText']
|
custom_text = fields['customSubmitText']
|
||||||
set_config_param(base_dir, 'customSubmitText',
|
set_config_param(base_dir, 'customSubmitText',
|
||||||
customText)
|
custom_text)
|
||||||
else:
|
else:
|
||||||
if curr_custom_submit_text:
|
if curr_custom_submit_text:
|
||||||
set_config_param(base_dir, 'customSubmitText',
|
set_config_param(base_dir, 'customSubmitText',
|
||||||
|
@ -7305,7 +7268,7 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
save_json(actor_json, actor_filename)
|
save_json(actor_json, actor_filename)
|
||||||
webfinger_update(base_dir,
|
webfinger_update(base_dir,
|
||||||
nickname, domain,
|
nickname, domain,
|
||||||
onion_domain,
|
onion_domain, i2p_domain,
|
||||||
self.server.cached_webfingers)
|
self.server.cached_webfingers)
|
||||||
# also copy to the actors cache and
|
# also copy to the actors cache and
|
||||||
# person_cache in memory
|
# person_cache in memory
|
||||||
|
@ -7597,8 +7560,7 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
None, calling_domain, False)
|
None, calling_domain, False)
|
||||||
self._write(msg)
|
self._write(msg)
|
||||||
|
|
||||||
def _get_exported_theme(self, calling_domain: str, path: str,
|
def _get_exported_theme(self, path: str, base_dir: str, domain_full: str,
|
||||||
base_dir: str, domain_full: str,
|
|
||||||
debug: bool) -> None:
|
debug: bool) -> None:
|
||||||
"""Returns an exported theme zip file
|
"""Returns an exported theme zip file
|
||||||
"""
|
"""
|
||||||
|
@ -7684,8 +7646,7 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
print('font not found: ' + path + ' ' + calling_domain)
|
print('font not found: ' + path + ' ' + calling_domain)
|
||||||
self._404()
|
self._404()
|
||||||
|
|
||||||
def _get_rss2feed(self, authorized: bool,
|
def _get_rss2feed(self, calling_domain: str, path: str,
|
||||||
calling_domain: str, path: str,
|
|
||||||
base_dir: str, http_prefix: str,
|
base_dir: str, http_prefix: str,
|
||||||
domain: str, port: int, proxy_type: str,
|
domain: str, port: int, proxy_type: str,
|
||||||
getreq_start_time,
|
getreq_start_time,
|
||||||
|
@ -7734,8 +7695,7 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
path + ' ' + calling_domain)
|
path + ' ' + calling_domain)
|
||||||
self._404()
|
self._404()
|
||||||
|
|
||||||
def _get_rss2site(self, authorized: bool,
|
def _get_rss2site(self, calling_domain: str, path: str,
|
||||||
calling_domain: str, path: str,
|
|
||||||
base_dir: str, http_prefix: str,
|
base_dir: str, http_prefix: str,
|
||||||
domain_full: str, port: int, proxy_type: str,
|
domain_full: str, port: int, proxy_type: str,
|
||||||
translate: {},
|
translate: {},
|
||||||
|
@ -7792,8 +7752,7 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
path + ' ' + calling_domain)
|
path + ' ' + calling_domain)
|
||||||
self._404()
|
self._404()
|
||||||
|
|
||||||
def _get_newswire_feed(self, authorized: bool,
|
def _get_newswire_feed(self, calling_domain: str, path: str,
|
||||||
calling_domain: str, path: str,
|
|
||||||
base_dir: str, http_prefix: str,
|
base_dir: str, http_prefix: str,
|
||||||
domain: str, port: int, proxy_type: str,
|
domain: str, port: int, proxy_type: str,
|
||||||
getreq_start_time,
|
getreq_start_time,
|
||||||
|
@ -14827,11 +14786,6 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
if '/users/' in path and path.endswith('/editprofile'):
|
if '/users/' in path and path.endswith('/editprofile'):
|
||||||
peertube_instances = self.server.peertube_instances
|
peertube_instances = self.server.peertube_instances
|
||||||
nickname = get_nickname_from_actor(path)
|
nickname = get_nickname_from_actor(path)
|
||||||
if nickname:
|
|
||||||
city = get_spoofed_city(self.server.city,
|
|
||||||
base_dir, nickname, domain)
|
|
||||||
else:
|
|
||||||
city = self.server.city
|
|
||||||
|
|
||||||
access_keys = self.server.access_keys
|
access_keys = self.server.access_keys
|
||||||
if '/users/' in path:
|
if '/users/' in path:
|
||||||
|
@ -14839,17 +14793,12 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
access_keys = self.server.key_shortcuts[nickname]
|
access_keys = self.server.key_shortcuts[nickname]
|
||||||
|
|
||||||
default_reply_interval_hrs = self.server.default_reply_interval_hrs
|
default_reply_interval_hrs = self.server.default_reply_interval_hrs
|
||||||
msg = html_edit_profile(self.server, self.server.css_cache,
|
msg = html_edit_profile(self.server, translate,
|
||||||
translate,
|
base_dir, path, domain, port,
|
||||||
base_dir,
|
|
||||||
path, domain,
|
|
||||||
port,
|
|
||||||
http_prefix,
|
|
||||||
self.server.default_timeline,
|
self.server.default_timeline,
|
||||||
self.server.theme_name,
|
self.server.theme_name,
|
||||||
peertube_instances,
|
peertube_instances,
|
||||||
self.server.text_mode_banner,
|
self.server.text_mode_banner,
|
||||||
city,
|
|
||||||
self.server.user_agents_blocked,
|
self.server.user_agents_blocked,
|
||||||
self.server.crawlers_allowed,
|
self.server.crawlers_allowed,
|
||||||
access_keys,
|
access_keys,
|
||||||
|
@ -15605,7 +15554,7 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
return
|
return
|
||||||
|
|
||||||
if authorized and '/exports/' in self.path:
|
if authorized and '/exports/' in self.path:
|
||||||
self._get_exported_theme(calling_domain, self.path,
|
self._get_exported_theme(self.path,
|
||||||
self.server.base_dir,
|
self.server.base_dir,
|
||||||
self.server.domain_full,
|
self.server.domain_full,
|
||||||
self.server.debug)
|
self.server.debug)
|
||||||
|
@ -15651,8 +15600,7 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
return
|
return
|
||||||
|
|
||||||
if self.path == '/newswire.xml':
|
if self.path == '/newswire.xml':
|
||||||
self._get_newswire_feed(authorized,
|
self._get_newswire_feed(calling_domain, self.path,
|
||||||
calling_domain, self.path,
|
|
||||||
self.server.base_dir,
|
self.server.base_dir,
|
||||||
self.server.http_prefix,
|
self.server.http_prefix,
|
||||||
self.server.domain,
|
self.server.domain,
|
||||||
|
@ -15667,8 +15615,7 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
if self.path.startswith('/blog/') and \
|
if self.path.startswith('/blog/') and \
|
||||||
self.path.endswith('/rss.xml'):
|
self.path.endswith('/rss.xml'):
|
||||||
if not self.path == '/blog/rss.xml':
|
if not self.path == '/blog/rss.xml':
|
||||||
self._get_rss2feed(authorized,
|
self._get_rss2feed(calling_domain, self.path,
|
||||||
calling_domain, self.path,
|
|
||||||
self.server.base_dir,
|
self.server.base_dir,
|
||||||
self.server.http_prefix,
|
self.server.http_prefix,
|
||||||
self.server.domain,
|
self.server.domain,
|
||||||
|
@ -15678,8 +15625,7 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
self.server.debug,
|
self.server.debug,
|
||||||
curr_session)
|
curr_session)
|
||||||
else:
|
else:
|
||||||
self._get_rss2site(authorized,
|
self._get_rss2site(calling_domain, self.path,
|
||||||
calling_domain, self.path,
|
|
||||||
self.server.base_dir,
|
self.server.base_dir,
|
||||||
self.server.http_prefix,
|
self.server.http_prefix,
|
||||||
self.server.domain_full,
|
self.server.domain_full,
|
||||||
|
@ -18703,7 +18649,6 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
def _receive_new_post_process(self, post_type: str, path: str, headers: {},
|
def _receive_new_post_process(self, post_type: str, path: str, headers: {},
|
||||||
length: int, post_bytes, boundary: str,
|
length: int, post_bytes, boundary: str,
|
||||||
calling_domain: str, cookie: str,
|
calling_domain: str, cookie: str,
|
||||||
authorized: bool,
|
|
||||||
content_license_url: str,
|
content_license_url: str,
|
||||||
curr_session, proxy_type: str) -> int:
|
curr_session, proxy_type: str) -> int:
|
||||||
# Note: this needs to happen synchronously
|
# Note: this needs to happen synchronously
|
||||||
|
@ -19563,7 +19508,6 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
|
|
||||||
def _receive_new_post(self, post_type: str, path: str,
|
def _receive_new_post(self, post_type: str, path: str,
|
||||||
calling_domain: str, cookie: str,
|
calling_domain: str, cookie: str,
|
||||||
authorized: bool,
|
|
||||||
content_license_url: str,
|
content_license_url: str,
|
||||||
curr_session, proxy_type: str) -> int:
|
curr_session, proxy_type: str) -> int:
|
||||||
"""A new post has been created
|
"""A new post has been created
|
||||||
|
@ -19668,7 +19612,6 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
path, headers, length,
|
path, headers, length,
|
||||||
post_bytes, boundary,
|
post_bytes, boundary,
|
||||||
calling_domain, cookie,
|
calling_domain, cookie,
|
||||||
authorized,
|
|
||||||
content_license_url,
|
content_license_url,
|
||||||
curr_session, proxy_type)
|
curr_session, proxy_type)
|
||||||
return page_number
|
return page_number
|
||||||
|
@ -19976,23 +19919,17 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
|
|
||||||
if authorized and self.path.endswith('/sethashtagcategory'):
|
if authorized and self.path.endswith('/sethashtagcategory'):
|
||||||
self._set_hashtag_category(calling_domain, cookie,
|
self._set_hashtag_category(calling_domain, cookie,
|
||||||
authorized, self.path,
|
self.path,
|
||||||
self.server.base_dir,
|
self.server.base_dir,
|
||||||
self.server.http_prefix,
|
|
||||||
self.server.domain,
|
self.server.domain,
|
||||||
self.server.domain_full,
|
self.server.debug)
|
||||||
self.server.onion_domain,
|
|
||||||
self.server.i2p_domain,
|
|
||||||
self.server.debug,
|
|
||||||
self.server.default_timeline,
|
|
||||||
self.server.allow_local_network_access)
|
|
||||||
self.server.postreq_busy = False
|
self.server.postreq_busy = False
|
||||||
return
|
return
|
||||||
|
|
||||||
# update of profile/avatar from web interface,
|
# update of profile/avatar from web interface,
|
||||||
# after selecting Edit button then Submit
|
# after selecting Edit button then Submit
|
||||||
if authorized and self.path.endswith('/profiledata'):
|
if authorized and self.path.endswith('/profiledata'):
|
||||||
self._profile_edit(calling_domain, cookie, authorized, self.path,
|
self._profile_edit(calling_domain, cookie, self.path,
|
||||||
self.server.base_dir, self.server.http_prefix,
|
self.server.base_dir, self.server.http_prefix,
|
||||||
self.server.domain,
|
self.server.domain,
|
||||||
self.server.domain_full,
|
self.server.domain_full,
|
||||||
|
@ -20007,12 +19944,8 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
return
|
return
|
||||||
|
|
||||||
if authorized and self.path.endswith('/linksdata'):
|
if authorized and self.path.endswith('/linksdata'):
|
||||||
self._links_update(calling_domain, cookie, authorized, self.path,
|
self._links_update(calling_domain, cookie, self.path,
|
||||||
self.server.base_dir, self.server.http_prefix,
|
self.server.base_dir, self.server.debug,
|
||||||
self.server.domain,
|
|
||||||
self.server.domain_full,
|
|
||||||
self.server.onion_domain,
|
|
||||||
self.server.i2p_domain, self.server.debug,
|
|
||||||
self.server.default_timeline,
|
self.server.default_timeline,
|
||||||
self.server.allow_local_network_access)
|
self.server.allow_local_network_access)
|
||||||
self.server.postreq_busy = False
|
self.server.postreq_busy = False
|
||||||
|
@ -20020,39 +19953,28 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
|
|
||||||
if authorized and self.path.endswith('/newswiredata'):
|
if authorized and self.path.endswith('/newswiredata'):
|
||||||
self._newswire_update(calling_domain, cookie,
|
self._newswire_update(calling_domain, cookie,
|
||||||
authorized, self.path,
|
self.path,
|
||||||
self.server.base_dir,
|
self.server.base_dir,
|
||||||
self.server.http_prefix,
|
self.server.domain, self.server.debug,
|
||||||
self.server.domain,
|
|
||||||
self.server.domain_full,
|
|
||||||
self.server.onion_domain,
|
|
||||||
self.server.i2p_domain, self.server.debug,
|
|
||||||
self.server.default_timeline)
|
self.server.default_timeline)
|
||||||
self.server.postreq_busy = False
|
self.server.postreq_busy = False
|
||||||
return
|
return
|
||||||
|
|
||||||
if authorized and self.path.endswith('/citationsdata'):
|
if authorized and self.path.endswith('/citationsdata'):
|
||||||
self._citations_update(calling_domain, cookie,
|
self._citations_update(calling_domain, cookie,
|
||||||
authorized, self.path,
|
self.path,
|
||||||
self.server.base_dir,
|
self.server.base_dir,
|
||||||
self.server.http_prefix,
|
|
||||||
self.server.domain,
|
self.server.domain,
|
||||||
self.server.domain_full,
|
self.server.debug,
|
||||||
self.server.onion_domain,
|
|
||||||
self.server.i2p_domain, self.server.debug,
|
|
||||||
self.server.default_timeline,
|
|
||||||
self.server.newswire)
|
self.server.newswire)
|
||||||
self.server.postreq_busy = False
|
self.server.postreq_busy = False
|
||||||
return
|
return
|
||||||
|
|
||||||
if authorized and self.path.endswith('/newseditdata'):
|
if authorized and self.path.endswith('/newseditdata'):
|
||||||
self._news_post_edit(calling_domain, cookie, authorized, self.path,
|
self._news_post_edit(calling_domain, cookie, self.path,
|
||||||
self.server.base_dir, self.server.http_prefix,
|
self.server.base_dir,
|
||||||
self.server.domain,
|
self.server.domain,
|
||||||
self.server.domain_full,
|
self.server.debug)
|
||||||
self.server.onion_domain,
|
|
||||||
self.server.i2p_domain, self.server.debug,
|
|
||||||
self.server.default_timeline)
|
|
||||||
self.server.postreq_busy = False
|
self.server.postreq_busy = False
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@ -20110,7 +20032,7 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
search_for_emoji,
|
search_for_emoji,
|
||||||
self.server.onion_domain,
|
self.server.onion_domain,
|
||||||
self.server.i2p_domain,
|
self.server.i2p_domain,
|
||||||
postreq_start_time, {},
|
postreq_start_time,
|
||||||
self.server.debug,
|
self.server.debug,
|
||||||
curr_session,
|
curr_session,
|
||||||
proxy_type)
|
proxy_type)
|
||||||
|
@ -20133,10 +20055,8 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
if self.path.endswith('/question') or \
|
if self.path.endswith('/question') or \
|
||||||
'/question?page=' in self.path:
|
'/question?page=' in self.path:
|
||||||
self._receive_vote(calling_domain, cookie,
|
self._receive_vote(calling_domain, cookie,
|
||||||
authorized, self.path,
|
self.path,
|
||||||
self.server.base_dir,
|
|
||||||
self.server.http_prefix,
|
self.server.http_prefix,
|
||||||
self.server.domain,
|
|
||||||
self.server.domain_full,
|
self.server.domain_full,
|
||||||
self.server.onion_domain,
|
self.server.onion_domain,
|
||||||
self.server.i2p_domain,
|
self.server.i2p_domain,
|
||||||
|
@ -20152,7 +20072,6 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
authorized, self.path,
|
authorized, self.path,
|
||||||
self.server.base_dir,
|
self.server.base_dir,
|
||||||
self.server.http_prefix,
|
self.server.http_prefix,
|
||||||
self.server.domain,
|
|
||||||
self.server.domain_full,
|
self.server.domain_full,
|
||||||
self.server.onion_domain,
|
self.server.onion_domain,
|
||||||
self.server.i2p_domain,
|
self.server.i2p_domain,
|
||||||
|
@ -20166,7 +20085,6 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
authorized, self.path,
|
authorized, self.path,
|
||||||
self.server.base_dir,
|
self.server.base_dir,
|
||||||
self.server.http_prefix,
|
self.server.http_prefix,
|
||||||
self.server.domain,
|
|
||||||
self.server.domain_full,
|
self.server.domain_full,
|
||||||
self.server.onion_domain,
|
self.server.onion_domain,
|
||||||
self.server.i2p_domain,
|
self.server.i2p_domain,
|
||||||
|
@ -20188,7 +20106,7 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
return
|
return
|
||||||
if self.path.endswith('/rmpost'):
|
if self.path.endswith('/rmpost'):
|
||||||
self._receive_remove_post(calling_domain, cookie,
|
self._receive_remove_post(calling_domain, cookie,
|
||||||
authorized, self.path,
|
self.path,
|
||||||
self.server.base_dir,
|
self.server.base_dir,
|
||||||
self.server.http_prefix,
|
self.server.http_prefix,
|
||||||
self.server.domain,
|
self.server.domain,
|
||||||
|
@ -20207,7 +20125,7 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
# decision to follow in the web interface is confirmed
|
# decision to follow in the web interface is confirmed
|
||||||
if self.path.endswith('/followconfirm'):
|
if self.path.endswith('/followconfirm'):
|
||||||
self._follow_confirm(calling_domain, cookie,
|
self._follow_confirm(calling_domain, cookie,
|
||||||
authorized, self.path,
|
self.path,
|
||||||
self.server.base_dir,
|
self.server.base_dir,
|
||||||
self.server.http_prefix,
|
self.server.http_prefix,
|
||||||
self.server.domain,
|
self.server.domain,
|
||||||
|
@ -20228,7 +20146,7 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
# decision to unfollow in the web interface is confirmed
|
# decision to unfollow in the web interface is confirmed
|
||||||
if self.path.endswith('/unfollowconfirm'):
|
if self.path.endswith('/unfollowconfirm'):
|
||||||
self._unfollow_confirm(calling_domain, cookie,
|
self._unfollow_confirm(calling_domain, cookie,
|
||||||
authorized, self.path,
|
self.path,
|
||||||
self.server.base_dir,
|
self.server.base_dir,
|
||||||
self.server.http_prefix,
|
self.server.http_prefix,
|
||||||
self.server.domain,
|
self.server.domain,
|
||||||
|
@ -20248,7 +20166,7 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
# decision to unblock in the web interface is confirmed
|
# decision to unblock in the web interface is confirmed
|
||||||
if self.path.endswith('/unblockconfirm'):
|
if self.path.endswith('/unblockconfirm'):
|
||||||
self._unblock_confirm(calling_domain, cookie,
|
self._unblock_confirm(calling_domain, cookie,
|
||||||
authorized, self.path,
|
self.path,
|
||||||
self.server.base_dir,
|
self.server.base_dir,
|
||||||
self.server.http_prefix,
|
self.server.http_prefix,
|
||||||
self.server.domain,
|
self.server.domain,
|
||||||
|
@ -20267,7 +20185,7 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
# decision to block in the web interface is confirmed
|
# decision to block in the web interface is confirmed
|
||||||
if self.path.endswith('/blockconfirm'):
|
if self.path.endswith('/blockconfirm'):
|
||||||
self._block_confirm(calling_domain, cookie,
|
self._block_confirm(calling_domain, cookie,
|
||||||
authorized, self.path,
|
self.path,
|
||||||
self.server.base_dir,
|
self.server.base_dir,
|
||||||
self.server.http_prefix,
|
self.server.http_prefix,
|
||||||
self.server.domain,
|
self.server.domain,
|
||||||
|
@ -20315,14 +20233,12 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
self.server.key_shortcuts[nickname] = access_keys.copy()
|
self.server.key_shortcuts[nickname] = access_keys.copy()
|
||||||
access_keys = self.server.key_shortcuts[nickname]
|
access_keys = self.server.key_shortcuts[nickname]
|
||||||
|
|
||||||
self._key_shortcuts(self.path,
|
self._key_shortcuts(calling_domain, cookie,
|
||||||
calling_domain, cookie,
|
|
||||||
self.server.base_dir,
|
self.server.base_dir,
|
||||||
self.server.http_prefix,
|
self.server.http_prefix,
|
||||||
nickname,
|
nickname,
|
||||||
self.server.domain,
|
self.server.domain,
|
||||||
self.server.domain_full,
|
self.server.domain_full,
|
||||||
self.server.port,
|
|
||||||
self.server.onion_domain,
|
self.server.onion_domain,
|
||||||
self.server.i2p_domain,
|
self.server.i2p_domain,
|
||||||
self.server.debug,
|
self.server.debug,
|
||||||
|
@ -20345,18 +20261,15 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
allow_local_network_access = \
|
allow_local_network_access = \
|
||||||
self.server.allow_local_network_access
|
self.server.allow_local_network_access
|
||||||
|
|
||||||
self._theme_designer_edit(self.path,
|
self._theme_designer_edit(calling_domain, cookie,
|
||||||
calling_domain, cookie,
|
|
||||||
self.server.base_dir,
|
self.server.base_dir,
|
||||||
self.server.http_prefix,
|
self.server.http_prefix,
|
||||||
nickname,
|
nickname,
|
||||||
self.server.domain,
|
self.server.domain,
|
||||||
self.server.domain_full,
|
self.server.domain_full,
|
||||||
self.server.port,
|
|
||||||
self.server.onion_domain,
|
self.server.onion_domain,
|
||||||
self.server.i2p_domain,
|
self.server.i2p_domain,
|
||||||
self.server.debug,
|
self.server.debug,
|
||||||
access_keys,
|
|
||||||
self.server.default_timeline,
|
self.server.default_timeline,
|
||||||
self.server.theme_name,
|
self.server.theme_name,
|
||||||
allow_local_network_access,
|
allow_local_network_access,
|
||||||
|
@ -20431,7 +20344,6 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
page_number = \
|
page_number = \
|
||||||
self._receive_new_post(curr_post_type, self.path,
|
self._receive_new_post(curr_post_type, self.path,
|
||||||
calling_domain, cookie,
|
calling_domain, cookie,
|
||||||
authorized,
|
|
||||||
self.server.content_license_url,
|
self.server.content_license_url,
|
||||||
curr_session, proxy_type)
|
curr_session, proxy_type)
|
||||||
if page_number:
|
if page_number:
|
||||||
|
@ -20530,14 +20442,9 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
# receive images to the outbox
|
# receive images to the outbox
|
||||||
if self.headers['Content-type'].startswith('image/') and \
|
if self.headers['Content-type'].startswith('image/') and \
|
||||||
users_in_path:
|
users_in_path:
|
||||||
self._receive_image(length, calling_domain, cookie,
|
self._receive_image(length, self.path,
|
||||||
authorized, self.path,
|
|
||||||
self.server.base_dir,
|
self.server.base_dir,
|
||||||
self.server.http_prefix,
|
|
||||||
self.server.domain,
|
self.server.domain,
|
||||||
self.server.domain_full,
|
|
||||||
self.server.onion_domain,
|
|
||||||
self.server.i2p_domain,
|
|
||||||
self.server.debug)
|
self.server.debug)
|
||||||
self.server.postreq_busy = False
|
self.server.postreq_busy = False
|
||||||
return
|
return
|
||||||
|
@ -20735,7 +20642,7 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
self._update_inbox_queue(self.post_to_nickname,
|
self._update_inbox_queue(self.post_to_nickname,
|
||||||
message_json, message_bytes,
|
message_json, message_bytes,
|
||||||
self.server.debug)
|
self.server.debug)
|
||||||
if queue_status >= 0 and queue_status <= 3:
|
if queue_status in range(0, 4):
|
||||||
self.server.postreq_busy = False
|
self.server.postreq_busy = False
|
||||||
return
|
return
|
||||||
if self.server.debug:
|
if self.server.debug:
|
||||||
|
@ -20756,7 +20663,7 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
self._update_inbox_queue('inbox', message_json,
|
self._update_inbox_queue('inbox', message_json,
|
||||||
message_bytes,
|
message_bytes,
|
||||||
self.server.debug)
|
self.server.debug)
|
||||||
if queue_status >= 0 and queue_status <= 3:
|
if queue_status in range(0, 4):
|
||||||
self.server.postreq_busy = False
|
self.server.postreq_busy = False
|
||||||
return
|
return
|
||||||
self._200()
|
self._200()
|
||||||
|
@ -20774,7 +20681,6 @@ class EpicyonServer(ThreadingHTTPServer):
|
||||||
if cls is ConnectionResetError:
|
if cls is ConnectionResetError:
|
||||||
if e_ret.errno != errno.ECONNRESET:
|
if e_ret.errno != errno.ECONNRESET:
|
||||||
print('ERROR: (EpicyonServer) ' + str(cls) + ", " + str(e_ret))
|
print('ERROR: (EpicyonServer) ' + str(cls) + ", " + str(e_ret))
|
||||||
pass
|
|
||||||
elif cls is BrokenPipeError:
|
elif cls is BrokenPipeError:
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -635,7 +635,7 @@ def get_this_weeks_events(base_dir: str, nickname: str, domain: str) -> {}:
|
||||||
event_time = \
|
event_time = \
|
||||||
datetime.strptime(tag['startTime'],
|
datetime.strptime(tag['startTime'],
|
||||||
"%Y-%m-%dT%H:%M:%S%z")
|
"%Y-%m-%dT%H:%M:%S%z")
|
||||||
if event_time >= now and event_time <= end_of_week:
|
if now <= event_time <= end_of_week:
|
||||||
week_day_index = (event_time - now).days()
|
week_day_index = (event_time - now).days()
|
||||||
post_event.append(tag)
|
post_event.append(tag)
|
||||||
else:
|
else:
|
||||||
|
|
2
tests.py
2
tests.py
|
@ -3374,7 +3374,7 @@ def test_client_to_server(base_dir: str):
|
||||||
cached_webfingers,
|
cached_webfingers,
|
||||||
person_cache, True, __version__,
|
person_cache, True, __version__,
|
||||||
signing_priv_key_pem)
|
signing_priv_key_pem)
|
||||||
for _ in range(20):
|
for _ in range(30):
|
||||||
if os.path.isdir(outbox_path) and os.path.isdir(inbox_path):
|
if os.path.isdir(outbox_path) and os.path.isdir(inbox_path):
|
||||||
if len([name for name in os.listdir(outbox_path)
|
if len([name for name in os.listdir(outbox_path)
|
||||||
if os.path.isfile(os.path.join(outbox_path, name))]) == 4:
|
if os.path.isfile(os.path.join(outbox_path, name))]) == 4:
|
||||||
|
|
|
@ -1646,8 +1646,7 @@ def _html_edit_profile_git_projects(base_dir: str, nickname: str, domain: str,
|
||||||
return edit_profile_form
|
return edit_profile_form
|
||||||
|
|
||||||
|
|
||||||
def _html_edit_profile_shared_items(base_dir: str, nickname: str, domain: str,
|
def _html_edit_profile_shared_items(base_dir: str, translate: {}) -> str:
|
||||||
translate: {}) -> str:
|
|
||||||
"""shared items section of edit profile screen
|
"""shared items section of edit profile screen
|
||||||
"""
|
"""
|
||||||
shared_items_str = ''
|
shared_items_str = ''
|
||||||
|
@ -2189,12 +2188,12 @@ def _html_edit_profile_top_banner(base_dir: str,
|
||||||
return edit_profile_form
|
return edit_profile_form
|
||||||
|
|
||||||
|
|
||||||
def html_edit_profile(server, css_cache: {}, translate: {},
|
def html_edit_profile(server, translate: {},
|
||||||
base_dir: str, path: str,
|
base_dir: str, path: str,
|
||||||
domain: str, port: int, http_prefix: str,
|
domain: str, port: int,
|
||||||
default_timeline: str, theme: str,
|
default_timeline: str, theme: str,
|
||||||
peertube_instances: [],
|
peertube_instances: [],
|
||||||
text_mode_banner: str, city: str,
|
text_mode_banner: str,
|
||||||
user_agents_blocked: [],
|
user_agents_blocked: [],
|
||||||
crawlers_allowed: [],
|
crawlers_allowed: [],
|
||||||
access_keys: {},
|
access_keys: {},
|
||||||
|
@ -2328,8 +2327,7 @@ def html_edit_profile(server, css_cache: {}, translate: {},
|
||||||
_html_edit_profile_twitter(base_dir, translate, remove_twitter)
|
_html_edit_profile_twitter(base_dir, translate, remove_twitter)
|
||||||
# shared items section
|
# shared items section
|
||||||
shares_federation_str = \
|
shares_federation_str = \
|
||||||
_html_edit_profile_shared_items(base_dir, nickname,
|
_html_edit_profile_shared_items(base_dir, translate)
|
||||||
domain, translate)
|
|
||||||
instance_str, role_assign_str, peertube_str, libretranslate_str = \
|
instance_str, role_assign_str, peertube_str, libretranslate_str = \
|
||||||
_html_edit_profile_instance(base_dir, translate,
|
_html_edit_profile_instance(base_dir, translate,
|
||||||
peertube_instances,
|
peertube_instances,
|
||||||
|
|
|
@ -490,7 +490,7 @@ def _webfinger_updateFromProfile(wf_json: {}, actor_json: {}) -> bool:
|
||||||
|
|
||||||
|
|
||||||
def webfinger_update(base_dir: str, nickname: str, domain: str,
|
def webfinger_update(base_dir: str, nickname: str, domain: str,
|
||||||
onion_domain: str,
|
onion_domain: str, i2p_domain: str,
|
||||||
cached_webfingers: {}) -> None:
|
cached_webfingers: {}) -> None:
|
||||||
"""Regenerates stored webfinger
|
"""Regenerates stored webfinger
|
||||||
"""
|
"""
|
||||||
|
@ -505,8 +505,15 @@ def webfinger_update(base_dir: str, nickname: str, domain: str,
|
||||||
if onion_domain in handle:
|
if onion_domain in handle:
|
||||||
handle = handle.replace(onion_domain, domain)
|
handle = handle.replace(onion_domain, domain)
|
||||||
onionify = True
|
onionify = True
|
||||||
|
elif i2p_domain:
|
||||||
|
if i2p_domain in handle:
|
||||||
|
handle = handle.replace(i2p_domain, domain)
|
||||||
|
i2pify = True
|
||||||
if not onionify:
|
if not onionify:
|
||||||
|
if not i2pify:
|
||||||
wf_json = load_json(filename)
|
wf_json = load_json(filename)
|
||||||
|
else:
|
||||||
|
wf_json = load_json_onionify(filename, domain, i2p_domain)
|
||||||
else:
|
else:
|
||||||
wf_json = load_json_onionify(filename, domain, onion_domain)
|
wf_json = load_json_onionify(filename, domain, onion_domain)
|
||||||
if not wf_json:
|
if not wf_json:
|
||||||
|
|
Loading…
Reference in New Issue