Bob Mottram 2023-02-17 17:56:17 +00:00
commit 20c0c3c13a
3 changed files with 41 additions and 2 deletions

View File

@ -371,6 +371,10 @@ A *counselor* is someone tasked with resolving disputes between users of the ins
Devops are permitted to perform some routine administration functions, such as monitoring instance performance graphs. Devops are permitted to perform some routine administration functions, such as monitoring instance performance graphs.
# Following # Following
*"I am not a beginning. I am not an end. I am a link in a chain."*
-- Keith Haring
On the main timeline screen at the top right of the centre column there is a search icon which looks like a magnifying glass. By convention within the fediverse the search function is also the way to look up and follow other people. Enter the handle (@name@domain) or URL of the profile page for the person that you want to follow and select *search*. If the account is found then its details will appear and you can choose to follow or not. On the main timeline screen at the top right of the centre column there is a search icon which looks like a magnifying glass. By convention within the fediverse the search function is also the way to look up and follow other people. Enter the handle (@name@domain) or URL of the profile page for the person that you want to follow and select *search*. If the account is found then its details will appear and you can choose to follow or not.
![Following people via search](manual-search-following.jpg) ![Following people via search](manual-search-following.jpg)

View File

@ -1757,7 +1757,7 @@ def test_follow_between_servers(base_dir: str) -> None:
assert THR_BOB.is_alive() is False assert THR_BOB.is_alive() is False
# queue item removed # queue item removed
time.sleep(4) time.sleep(8)
assert len([name for name in os.listdir(queue_path) assert len([name for name in os.listdir(queue_path)
if os.path.isfile(os.path.join(queue_path, name))]) == 0 if os.path.isfile(os.path.join(queue_path, name))]) == 0

View File

@ -23,6 +23,8 @@ from utils import remove_domain_port
from utils import get_user_paths from utils import get_user_paths
from utils import get_group_paths from utils import get_group_paths
from utils import local_actor_url from utils import local_actor_url
from utils import get_nickname_from_actor
from utils import get_domain_from_actor
def _parse_handle(handle: str) -> (str, str, bool): def _parse_handle(handle: str) -> (str, str, bool):
@ -298,21 +300,54 @@ def webfinger_lookup(path: str, base_dir: str,
domain: str, onion_domain: str, i2p_domain: str, domain: str, onion_domain: str, i2p_domain: str,
port: int, debug: bool) -> {}: port: int, debug: bool) -> {}:
"""Lookup the webfinger endpoint for an account """Lookup the webfinger endpoint for an account
GET /.well-known/webfinger?resource=acct:user@domain
""" """
if not path.startswith('/.well-known/webfinger?'): if not path.startswith('/.well-known/webfinger?'):
return None return None
handle = None handle = None
res_type = 'acct' res_type = 'acct'
if 'resource=' + res_type + ':' in path: if 'resource=' + res_type + ':http' in path:
# GET /.well-known/webfinger?resource=acct:https://domain/users/nick
actor = path.split('resource=' + res_type + ':')[1]
actor = urllib.parse.unquote(actor.strip())
wf_nickname = get_nickname_from_actor(actor)
wf_domain, port = get_domain_from_actor(actor)
if wf_nickname and wf_domain:
handle = wf_nickname + '@' + wf_domain
if debug:
print('DEBUG: WEBFINGER handle ' + handle)
elif 'resource=' + res_type + ':' in path:
# GET /.well-known/webfinger?resource=acct:nick@domain
handle = path.split('resource=' + res_type + ':')[1].strip() handle = path.split('resource=' + res_type + ':')[1].strip()
handle = urllib.parse.unquote(handle) handle = urllib.parse.unquote(handle)
if debug: if debug:
print('DEBUG: WEBFINGER handle ' + handle) print('DEBUG: WEBFINGER handle ' + handle)
elif 'resource=' + res_type + '%3Ahttp' in path:
# GET /.well-known/webfinger?resource=acct%3Ahttps://domain/users/nick
actor = path.split('resource=' + res_type + '%3A')[1]
actor = urllib.parse.unquote(actor.strip())
wf_nickname = get_nickname_from_actor(actor)
wf_domain, port = get_domain_from_actor(actor)
if wf_nickname and wf_domain:
handle = wf_nickname + '@' + wf_domain
if debug:
print('DEBUG: WEBFINGER handle ' + handle)
elif 'resource=' + res_type + '%3A' in path: elif 'resource=' + res_type + '%3A' in path:
# GET /.well-known/webfinger?resource=acct%3Anick@domain
handle = path.split('resource=' + res_type + '%3A')[1] handle = path.split('resource=' + res_type + '%3A')[1]
handle = urllib.parse.unquote(handle.strip()) handle = urllib.parse.unquote(handle.strip())
if debug: if debug:
print('DEBUG: WEBFINGER handle ' + handle) print('DEBUG: WEBFINGER handle ' + handle)
elif 'resource=http' in path:
# GET /.well-known/webfinger?resource=https://domain/users/nick
actor = path.split('resource=')[1]
actor = urllib.parse.unquote(actor.strip())
wf_nickname = get_nickname_from_actor(actor)
wf_domain, port = get_domain_from_actor(actor)
if wf_nickname and wf_domain:
handle = wf_nickname + '@' + wf_domain
if debug:
print('DEBUG: WEBFINGER handle ' + handle)
if not handle: if not handle:
if debug: if debug:
print('DEBUG: WEBFINGER handle missing') print('DEBUG: WEBFINGER handle missing')