More support for yggdrasil

main
bashrc 2026-02-24 22:26:17 +00:00
parent 20fb6aeb17
commit aa553ae6ee
6 changed files with 15 additions and 4 deletions

View File

@ -3041,7 +3041,7 @@ def _command_options() -> None:
if argb.migrations:
cached_webfingers = {}
if argb.http or domain.endswith('.onion'):
if domain.endswith('.onion'):
http_prefix = 'http'
port = 80
proxy_type = 'tor'
@ -3172,7 +3172,7 @@ def _command_options() -> None:
domain = argb.followers.split('@')[1]
domain = remove_eol(domain)
cached_webfingers = {}
if argb.http or domain.endswith('.onion'):
if domain.endswith('.onion'):
http_prefix = 'http'
port = 80
proxy_type = 'tor'

View File

@ -22,6 +22,7 @@ from categories import set_hashtag_category
from flags import is_suspended
from flags import is_local_network_address
from flags import is_public_post
from utils import is_yggdrasil_address
from utils import data_dir
from utils import string_contains
from utils import resembles_url
@ -866,6 +867,8 @@ def _xml2str_to_dict(base_dir: str, domain: str, xml_str: str,
proxy_type = 'tor'
elif domain.endswith('.i2p'):
proxy_type = 'i2p'
elif is_yggdrasil_address(domain):
proxy_type = 'yggdrasil'
link, link_mime_type = \
get_link_from_rss_item(rss_item, preferred_podcast_formats,
@ -985,6 +988,8 @@ def _xml1str_to_dict(base_dir: str, domain: str, xml_str: str,
proxy_type = 'tor'
elif domain.endswith('.i2p'):
proxy_type = 'i2p'
elif is_yggdrasil_address(domain):
proxy_type = 'yggdrasil'
link, link_mime_type = \
get_link_from_rss_item(rss_item, preferred_podcast_formats,
@ -1143,6 +1148,8 @@ def _atom_feed_to_dict(base_dir: str, domain: str, xml_str: str,
proxy_type = 'tor'
elif domain.endswith('.i2p'):
proxy_type = 'i2p'
elif is_yggdrasil_address(domain):
proxy_type = 'yggdrasil'
link, link_mime_type = \
get_link_from_rss_item(atom_item, preferred_podcast_formats,

View File

@ -1943,7 +1943,7 @@ def get_actor_json(host_domain: str, handle: str, http: bool, gnunet: bool,
cached_webfingers = {}
proxy_type = None
if http or domain.endswith('.onion'):
if domain.endswith('.onion'):
http_prefix = 'http'
proxy_type = 'tor'
elif domain.endswith('.i2p'):

View File

@ -4170,6 +4170,8 @@ def send_to_followers(server, session, session_onion, session_i2p,
curr_proxy_type = 'tor'
elif domain.endswith('.i2p'):
curr_proxy_type = 'i2p'
elif is_yggdrasil_address(domain):
curr_proxy_type = 'yggdrasil'
sending_start_time = date_utcnow()
print('Sending post to followers begins ' +

View File

@ -45,7 +45,6 @@ def secure_mode(curr_session, proxy_type: str,
curr_session = server.session_i2p
proxy_type = 'i2p'
if server.yggdrasil_domain:
# TODO improve yggdrasil detection
if is_yggdrasil_url(key_id):
curr_session = server.session_yggdrasil
proxy_type = 'yggdrasil'

View File

@ -11,6 +11,7 @@ import os
from flags import is_editor
from flags import is_artist
from flags import is_moderator
from utils import is_yggdrasil_address
from utils import get_person_icon
from utils import data_dir
from utils import remove_html
@ -161,6 +162,8 @@ def html_account_info(translate: {},
proxy_type = None
if domain.endswith('.i2p'):
proxy_type = None
elif is_yggdrasil_address(domain):
proxy_type = None
session = create_session(proxy_type)