kopia lustrzana https://github.com/snarfed/bridgy-fed
Porównaj commity
30 Commity
71cb803840
...
4b95d49ccc
Autor | SHA1 | Data |
---|---|---|
Ryan Barrett | 4b95d49ccc | |
Ryan Barrett | 533ed7441d | |
Ryan Barrett | 91638ef8bb | |
Ryan Barrett | 3094b45bd2 | |
Ryan Barrett | 0cfd188fd4 | |
Ryan Barrett | 073ce475e5 | |
Ryan Barrett | ee9bb53745 | |
dependabot[bot] | 38ecaf3d0b | |
dependabot[bot] | 7d0ee92da5 | |
Ryan Barrett | 0ddb1255f4 | |
Ryan Barrett | 50dce84d68 | |
Ryan Barrett | edea743c58 | |
Ryan Barrett | 370fcb95a7 | |
Ryan Barrett | fb886ee86a | |
Ryan Barrett | 1111800e6f | |
Ryan Barrett | f668a53f74 | |
Ryan Barrett | 5071685c1b | |
Ryan Barrett | c8ca31554b | |
Ryan Barrett | b6be345921 | |
Ryan Barrett | ea5a4cf9c3 | |
Ryan Barrett | bf70ddd348 | |
Ryan Barrett | 0e5be92f08 | |
Ryan Barrett | 74dc22104f | |
dependabot[bot] | 2e5af56e87 | |
Ryan Barrett | e5c12c4595 | |
Ryan Barrett | be63f45b7d | |
Ryan Barrett | b6845246e9 | |
Ryan Barrett | 2a4146fe74 | |
Ryan Barrett | 9617d8ab71 | |
Ryan Barrett | cbe4b59206 |
|
@ -369,7 +369,7 @@ class ActivityPub(User, Protocol):
|
|||
from_proto = PROTOCOLS.get(obj.source_protocol)
|
||||
user_id = from_user.key.id() if from_user and from_user.key else None
|
||||
# TODO: uncomment
|
||||
# if from_proto and not from_proto.is_enabled_to(cls, user=from_user):
|
||||
# if from_proto and not from_user.is_enabled(cls):
|
||||
# error(f'{cls.LABEL} <=> {from_proto.LABEL} not enabled')
|
||||
|
||||
if obj.as2:
|
||||
|
@ -619,6 +619,10 @@ def postprocess_as2(activity, orig_obj=None, wrap=True):
|
|||
activity['inReplyTo'] = orig_id
|
||||
elif isinstance(in_reply_to, list):
|
||||
if len(in_reply_to) > 1:
|
||||
# this isn't actually true, AS2 inReplyTo can be multiply
|
||||
# valued. Why do we truncate it to one value? interop somewhere?
|
||||
# it's not marked Functional:
|
||||
# https://www.w3.org/TR/activitystreams-vocabulary/#dfn-inreplyto
|
||||
logger.warning(
|
||||
"AS2 doesn't support multiple inReplyTo URLs! "
|
||||
f'Only using the first: {in_reply_to[0]}')
|
||||
|
@ -664,12 +668,18 @@ def postprocess_as2(activity, orig_obj=None, wrap=True):
|
|||
# https://chrisbeckstrom.com/2018/12/27/32551/
|
||||
# assert activity.get('id') or (isinstance(obj, dict) and obj.get('id'))
|
||||
|
||||
# drop Link attachments since fediverse instances generate their own link previews
|
||||
# https://github.com/snarfed/bridgy-fed/issues/958
|
||||
obj_or_activity = obj if obj.keys() > set(['id']) else activity
|
||||
obj_or_activity['attachment'] = [
|
||||
a for a in as1.get_objects(obj_or_activity, 'attachment')
|
||||
if a.get('type') != 'Link']
|
||||
|
||||
# copy image(s) into attachment(s). may be Mastodon-specific.
|
||||
# https://github.com/snarfed/bridgy-fed/issues/33#issuecomment-440965618
|
||||
obj_or_activity = obj if obj.keys() > set(['id']) else activity
|
||||
imgs = util.get_list(obj_or_activity, 'image')
|
||||
atts = obj_or_activity.setdefault('attachment', [])
|
||||
if imgs:
|
||||
atts = obj_or_activity['attachment']
|
||||
atts.extend(img for img in imgs if img not in atts)
|
||||
|
||||
# cc target's author(s), recipients, mentions
|
||||
|
@ -860,11 +870,8 @@ def actor(handle_or_id):
|
|||
id = handle_or_id
|
||||
|
||||
assert id
|
||||
if not cls.is_enabled_to(ActivityPub, user=id):
|
||||
error(f'{cls.LABEL} user {id} not found', status=404)
|
||||
|
||||
user = cls.get_or_create(id)
|
||||
if not user:
|
||||
if not user or not user.is_enabled(ActivityPub):
|
||||
error(f'{cls.LABEL} user {id} not found', status=404)
|
||||
|
||||
id = user.id_as(ActivityPub)
|
||||
|
|
|
@ -5,15 +5,13 @@
|
|||
],
|
||||
"type": "Application",
|
||||
"id": "https://ap.brid.gy/ap.brid.gy",
|
||||
"url": "https://ap.brid.gy/",
|
||||
"url": [
|
||||
"https://fed.brid.gy/"
|
||||
"https://ap.brid.gy/",
|
||||
],
|
||||
"preferredUsername": "ap.brid.gy",
|
||||
"summary": "Bridgy Fed (https://fed.brid.gy/) bot user for the fediverse. To bridge your Bluesky account to the fediverse, follow this account. More info: https://fed.brid.gy/docs",
|
||||
"name": "Bridgy Fed for the fediverse",
|
||||
"attachment": [{
|
||||
"name": "Web site",
|
||||
"type": "PropertyValue",
|
||||
"value": "<a rel=\"me\" href=\"https://fed.brid.gy\"><span class=\"invisible\">https://</span>fed.brid.gy</a>"
|
||||
}],
|
||||
"image": [
|
||||
{
|
||||
"type": "Image",
|
||||
|
|
23
atproto.py
23
atproto.py
|
@ -90,8 +90,9 @@ class ATProto(User, Protocol):
|
|||
LOGO_HTML = '<img src="/oauth_dropins_static/bluesky.svg">'
|
||||
# note that PDS hostname is atproto.brid.gy here, not bsky.brid.gy. Bluesky
|
||||
# team currently has our hostname as atproto.brid.gy in their federation
|
||||
# test.
|
||||
PDS_URL = f'https://atproto{common.SUPERDOMAIN}/'
|
||||
# test. also note that PDS URL shouldn't include trailing slash.
|
||||
# https://atproto.com/specs/did#did-documents
|
||||
PDS_URL = f'https://atproto{common.SUPERDOMAIN}'
|
||||
CONTENT_TYPE = 'application/json'
|
||||
HAS_COPIES = True
|
||||
DEFAULT_ENABLED_PROTOCOLS = ()
|
||||
|
@ -254,16 +255,16 @@ class ATProto(User, Protocol):
|
|||
return
|
||||
|
||||
# create new DID, repo
|
||||
pds_url = common.host_url() if DEBUG else cls.PDS_URL
|
||||
logger.info(f'Creating new did:plc for {user.key} {pds_url}')
|
||||
did_plc = did.create_plc(user.handle_as('atproto'),
|
||||
pds_url=pds_url,
|
||||
post_fn=util.requests_post)
|
||||
# PDS URL shouldn't include trailing slash!
|
||||
# https://atproto.com/specs/did#did-documents
|
||||
pds_url = common.host_url().rstrip('/') if DEBUG else cls.PDS_URL
|
||||
handle = user.handle_as('atproto')
|
||||
logger.info(f'Creating new did:plc for {user.key} {handle} {pds_url}')
|
||||
did_plc = did.create_plc(handle, pds_url=pds_url, post_fn=util.requests_post)
|
||||
|
||||
Object.get_or_create(did_plc.did, raw=did_plc.doc)
|
||||
# TODO: move this to ATProto.get_or_create?
|
||||
add(user.copies, Target(uri=did_plc.did, protocol='atproto'))
|
||||
handle = user.handle_as('atproto')
|
||||
|
||||
# create _atproto DNS record for handle resolution
|
||||
# https://atproto.com/specs/handle#handle-resolution
|
||||
|
@ -506,7 +507,7 @@ class ATProto(User, Protocol):
|
|||
"""
|
||||
from_proto = PROTOCOLS.get(obj.source_protocol)
|
||||
# TODO: uncomment
|
||||
# if from_proto and not from_proto.is_enabled_to(cls, user=from_user):
|
||||
# if from_proto and not from_user.is_enabled(cls):
|
||||
# error(f'{cls.LABEL} <=> {from_proto.LABEL} not enabled')
|
||||
|
||||
if obj.bsky:
|
||||
|
@ -610,7 +611,7 @@ def poll_notifications():
|
|||
headers={'User-Agent': USER_AGENT})
|
||||
|
||||
for user in users:
|
||||
if not user.is_enabled_to(ATProto, user=user):
|
||||
if not user.is_enabled(ATProto):
|
||||
logger.info(f'Skipping {user.key.id()}')
|
||||
continue
|
||||
|
||||
|
@ -673,7 +674,7 @@ def poll_posts():
|
|||
headers={'User-Agent': USER_AGENT})
|
||||
|
||||
for user in users:
|
||||
if not user.is_enabled_to(ATProto, user=user):
|
||||
if not user.is_enabled(ATProto):
|
||||
logger.info(f'Skipping {user.key.id()}')
|
||||
continue
|
||||
|
||||
|
|
|
@ -5,15 +5,13 @@
|
|||
],
|
||||
"type": "Application",
|
||||
"id": "https://bsky.brid.gy/bsky.brid.gy",
|
||||
"url": "https://bsky.brid.gy/",
|
||||
"url": [
|
||||
"https://fed.brid.gy/",
|
||||
"https://bsky.brid.gy/"
|
||||
],
|
||||
"preferredUsername": "bsky.brid.gy",
|
||||
"summary": "<a href='https://fed.brid.gy/'>Bridgy Fed</a> bot user for <a href='https://bsky.social/'>Bluesky</a>. To bridge your fediverse account to Bluesky, follow this account or reply <em>yes</em> when it promps you with a DM. <a href='https://fed.brid.gy/docs'>More info here.</a>",
|
||||
"name": "Bridgy Fed for Bluesky",
|
||||
"attachment": [{
|
||||
"name": "Web site",
|
||||
"type": "PropertyValue",
|
||||
"value": "<a rel=\"me\" href=\"https://fed.brid.gy\"><span class=\"invisible\">https://</span>fed.brid.gy</a>"
|
||||
}],
|
||||
"image": [
|
||||
{
|
||||
"type": "Image",
|
||||
|
|
10
common.py
10
common.py
|
@ -6,7 +6,7 @@ from pathlib import Path
|
|||
import re
|
||||
import threading
|
||||
import urllib.parse
|
||||
from urllib.parse import urljoin
|
||||
from urllib.parse import urljoin, urlparse
|
||||
|
||||
import cachetools
|
||||
from Crypto.Util import number
|
||||
|
@ -195,7 +195,15 @@ def unwrap(val, field=None):
|
|||
Returns:
|
||||
str: unwrapped url
|
||||
"""
|
||||
|
||||
if isinstance(val, dict):
|
||||
# TODO: clean up. https://github.com/snarfed/bridgy-fed/issues/967
|
||||
id = val.get('id')
|
||||
if (id and urlparse(id).path.strip('/') in DOMAINS + ('',)
|
||||
and util.domain_from_link(id) in DOMAINS):
|
||||
# protocol bot user, don't touch its URLs
|
||||
return {**val, 'id': unwrap(id)}
|
||||
|
||||
return {f: unwrap(v, field=f) for f, v in val.items()}
|
||||
|
||||
elif isinstance(val, list):
|
||||
|
|
|
@ -174,7 +174,7 @@ html_theme_options = {
|
|||
|
||||
# The name of an image file (relative to this directory) to place at the top
|
||||
# of the sidebar.
|
||||
html_logo = '../static/bridgy_fed_logo.png'
|
||||
html_logo = '../static/bridgy_logo_with_alpha.png'
|
||||
|
||||
# The name of an image file (within the static path) to use as favicon of the
|
||||
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
|
||||
|
|
|
@ -7,13 +7,8 @@
|
|||
"id": "https://fed.brid.gy/fed.brid.gy",
|
||||
"url": "https://fed.brid.gy/",
|
||||
"preferredUsername": "fed.brid.gy",
|
||||
"summary": "Bridging the new social internet",
|
||||
"summary": "<a href='https://fed.brid.gy/'>Bridgy Fed</a> is a bridge between decentralized social networks like the <a href='https://indieweb.org/'>IndieWeb</a>, <a href='https://en.wikipedia.org/wiki/Fediverse'>fediverse</a>, <a href='https://bsky.social/'>Bluesky</a>, and others. <a href='https://fed.brid.gy/docs'>More info here.</a>",
|
||||
"name": "Bridgy Fed",
|
||||
"attachment": [{
|
||||
"name": "Web site",
|
||||
"type": "PropertyValue",
|
||||
"value": "<a rel=\"me\" href=\"https://fed.brid.gy\"><span class=\"invisible\">https://</span>fed.brid.gy</a>"
|
||||
}],
|
||||
"image": [
|
||||
{
|
||||
"type": "Image",
|
||||
|
|
15
ids.py
15
ids.py
|
@ -32,6 +32,17 @@ COPIES_PROTOCOLS = None
|
|||
# Maps string domain to string subdomain (bsky, fed, or web).
|
||||
_NON_WEB_SUBDOMAIN_SITES = None
|
||||
|
||||
# Webfinger allows all sorts of characters that ATProto handles don't,
|
||||
# notably _ and ~. Map those to -.
|
||||
# https://www.rfc-editor.org/rfc/rfc7565.html#section-7
|
||||
# https://atproto.com/specs/handle
|
||||
# https://github.com/snarfed/bridgy-fed/issues/982
|
||||
# https://github.com/swicg/activitypub-webfinger/issues/9
|
||||
TO_ATPROTO_CHARS = {
|
||||
'_': '-',
|
||||
'~': '-',
|
||||
}
|
||||
|
||||
|
||||
def web_ap_base_domain(user_domain):
|
||||
"""Returns the full Bridgy Fed domain to use for a given Web user.
|
||||
|
@ -167,6 +178,10 @@ def translate_handle(*, handle, from_, to, enhanced):
|
|||
return f'@{handle}@{domain}'
|
||||
|
||||
case _, 'atproto' | 'nostr':
|
||||
if to.LABEL == 'atproto':
|
||||
for from_char, to_char in TO_ATPROTO_CHARS.items():
|
||||
handle = handle.replace(from_char, to_char)
|
||||
|
||||
handle = handle.lstrip('@').replace('@', '.')
|
||||
if enhanced or handle == PRIMARY_DOMAIN or handle in PROTOCOL_DOMAINS:
|
||||
return handle
|
||||
|
|
100
models.py
100
models.py
|
@ -258,7 +258,7 @@ class User(StringIdModel, metaclass=ProtocolUserMeta):
|
|||
for label in ids.COPIES_PROTOCOLS:
|
||||
proto = PROTOCOLS[label]
|
||||
if proto != cls and not user.get_copy(proto):
|
||||
if cls.is_enabled_to(proto, user=id):
|
||||
if user.is_enabled(proto):
|
||||
proto.create_for(user)
|
||||
else:
|
||||
logger.info(f'{cls.LABEL} <=> atproto not enabled, skipping')
|
||||
|
@ -358,6 +358,52 @@ class User(StringIdModel, metaclass=ProtocolUserMeta):
|
|||
|
||||
return None
|
||||
|
||||
def is_enabled(self, to_proto):
|
||||
"""Returns True if this user can be bridged to a given protocol.
|
||||
|
||||
Reasons this might return False:
|
||||
* We haven't turned on bridging these two protocols yet.
|
||||
* The user is opted out.
|
||||
* The user is on a domain that's opted out.
|
||||
* The from protocol requires opt in, and the user hasn't opted in.
|
||||
|
||||
Args:
|
||||
to_proto (Protocol subclass)
|
||||
|
||||
Returns:
|
||||
bool:
|
||||
"""
|
||||
from protocol import Protocol
|
||||
assert issubclass(to_proto, Protocol)
|
||||
|
||||
if self.__class__ == to_proto:
|
||||
return True
|
||||
|
||||
from_label = self.LABEL
|
||||
to_label = to_proto.LABEL
|
||||
|
||||
# unit tests
|
||||
if DEBUG and (from_label in ('fake', 'other')
|
||||
or (to_label in ('fake', 'other') and from_label != 'eefake')):
|
||||
return True
|
||||
|
||||
elif bot_protocol := Protocol.for_bridgy_subdomain(self.key.id()):
|
||||
return to_proto != bot_protocol
|
||||
|
||||
elif self.manual_opt_out:
|
||||
return False
|
||||
|
||||
elif to_label in self.enabled_protocols:
|
||||
return True
|
||||
|
||||
elif self.status == 'opt-out':
|
||||
return False
|
||||
|
||||
elif to_label in self.DEFAULT_ENABLED_PROTOCOLS:
|
||||
return True
|
||||
|
||||
return False
|
||||
|
||||
@ndb.transactional()
|
||||
def enable_protocol(self, to_proto):
|
||||
"""Adds ``to_proto` to :attr:`enabled_protocols`.
|
||||
|
@ -551,15 +597,33 @@ class User(StringIdModel, metaclass=ProtocolUserMeta):
|
|||
if copy.protocol in (proto.LABEL, proto.ABBREV):
|
||||
return copy.uri
|
||||
|
||||
def user_link(self):
|
||||
"""Returns a pretty link to the external user with name and profile picture."""
|
||||
def user_link(self, handle=False, maybe_internal_link=True):
|
||||
"""Returns a pretty link to the user with name and profile picture.
|
||||
|
||||
If they're opted in, links to their Bridgy Fed user page. Otherwise,
|
||||
links to their external account.
|
||||
|
||||
TODO: unify with :meth:`Object.actor_link`?
|
||||
|
||||
Args:
|
||||
handle (bool): include handle as well as display name
|
||||
maybe_internal_link (bool): if True, link to Bridgy Fed user page
|
||||
instead of external account
|
||||
"""
|
||||
url = (self.user_page_path()
|
||||
if maybe_internal_link and (self.enabled_protocols
|
||||
or self.LABEL == 'web' or self.direct)
|
||||
else self.web_url())
|
||||
pic = self.profile_picture()
|
||||
img = f'<img src="{pic}" class="profile"> ' if pic else ''
|
||||
img = f'<img src="{pic}" class="profile">' if pic else ''
|
||||
maybe_handle = f'· {self.handle}' if handle else ''
|
||||
|
||||
return f"""\
|
||||
<a class="h-card u-author" href="{self.web_url()}">
|
||||
{img}
|
||||
{self.name()}
|
||||
</a>"""
|
||||
<span class="logo" title="{self.__class__.__name__}">{self.LOGO_HTML}</span>
|
||||
<a class="h-card u-author" href="{url}" title="{self.name()}">
|
||||
{img}
|
||||
{util.ellipsize(self.name(), chars=40)} {maybe_handle}
|
||||
</a>"""
|
||||
|
||||
def profile_picture(self):
|
||||
"""Returns the user's profile picture image URL, if available, or None."""
|
||||
|
@ -900,6 +964,8 @@ class Object(StringIdModel):
|
|||
def actor_link(self, image=True, sized=False, user=None):
|
||||
"""Returns a pretty HTML link with the actor's name and picture.
|
||||
|
||||
TODO: unify with :meth:`User.user_link`?
|
||||
|
||||
Args:
|
||||
image (bool): whether to include an ``img`` tag with the actor's picture
|
||||
sized (bool): whether to set an explicit (``width=32``) size on the
|
||||
|
@ -911,11 +977,12 @@ class Object(StringIdModel):
|
|||
"""
|
||||
attrs = {'class': 'h-card u-author'}
|
||||
|
||||
if (self.source_protocol in ('web', 'webmention', 'ui')
|
||||
and (user.key in self.users or user.key.id() in self.domains)):
|
||||
if user and (user.key in self.users or user.key.id() in self.domains):
|
||||
# outbound; show a nice link to the user
|
||||
return user.user_link()
|
||||
|
||||
proto = PROTOCOLS.get(self.source_protocol)
|
||||
|
||||
actor = None
|
||||
if self.as1:
|
||||
actor = (as1.get_object(self.as1, 'actor')
|
||||
|
@ -923,7 +990,6 @@ class Object(StringIdModel):
|
|||
# hydrate from datastore if available
|
||||
# TODO: optimize! this is called serially in loops, eg in home.html
|
||||
if set(actor.keys()) == {'id'} and self.source_protocol:
|
||||
proto = PROTOCOLS[self.source_protocol]
|
||||
actor_obj = proto.load(actor['id'], remote=False)
|
||||
if actor_obj and actor_obj.as1:
|
||||
actor = actor_obj.as1
|
||||
|
@ -939,7 +1005,19 @@ class Object(StringIdModel):
|
|||
if not image or not img_url:
|
||||
return common.pretty_link(url, text=name, attrs=attrs, user=user)
|
||||
|
||||
# from protocol import Protocol
|
||||
# if actor_proto := Protocol.for_id(actor['id']):
|
||||
# if actor_user := actor_proto.get_by_id(actor['id']):
|
||||
# if actor_user and (actor_user.direct or actor_user.enabled_protocols
|
||||
# or actor_user.LABEL == 'web'):
|
||||
# url = actor_user.user_page_path()
|
||||
|
||||
logo = ''
|
||||
if proto:
|
||||
logo = f'<span class="logo" title="{self.__class__.__name__}">{proto.LOGO_HTML}</span>'
|
||||
|
||||
return f"""\
|
||||
{logo}
|
||||
<a class="h-card u-author" href="{url}" title="{name}">
|
||||
<img class="profile" src="{img_url}" {'width="32"' if sized else ''}/>
|
||||
{util.ellipsize(name, chars=40)}
|
||||
|
|
7
pages.py
7
pages.py
|
@ -167,19 +167,20 @@ def notifications(protocol, id):
|
|||
@canonicalize_request_domain(common.PROTOCOL_DOMAINS, common.PRIMARY_DOMAIN)
|
||||
def update_profile(protocol, id):
|
||||
user = load_user(protocol, id)
|
||||
link = f'<a href="{user.web_url()}">{user.handle_or_id()}</a>'
|
||||
|
||||
try:
|
||||
profile_obj = user.load(user.profile_id(), remote=True)
|
||||
except (requests.RequestException, werkzeug.exceptions.HTTPException) as e:
|
||||
_, msg = util.interpret_http_exception(e)
|
||||
flash(f"Couldn't update profile for {user.handle_or_id()}: {msg}")
|
||||
flash(f"Couldn't update profile for {link}: {msg}")
|
||||
|
||||
if profile_obj:
|
||||
common.create_task(queue='receive', obj=profile_obj.key.urlsafe(),
|
||||
authed_as=id)
|
||||
flash(f'Updating profile for {user.handle_or_id()}')
|
||||
flash(f'Updating profile from {link}...')
|
||||
else:
|
||||
flash(f"Couldn't update profile for {user.handle_or_id()}")
|
||||
flash(f"Couldn't update profile for {link}")
|
||||
|
||||
return redirect(user.user_page_path(), code=302)
|
||||
|
||||
|
|
91
protocol.py
91
protocol.py
|
@ -143,57 +143,6 @@ class Protocol:
|
|||
label = domain.removesuffix(common.SUPERDOMAIN)
|
||||
return PROTOCOLS.get(label)
|
||||
|
||||
# TODO: redesign this API to require user
|
||||
@classmethod
|
||||
def is_enabled_to(from_cls, to_cls, user=None):
|
||||
"""Returns True if two protocols, and optionally a user, can be bridged.
|
||||
|
||||
Reasons this might return False:
|
||||
* We haven't turned on bridging these two protocols yet.
|
||||
* The user is opted out.
|
||||
* The user is on a domain that's opted out.
|
||||
* The from protocol requires opt in, and the user hasn't opted in.
|
||||
|
||||
Args:
|
||||
from_cls (Protocol subclass)
|
||||
to_cls (Protocol subclass)
|
||||
user (:class:`models.User` or str): optional, user or id
|
||||
|
||||
Returns:
|
||||
bool:
|
||||
"""
|
||||
if from_cls == to_cls:
|
||||
return True
|
||||
|
||||
from_label = from_cls.LABEL
|
||||
to_label = to_cls.LABEL
|
||||
|
||||
if DEBUG and (from_label in ('fake', 'other')
|
||||
or (to_label in ('fake', 'other') and from_label != 'eefake')):
|
||||
return True
|
||||
|
||||
user_id = None
|
||||
if isinstance(user, User):
|
||||
user_id = user.key.id() if user.key else None
|
||||
elif isinstance(user, str):
|
||||
user_id = user
|
||||
user = from_cls.get_by_id(user_id, allow_opt_out=True)
|
||||
|
||||
if from_label == 'web':
|
||||
if bot_protocol := Protocol.for_bridgy_subdomain(user_id):
|
||||
return to_cls != bot_protocol
|
||||
|
||||
if user:
|
||||
if user.status == 'opt-out':
|
||||
return False
|
||||
elif to_label in user.enabled_protocols:
|
||||
return True
|
||||
|
||||
if to_label in from_cls.DEFAULT_ENABLED_PROTOCOLS:
|
||||
return True
|
||||
|
||||
return False
|
||||
|
||||
@classmethod
|
||||
def owns_id(cls, id):
|
||||
"""Returns whether this protocol owns the id, or None if it's unclear.
|
||||
|
@ -1116,14 +1065,32 @@ class Protocol:
|
|||
targets = {} # maps Target to Object or None
|
||||
owner = as1.get_owner(obj.as1)
|
||||
|
||||
in_reply_to_protocols = set() # protocol kinds, eg 'MagicKey'
|
||||
in_reply_to_owners = []
|
||||
in_reply_tos = as1.get_ids(as1.get_object(obj.as1), 'inReplyTo')
|
||||
for in_reply_to in in_reply_tos:
|
||||
if protocol := Protocol.for_id(in_reply_to):
|
||||
if in_reply_to_obj := protocol.load(in_reply_to):
|
||||
if proto := Protocol.for_id(in_reply_to):
|
||||
if in_reply_to_obj := proto.load(in_reply_to):
|
||||
if proto.LABEL != obj.source_protocol:
|
||||
in_reply_to_protocols.add(proto._get_kind())
|
||||
else:
|
||||
proto_labels = proto.DEFAULT_ENABLED_PROTOCOLS + tuple(
|
||||
c.protocol for c in in_reply_to_obj.copies)
|
||||
in_reply_to_protocols.update(PROTOCOLS[c.protocol]._get_kind()
|
||||
for c in in_reply_to_obj.copies)
|
||||
|
||||
if reply_owner := as1.get_owner(in_reply_to_obj.as1):
|
||||
in_reply_to_owners.append(reply_owner)
|
||||
|
||||
is_reply = obj.type == 'comment' or in_reply_tos
|
||||
is_self_reply = False
|
||||
if is_reply:
|
||||
logger.info(f"It's a reply...")
|
||||
if in_reply_to_protocols:
|
||||
logger.info(f' ...delivering to these protocols where the in-reply-to post was native or bridged: {in_reply_to_protocols}')
|
||||
else:
|
||||
logger.info(f" ...skipping, in-reply-to post(s) are same protocol and weren't bridged anywhere")
|
||||
return {}
|
||||
|
||||
for id in sorted(target_uris):
|
||||
protocol = Protocol.for_id(id)
|
||||
|
@ -1143,7 +1110,7 @@ class Protocol:
|
|||
# https://github.com/snarfed/bridgy-fed/issues/639
|
||||
if owner == as1.get_owner(orig_obj.as1):
|
||||
is_self_reply = True
|
||||
logger.info(f'Looks like a self reply! Delivering to all followers')
|
||||
logger.info(f'Looks like a self reply! Delivering to followers')
|
||||
|
||||
if protocol == cls and cls.LABEL != 'fake':
|
||||
logger.info(f'Skipping same-protocol target {id}')
|
||||
|
@ -1173,14 +1140,16 @@ class Protocol:
|
|||
logger.info("Can't tell who this is from! Skipping followers.")
|
||||
return targets
|
||||
|
||||
is_reply = obj.type == 'comment' or in_reply_tos
|
||||
if (obj.type in ('post', 'update', 'delete', 'share')
|
||||
and (is_self_reply or not is_reply)):
|
||||
and (not is_reply or (is_self_reply and in_reply_to_protocols))):
|
||||
logger.info(f'Delivering to followers of {user_key}')
|
||||
followers = Follower.query(Follower.to == user_key,
|
||||
Follower.status == 'active'
|
||||
).fetch()
|
||||
users = [u for u in ndb.get_multi(f.from_ for f in followers) if u]
|
||||
user_keys = [f.from_ for f in followers]
|
||||
if is_reply:
|
||||
user_keys = [k for k in user_keys if k.kind() in in_reply_to_protocols]
|
||||
users = [u for u in ndb.get_multi(user_keys) if u]
|
||||
User.load_multi(users)
|
||||
|
||||
# which object should we add to followers' feeds, if any
|
||||
|
@ -1219,14 +1188,20 @@ class Protocol:
|
|||
feed_obj.put()
|
||||
|
||||
# de-dupe targets, discard same-domain
|
||||
# maps string target URL to (Target, Object) tuple
|
||||
candidates = {t.uri: (t, obj) for t, obj in targets.items()}
|
||||
# maps Target to Object or None
|
||||
targets = {}
|
||||
source_domains = [
|
||||
util.domain_from_link(url) for url in
|
||||
(obj.as1.get('id'), obj.as1.get('url'), as1.get_owner(obj.as1))
|
||||
if util.is_web(url)
|
||||
]
|
||||
for url in sorted(util.dedupe_urls(candidates.keys())):
|
||||
for url in sorted(util.dedupe_urls(
|
||||
candidates.keys(),
|
||||
# preserve our PDS URL without trailing slash for path
|
||||
# https://atproto.com/specs/did#did-documents
|
||||
trailing_slash=False)):
|
||||
if util.is_web(url) and util.domain_from_link(url) in source_domains:
|
||||
logger.info(f'Skipping same-domain target {url}')
|
||||
else:
|
||||
|
|
|
@ -32,7 +32,7 @@ feedgen==1.0.0
|
|||
feedparser==6.0.11
|
||||
fixtures==4.1.0
|
||||
Flask==3.0.3
|
||||
Flask-Caching==2.1.0
|
||||
Flask-Caching==2.2.0
|
||||
flask-gae-static==1.0
|
||||
flask-sock==0.7.0
|
||||
google-api-core[grpc]==2.17.1
|
||||
|
@ -48,7 +48,7 @@ google-cloud-ndb==2.3.1
|
|||
google-cloud-tasks==2.16.3
|
||||
googleapis-common-protos==1.63.0
|
||||
grpc-google-iam-v1==0.13.0
|
||||
grpcio==1.62.2
|
||||
grpcio==1.63.0
|
||||
grpcio-status==1.62.2
|
||||
gunicorn==22.0.0
|
||||
h11==0.14.0
|
||||
|
@ -60,7 +60,7 @@ idna==3.7
|
|||
iterators==0.2.0
|
||||
itsdangerous==2.2.0
|
||||
Jinja2==3.1.3
|
||||
jsonschema==4.21.1
|
||||
jsonschema==4.22.0
|
||||
lxml==5.2.1
|
||||
MarkupSafe==2.1.5
|
||||
mf2py==2.0.1
|
||||
|
|
|
@ -199,6 +199,10 @@ pre .value, code .value, code.value {
|
|||
color: #88305b;
|
||||
}
|
||||
|
||||
.front-light .bluesky, .front-light .bluesky:hover {
|
||||
color: #305b88;
|
||||
}
|
||||
|
||||
.front-dark .web, .front-dark .web:hover {
|
||||
color: #b7e4c6;
|
||||
}
|
||||
|
@ -207,7 +211,12 @@ pre .value, code .value, code.value {
|
|||
color: #e4b7c6;
|
||||
}
|
||||
|
||||
.fediverse img {
|
||||
.front-dark .bluesky, .front-dark .bluesky:hover {
|
||||
color: #b7c6e4;
|
||||
}
|
||||
|
||||
.fediverse img,
|
||||
.bluesky img {
|
||||
height: 1em;
|
||||
}
|
||||
|
||||
|
@ -460,6 +469,13 @@ button[disabled]:hover {
|
|||
color: #337AB7;
|
||||
}
|
||||
|
||||
.btn-copy {
|
||||
color: #66A0D0;
|
||||
background-color: transparent;
|
||||
border-color: transparent !important;
|
||||
padding: 3px 6px;
|
||||
}
|
||||
|
||||
.btn-default:hover, .btn-default:hover:focus {
|
||||
background-color: #BDE;
|
||||
border-color: #337AB7;
|
||||
|
|
|
@ -3,20 +3,9 @@
|
|||
|
||||
{% for f in followers %}
|
||||
<li class="row">
|
||||
{% with url=f.user.web_url(), user_as1=f.user.obj.as1 or {} %}
|
||||
<a class="follower col-xs-10 col-sm-10 col-lg-6" href="{{ url }}">
|
||||
<span class="logo" title="{{ user.__class__.__name__ }}">
|
||||
{{ f.user.LOGO_HTML|safe }}
|
||||
</span>
|
||||
{% with picture=util.get_url(user_as1, 'icon') or util.get_url(user_as1, 'image') %}
|
||||
{% if picture %}
|
||||
<img class="profile u-photo" src="{{ picture }}" width="48px">
|
||||
{% endif %}
|
||||
{% endwith %}
|
||||
{{ user_as1.get('displayName') or '' }}
|
||||
{{ f.user.handle or url }}
|
||||
</a>
|
||||
{% endwith %}
|
||||
<span class="follower col-xs-10 col-sm-10 col-lg-6">
|
||||
{{ f.user.user_link(handle=True)|safe }}
|
||||
</span>
|
||||
|
||||
{% if page_name == 'following' %}
|
||||
<form method="post" action="/unfollow/start" class="col-xs-2 col-sm-1 col-lg-1">
|
||||
|
|
|
@ -3,10 +3,11 @@
|
|||
{% for obj in objects %}
|
||||
<li class="row h-entry">
|
||||
<div class="e-content col-xs-{{ 5 if show_users else 8 }}">
|
||||
{% if obj.source_protocol %}
|
||||
<span class="logo">{{ PROTOCOLS[obj.source_protocol].LOGO_HTML|safe }}</span>
|
||||
{% if show_activity_actors %}
|
||||
{{ obj.actor_link(user=user)|safe }}
|
||||
{% else %}
|
||||
...
|
||||
{% endif %}
|
||||
{{ obj.actor_link(user=user)|safe }}
|
||||
{{ obj.phrase|safe }}
|
||||
{% if obj.url %}<a target="_blank" href="{{ obj.url }}" class="u-url">{% endif %}
|
||||
{{ obj.content|default('--', true)|striptags|truncate(50) }}
|
||||
|
|
|
@ -46,8 +46,9 @@
|
|||
<p class="header-links">
|
||||
<a href="/docs">Docs</a>
|
||||
<a href="https://snarfed.org/?s=%22bridgy+fed%22">News</a>
|
||||
<a href="mailto:feedback@brid.gy">Feedback</a>
|
||||
<a href="https://github.com/snarfed/bridgy-fed">Source</a>
|
||||
<a href="https://github.com/snarfed/bridgy-fed">Code</a>
|
||||
<a href="https://github.com/snarfed/bridgy-fed/issues">Issues</a>
|
||||
<a href="mailto:feedback@brid.gy">Feedback</a>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
|
@ -58,8 +59,9 @@
|
|||
<p class="header-links">
|
||||
<a href="/docs">Docs</a>
|
||||
<a href="https://snarfed.org/?s=%22bridgy+fed%22">News</a>
|
||||
<a href="mailto:feedback@brid.gy">Feedback</a>
|
||||
<a href="https://github.com/snarfed/bridgy-fed">Source</a>
|
||||
<a href="https://github.com/snarfed/bridgy-fed">Code</a>
|
||||
<a href="https://github.com/snarfed/bridgy-fed/issues">Issues</a>
|
||||
<a href="mailto:feedback@brid.gy">Feedback</a>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -24,28 +24,74 @@
|
|||
|
||||
<ul class="docs">
|
||||
|
||||
<p><em>Using</em></p>
|
||||
<p><em>About</em></p>
|
||||
<li><a href="#which-networks">Which networks are supported?</a></li>
|
||||
<li><a href="#get-started">How do I get started?</a></li>
|
||||
<li><a href="#which-accounts">Which accounts do I need?</a></li>
|
||||
<li><a href="#login">How do I log into Bridgy Fed?</a></li>
|
||||
<li><a href="#visibility">Who can see me and my stuff?</a></li>
|
||||
<li><a href="#other-bridges">What about other bridges?</a></li>
|
||||
<li><a href="#bridgy-classic">What's the difference between this and Bridgy classic, ie non-Fed?</a></li>
|
||||
<li><a href="#behavior-mismatches">How does this handle behavior differences between networks?</a></li>
|
||||
<li><a href="#format-mismatches">How does this handle formatting differences between networks?</a></li>
|
||||
<li><a href="#moderation">What about moderation? How do blocks, mutes, etc work?</a></li>
|
||||
<li><a href="#opt-out">How do I opt out and remove my site or account?</a></li>
|
||||
|
||||
<br>
|
||||
|
||||
<p><em>Using</em></p>
|
||||
<li><a href="#get-started">How do I get started?</a></li>
|
||||
<li><a href="#which-accounts">Which accounts do I need?</a></li>
|
||||
<li><a href="#login">How do I log into Bridgy Fed?</a></li>
|
||||
<li><a href="#update-profile">How do I update my profile?</a></li>
|
||||
<li><a href="#posts-forward">I see my profile, but I don't see my posts!</a></li>
|
||||
<li><a href="#user-page">Can I see my account's status and recent activity?</a></li>
|
||||
<li><a href="#troubleshooting">I tried it, and it didn't work!</a></li>
|
||||
<li><a href="#enhanced">The <code>*.brid.gy</code> domain in my bridged account is ugly. Can I get rid of it and use my own domain/web site instead?</a></li>
|
||||
<li><a href="#opt-out">How do I opt out and remove my site or account?</a></li>
|
||||
<li><a href="#replies">How are replies bridged?</a></li>
|
||||
<!-- <li><a href="#enhanced">The <code>*.brid.gy</code> domain in my bridged account is ugly. Can I get rid of it and use my own domain/web site instead?</a></li> -->
|
||||
|
||||
<br>
|
||||
|
||||
<p><em>From the fediverse</em></p>
|
||||
|
||||
<li><a href="#fediverse-get-started">How do I get started?</a></li>
|
||||
<li><a href="#fediverse-follow-bluesky">How do I find a bridged Bluesky account?</a></li>
|
||||
<li><a href="#fediverse-protocol-bot-user-blocked">I can't find <code>@bsky.brid.gy@bsky.brid.gy</code> on the fediverse!</a></li>
|
||||
<li><a href="#fediverse-follow-web">How do I find a bridged web site?</a></li>
|
||||
<li><a href="#fediverse-DM">What is this DM I got from a <code>*.brid.gy</code> account?</a></li>
|
||||
<li><a href="#fediverse-no-DM">Someone requested to follow me, but I never got the DM!</a></li>
|
||||
<li><a href="#fediverse-what">Which stuff of mine from the fediverse will get bridged?</a></li>
|
||||
|
||||
<br>
|
||||
|
||||
<p><em>To the fediverse</em></p>
|
||||
|
||||
<li><a href="#fediverse-servers">Which fediverse servers are supported?</a></li>
|
||||
<li><a href="#mastodon-link-verification">How do I verify my profile links (ie get green checks) in Mastodon?</a></li>
|
||||
<li><a href="#fediverse-enhanced">Can I use my own domain as my fediverse handle?</a></li>
|
||||
<li><a href="#instance-subdomains">Could other networks' instances get their own brid.gy subdomains, so that fediverse admins can federate with or block them individually?</a></li>
|
||||
|
||||
<br>
|
||||
|
||||
<p><em>From Bluesky</em></p>
|
||||
|
||||
<li><a href="#bluesky-get-started">How do I get started?</a></li>
|
||||
<li><a href="#bluesky-follow">How do I find a bridged fediverse account?</a></li>
|
||||
<li><a href="#bluesky-delay">I followed @ap.brid.gy, or followed someone else or posted or did something else in Bluesky, but it hasn't shown up in the fediverse yet!</a></li>
|
||||
<li><a href="#bluesky-what-from">Which stuff of mine from Bluesky will get bridged?</a>
|
||||
<li><a href="#bluesky-reply-controls">Can I use Bluesky's reply controls?</a></li>
|
||||
|
||||
<br>
|
||||
|
||||
<p><em>To Bluesky</em></p>
|
||||
|
||||
<li><a href="#bluesky-what-to">Which stuff of mine can get bridged into Bluesky?</a></li>
|
||||
<li><a href="#bluesky-what-not-to">Which stuff can't get bridged into Bluesky?</a></li>
|
||||
<li><a href="#bluesky-hashtags-in-text">Why didn't my hashtag show up?</a></li>
|
||||
<li><a href="#bluesky-report">What happens when I report a bridged Bluesky user?</a></li>
|
||||
|
||||
<br>
|
||||
|
||||
<p><em>From the web</em></p>
|
||||
<li><a href="#web-get-started">How do I get started?</a></li>
|
||||
<li><a href="#web-profile">Where does my profile info come from?</a></li>
|
||||
<li><a href="#web-update-profile">How do I update my profile?</a></li>
|
||||
<li><a href="#web-how-post">How does Bridgy Fed find my posts?</a></li>
|
||||
<li><a href="#web-interpret">How does it interpret and translate my posts?</a></li>
|
||||
<li><a href="#web-which-parts">How does it decide which parts of my posts to include?</a></li>
|
||||
|
@ -71,22 +117,7 @@
|
|||
|
||||
<br>
|
||||
|
||||
<p><em>From the fediverse</em></p>
|
||||
|
||||
<li><a href="#fediverse-follow">How do I follow someone from the fediverse?</a></li>
|
||||
|
||||
<br>
|
||||
|
||||
<p><em>To the fediverse</em></p>
|
||||
|
||||
<li><a href="#fediverse-servers">Which fediverse servers are supported?</a></li>
|
||||
<li><a href="#mastodon-link-verification">How do I verify my profile links (ie get green checks) in Mastodon?</a></li>
|
||||
<li><a href="#fediverse-enhanced">Can I use my own domain as my fediverse handle?</a></li>
|
||||
<li><a href="#instance-subdomains">Could other networks' instances get their own brid.gy subdomains, so that fediverse admins can federate with or block them individually?</a></li>
|
||||
|
||||
<br>
|
||||
|
||||
<p><em>About</em></p>
|
||||
<p><em>Background</em></p>
|
||||
<li><a href="#who">Who are you? Why did you make this?</a></li>
|
||||
<li><a href="#cost">How much does it cost?</a></li>
|
||||
<li><a href="#privacy">What do you do with my data?</a></li>
|
||||
|
@ -112,34 +143,17 @@
|
|||
|
||||
<br>
|
||||
|
||||
<h3 id="general">Using</h3>
|
||||
<h3 id="about">About</h3>
|
||||
|
||||
<li id="which-networks" class="question">Which networks are supported?</li>
|
||||
<li class="answer">
|
||||
<p>Bridgy Fed currently supports the <a href="https://en.wikipedia.org/wiki/Fediverse">fediverse</a> and the web. We plan to add <a href="https://blueskyweb.xyz/">Bluesky</a>/<a href="https://atproto.com/">AT Protocol</a> and <a href="https://nostr.com/">Nostr</a> in 2024.</p>
|
||||
<p>Bridgy Fed currently supports <a href="https://indieweb.org/">the web</a>, <a href="https://en.wikipedia.org/wiki/Fediverse">fediverse</a>, and <a href="https://bsky.social/">Bluesky</a>. We're considering adding more networks, including <a href="https://nostr.com/">Nostr</a> and <a href="https://www.farcaster.xyz/">Farcaster</a>.</p>
|
||||
<p>All bridging is fully bidirectional. If you're on a supported network, you can use Bridgy Fed to follow and interact with anyone on any other supported network.</p>
|
||||
</li>
|
||||
|
||||
<li id="get-started" class="question">How do I get started?</li>
|
||||
<li class="answer">
|
||||
<p>If you're on the web, first <a href="#web-get-started">set up your web site</a>, then <a href="#web-follow">follow someone on the fediverse</a>.</p>
|
||||
<p>If you're on the fediverse, <a href="#fediverse-follow">try following a web site</a>.</p>
|
||||
</li>
|
||||
|
||||
<li id="which-accounts" class="question">Which accounts do I need?</li>
|
||||
<li class="answer">
|
||||
<p>None! At least, no more than the accounts you already have. Bridgy Fed doesn't cross-post (ie copy posts) between separate accounts. Instead, it <a href="https://en.wikipedia.org/wiki/Federation_(information_technology)"><em>federates</em></a>, or mirrors, your existing accounts into other networks.</p>
|
||||
<p>If you want to cross-post instead, check out <a href="https://brid.gy/">Bridgy classic</a>!</p>
|
||||
</li>
|
||||
|
||||
<li id="login" class="question">How do I log into Bridgy Fed?</li>
|
||||
<li class="answer">
|
||||
<p>You don't! Bridgy Fed doesn't have its own accounts or logins.</p>
|
||||
</li>
|
||||
|
||||
<li id="visibility" class="question">Who can see me and my stuff?</li>
|
||||
<li class="answer">
|
||||
<p>Only the people who can already see you and your stuff, as is. Bridgy Fed only bridges fully public data, so if your account is private or protected or followers-only, it won't (can't!) bridge your account at all. Same with DMs and private/followers-only posts; it ignores those.</p>
|
||||
<p>Only the people who can already see you and your stuff, without bridging. Bridgy Fed only bridges fully public data, so if your account is private or protected or followers-only, it won't (can't!) bridge your account at all. Same with DMs and private/followers-only posts; it ignores those.</p>
|
||||
</li>
|
||||
|
||||
<li id="other-bridges" class="question">What about other bridges?</li>
|
||||
|
@ -153,8 +167,8 @@
|
|||
<li id="bridgy-classic" class="question">What's the difference between this and Bridgy classic, ie non-Fed?</li>
|
||||
<li class="answer">
|
||||
<p><a href="https://fed.brid.gy/">Bridgy Fed</a> and <a href="https://brid.gy/">Bridgy classic</a> are separate services. They both connect web sites and social networks and translate posts and interactions back and forth, but they each do it very differently.</p>
|
||||
<a href="https://fed.brid.gy/">Bridgy Fed</a> - this service - bridges accounts on decentralized social networks like the <a href="https://en.wikipedia.org/wiki/Fediverse">fediverse</a>, <a href="https://blueskyweb.xyz/">Bluesky</a>/<a href="https://atproto.com/">AT Protocol</a>, <a href="https://nostr.com/">Nostr</a>, and the IndieWeb <em>directly</em> across those networks.</p>
|
||||
<p><a href="https://brid.gy/">Bridgy classic</a>, on the other hand, connects <a href="https://indieweb.org/">IndieWeb</a> web sites to <em>existing</em> accounts on social networks, both centralized and decentralized, and provides <a href="https://indieweb.org/backfeed">backfeed</a> and <a href="https://indieweb.org/POSSE">POSSE</a> (aka cross-posting) as a service.</p>
|
||||
<a href="https://fed.brid.gy/">Bridgy Fed</a> - this service - bridges accounts on decentralized social networks like the <a href="https://en.wikipedia.org/wiki/Fediverse">fediverse</a>, <a href="https://bsky.social/">Bluesky</a>/<a href="https://atproto.com/">AT Protocol</a>, <a href="https://nostr.com/">Nostr</a>, and the <a href="https://indieweb.org/">IndieWeb</a> <em>directly</em> across those networks.</p>
|
||||
<p><a href="https://brid.gy/">Bridgy classic</a>, on the other hand, connects IndieWeb web sites to <em>existing</em> accounts on social networks, both centralized and decentralized, and provides <a href="https://indieweb.org/backfeed">backfeed</a> and <a href="https://indieweb.org/POSSE">POSSE</a> (aka cross-posting) as a service.</p>
|
||||
<p>As an example, here's a visualization of how they each connect web sites to the fediverse:</p>
|
||||
|
||||
<br>
|
||||
|
@ -215,27 +229,269 @@
|
|||
<p>For more background, see our <a href="#moderation-policy">content moderation policy</a> and <a href="https://snarfed.org/2024-01-19_moderate-people-not-code">this blog post</a>.</p>
|
||||
</li>
|
||||
|
||||
<li id="opt-out" class="question">How do I opt out and remove my site or account?</li>
|
||||
<li class="answer">
|
||||
<p>If you're on the fediverse or Bluesky, and you've opted in but now want to opt out, block the Bridgy Fed bot user for the network you want to opt out of. For example, on the fediverse, block <code>@bsky.brid.gy@bsky.brid.gy</code>. On Bluesky, block <a href="https://bsky.app/profile/ap.brid.gy">@ap.brid.gy</a>.</p>
|
||||
<p>Also, if you're on Bluesky and you've <a href="https://bsky.app/profile/safety.bsky.app/post/3khhw7s3rtx2s">hidden your account in the logged out view</a>, Bridgy Fed interprets that as opting out and won't bridge your account.</p>
|
||||
<p>If you're on the web, feel free to <a href="mailto:feedback@brid.gy">email me</a>, or you can put the text <code>#nobridge</code> in the <a href="#web-profile">profile on your home page</a> and then <a href="#update-profile">update your profile</a> on <a href="#user-page">your user page</a>.</p>
|
||||
</li>
|
||||
|
||||
|
||||
<h3 id="general">Using</h3>
|
||||
|
||||
<li id="get-started" class="question">How do I get started?</li>
|
||||
<li class="answer">
|
||||
<p>Here are instructions if you're coming from:</p>
|
||||
<ul>
|
||||
<li><a href="#web-get-started">the web</a></li>
|
||||
<li><a href="#fediverse-get-started">the fediverse</a></li>
|
||||
<li><a href="#bluesky-get-started">Bluesky</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<li id="which-accounts" class="question">Which accounts do I need?</li>
|
||||
<li class="answer">
|
||||
<p>None! At least, no more than the accounts you already have. Bridgy Fed doesn't cross-post (ie copy posts) between separate accounts. Instead, it <a href="https://en.wikipedia.org/wiki/Federation_(information_technology)"><em>federates</em></a>, or mirrors, your existing accounts into other networks.</p>
|
||||
<p>If you want to cross-post instead, check out <a href="https://brid.gy/">Bridgy classic</a>!</p>
|
||||
</li>
|
||||
|
||||
|
||||
<li id="login" class="question">How do I log into Bridgy Fed?</li>
|
||||
<li class="answer">
|
||||
<p>You don't! Bridgy Fed doesn't have its own accounts or logins.</p>
|
||||
</li>
|
||||
|
||||
|
||||
<li id="update-profile" class="question">How do I update my profile?</li>
|
||||
<li class="answer">
|
||||
<p>Click the <button class="btn btn-default glyphicon glyphicon-refresh"></button> button <a href="/web-site">on your user page</a>. Bridgy Fed will refresh your profile and send it to any networks you're bridged into.
|
||||
</li>
|
||||
|
||||
|
||||
<li id="posts-forward" class="question">I see my profile, but I don't see my posts!</li>
|
||||
<li class="answer">
|
||||
<p>Bridgy Fed only bridges new posts going forward, not historical posts. Try a new post!</p>
|
||||
</li>
|
||||
|
||||
|
||||
<li id="user-page" class="question">Can I see my account's status and recent activity?</li>
|
||||
<li class="answer">
|
||||
<p>Definitely! Bridgy Fed has a dashboard for every account that it's seen. <a href="/web-site">Enter your domain here</a> to see your user page. It shows your site's current status in Bridgy Fed, recent interactions, remote follow UI, and links to your timeline feeds in various formats.
|
||||
</p>
|
||||
</li>
|
||||
|
||||
|
||||
<li id="troubleshooting" class="question">I tried it, and it didn't work!</li>
|
||||
<li class="answer">
|
||||
<p><a href="#user-page">Check out your user page!</a> It detects and describes common problems with <a href="#web-setup">your setup</a>, and it shows your recent interactions and detailed logs.
|
||||
</li>
|
||||
|
||||
<li id="enhanced" class="question">The <code>*.brid.gy</code> domain in my bridged account's handle is ugly. Can I get rid of it and use my own domain/web site instead?</li>
|
||||
|
||||
<li id="replies" class="question">How are replies bridged?</li>
|
||||
<li class="answer">
|
||||
<p>Yes! All supported networks let you use <a href="https://indieweb.org/personal-domain">your own domain</a> as your handle in various ways. This takes a bit of technical setup with DNS and/or a web server, but it's very doable. <a href="#fediverse-enhanced">Here are instructions for web sites bridged into the fediverse.</a></p>
|
||||
<p>Bridgy Fed tries to bridge replies everywhere the original (in-reply-to) post is available or bridged. Notably, if you reply to yourself, Bridgy Fed bridges the reply everywhere it bridged your original post, in order to preserve threads.</p>
|
||||
</li>
|
||||
|
||||
<li id="opt-out" class="question">How do I opt out and remove my site or account?</li>
|
||||
|
||||
<!-- <li id="enhanced" class="question">The <code>*.brid.gy</code> domain in my bridged account's handle is ugly. Can I get rid of it and use my own domain/web site instead?</li> -->
|
||||
<!-- <li class="answer"> -->
|
||||
<!-- <p>Yes! All supported networks let you use <a href="https://indieweb.org/personal-domain">your own domain</a> as your handle in various ways. This takes a bit of technical setup with DNS and/or a web server, but it's very doable. <a href="#fediverse-enhanced">Here are instructions for web sites bridged into the fediverse.</a></p> -->
|
||||
<!-- </li> -->
|
||||
|
||||
|
||||
|
||||
<br>
|
||||
|
||||
<h3 id="from-fediverse">From the fediverse</h3>
|
||||
|
||||
<li id="fediverse-get-started" class="question">How do I get started?</li>
|
||||
<li class="answer">
|
||||
<p>Put the text <code>#nobridge</code> in your profile bio, refresh your profile <a href="#user-page">on your user page</a>, and Bridgy Fed will stop bridging your account. Or feel free to <a href="mailto:feedback@brid.gy">send me a request privately</a>.</p>
|
||||
<p>To bridge your fediverse account into Bluesky and interact with people there, search for and follow <code>@bsky.brid.gy@bsky.brid.gy</code>.</p>
|
||||
<p>If your fediverse account is <code>@[user]@[instance]</code>, your bridged account will have the handle <code>[user].[instance].ap.brid.gy</code> in Bluesky. For example, <a href="https://indieweb.social/@snarfed">@snarfed@indieweb.social</a> is bridged into Bluesky as <a href="https://bsky.app/profile/snarfed.indieweb.social.ap.brid.gy">@snarfed.indieweb.social.ap.brid.gy</a>.</p>
|
||||
<p>Bluesky limits profile bios to 256 characters, so if yours is longer in the fediverse, it will be truncated and ellipsized.</p>
|
||||
<p>Alternatively, <a href="#fediverse-follow">you can find and follow bridged Bluesky accounts</a> without bridging your own account, but they won't see your posts or interactions.<p>
|
||||
</li>
|
||||
|
||||
|
||||
<li id="fediverse-follow-bluesky" class="question">How do I find a bridged Bluesky account?</li>
|
||||
<li class="answer">
|
||||
<p>Bridged Bluesky accounts appear in the fediverse as <code>@[handle]@bsky.brid.gy</code>. For example, <a href="https://bsky.app/profile/snarfed.bsky.social">@snarfed.bsky.social</a> on Bluesky is bridged into the fediverse as <code>@snarfed.bsky.social@bsky.brid.gy</code>.</p>
|
||||
</li>
|
||||
|
||||
|
||||
<li id="fediverse-protocol-bot-user-blocked" class="question">I can't find <code>@bsky.brid.gy@bsky.brid.gy</code> on the fediverse!</li>
|
||||
<li class="answer">
|
||||
<p>If you search for <code>@bsky.brid.gy@bsky.brid.gy</code> on your fediverse instance and you don't see any results, your server may be blocking Bridgy Fed. Check your server's <em>About</em> page to see if <code>bsky.brid.gy</code> or <code>brid.gy</code> are in the <em>Moderated servers</em>section. If they are, you can ask your server admin to reconsider, and include a link to this page for more details.</p>
|
||||
</li>
|
||||
|
||||
|
||||
<li id="fediverse-follow-web" class="question">How do I find a bridged web site?</li>
|
||||
<li class="answer">
|
||||
<p>You can follow any web site, eg <a class="handle" href="https://example.com/">example.com</a>, by searching for <span class="handle">@example.com@web.brid.gy</span> in your fediverse instance.</p>
|
||||
<p>Bridged web sites appear in the fediverse as either <code>@[domain]@[domain]</code>, <code>@[domain]@web.brid.gy</code>, or <code>@[domain]@fed.brid.gy</code>, depending on the fediverse server and whether the web site owner has <a href="#fediverse-enhanced">connected their domain to Bridgy Fed</a>. All bridged web sites behave the same in the fediverse; the different instances in their handles are purely cosmetic.</p>
|
||||
</li>
|
||||
|
||||
|
||||
<li id="fediverse-DM" class="question">What is this DM I got from a <code>*.brid.gy</code> account?</li>
|
||||
<li class="answer">
|
||||
<p>In the future, if you haven't opted into the bridge, and someone wants to follow you from a different network, they can request to follow you from the Bridgy Fed home page. The first time this happens, Bridgy Fed will send you a DM to introduce itself and ask if you want to opt into bridging your account. If you reply <em>yes</em>, or follow the Bridgy Fed account that DMed you, your account will be bridged. If you do nothing, or reply <em>no</em> or block the Bridgy Fed account, you won't be bridged.</p>
|
||||
</li>
|
||||
|
||||
|
||||
<li id="fediverse-no-DM" class="question">Someone requested to follow me, but I never got the DM!</li>
|
||||
<li class="answer">
|
||||
<p>Does your fediverse instance support DMs? Only some do. Otherwise, <a href="#bluesky-protocol-bot-user-blocked">if your instance is blocking Bridgy Fed</a>, you won't receive the DM. Or if it's <a href="https://docs.joinmastodon.org/admin/moderation/#limit-server">limiting</a> Bridgy Fed, or you're filtering notifications (this is sometimes on by default!), check the <em>Filtered notifications</em> section of your mention notifications.</p>
|
||||
<p>Having said that, if you want to bridge your account, you don't need the DM! Just <a href="#fediverse-get-started">follow or DM <em>yes</em> to <code>@bsky.brid.gy@bsky.brid.gy</code></a>.</p>
|
||||
</li>
|
||||
|
||||
<li id="fediverse-what" class="question">Which stuff of mine from the fediverse will get bridged?</li>
|
||||
<li class="answer">
|
||||
<p>Anything that interacts with Bluesky users. This includes replies, @-mentions, likes, reposts, and if you have any Bluesky followers, your own posts. Posts on Bluesky are limited to 300 characters, so longer posts from the fediverse are truncated and ellipsized. Hashtags, links, link previews, images, and even alt text are also included, but not videos since Bluesky itself doesn't support them.</p>
|
||||
</li>
|
||||
|
||||
|
||||
<br>
|
||||
|
||||
|
||||
<h3 id="to-fediverse">To the fediverse</h3>
|
||||
|
||||
<li id="fediverse-servers" class="question">Which fediverse servers are supported?</li>
|
||||
<li class="answer">
|
||||
<p>Lots! <a href="https://joinmastodon.org/">Mastodon</a>, <a href="https://friendi.ca/">Friendica</a>, <a href="https://misskey.page/">Misskey</a>, <a href="https://joinpeertube.org/">PeerTube</a>, <a href="https://hubzilla.org/">Hubzilla</a>, and more. We're working on interoperation with others; <a href="https://github.com/snarfed/bridgy-fed/issues/12">see GitHub issues with the <code>app</code> label for details.</a></p>
|
||||
</li>
|
||||
|
||||
<li id="mastodon-link-verification" class="question">How do I verify my profile links (ie get green checks) in Mastodon?</li>
|
||||
<li class="answer">
|
||||
<p>Mastodon's verified profile links with ✅ green checks are fun! <a href="https://docs.joinmastodon.org/user/profile/#verification"></a> Follow these steps to get one on your Bridgy Fed profile:</p>
|
||||
|
||||
<ul>
|
||||
<li>Add a <a href="https://indieweb.org/rel-me"><code>rel=me</code> link</a> on your site that points to <code>https://web.brid.gy/r/https://[DOMAIN]/</code> for your domain, eg <code>https://web.brid.gy/r/https://snarfed.org/</code></li>
|
||||
<li>Click the <button class="btn btn-default glyphicon glyphicon-refresh"></button> button on your Bridgy Fed <a href="#user-page">user page</a> to update your profile on all of your followers' instances.</li>
|
||||
<li>Log into any Mastodon instance where you have an account.</li>
|
||||
<li>Search for your fediverse handle, eg <code>@snarfed.org@snarfed.org</code>.</li>
|
||||
<li>Click on your fediverse user in the search results.</li>
|
||||
<li>Wait a minute or two (or ten 😐), then refresh the page. You should see a green check on the profile link for your web site.</li>
|
||||
</ul>
|
||||
|
||||
<p>When you're logged into a Mastodon instance, searching for your Bridgy Fed user triggers that instance to check and verify its profile link(s) in the background. This only works when you're logged in with a native Mastodon account. Also, each instance does this independently; verified links are not synched across instances.</p>
|
||||
</li>
|
||||
|
||||
<li id="fediverse-enhanced" class="question">Can I use my own domain as my fediverse handle?</li>
|
||||
<li class="answer">
|
||||
<p>Yes! By default, bridged fediverse handles use a subdomain of <code>brid.gy</code> as their instance, eg <code>@mysite.com@web.brid.gy</code>, but you can change the instance part to your own domain. It takes a bit of setup and technical know-how, but it's very doable.</p>
|
||||
<p>First, your domain needs to serve HTTP requests. You don't need an actual web site, but you do need a minimal web server.<p>
|
||||
<p>Second, your web server needs to support SSL. Bridgy Fed uses your domain as your identity, so it depends on SSL to prove that you own it.</p>
|
||||
<p>Lastly, your web server needs to redirect a couple URL paths, including query parameters, to the same paths on <code>https://fed.brid.gy/</code>:</li>
|
||||
<pre>
|
||||
/.well-known/host-meta
|
||||
/.well-known/webfinger
|
||||
</pre>
|
||||
|
||||
<p>Here are instructions for a few common web servers:</p>
|
||||
|
||||
<ul>
|
||||
<li>
|
||||
<p><em><a href="http://wordpress.org/">WordPress</a> (self-hosted)</em>: install the <a href="https://wordpress.org/plugins/safe-redirect-manager/">Safe Redirect Manager</a> plugin, then add these entries:</p>
|
||||
<code>
|
||||
/.well-known/host-meta* => https://fed.brid.gy/.well-known/host-meta*<br/>
|
||||
/.well-known/webfinger* => https://fed.brid.gy/.well-known/webfinger*
|
||||
</code>
|
||||
</li>
|
||||
|
||||
<li><em><a href="http://withknown.com/">Known</a></em> or <em><a href="https://drupal.org/project/indieweb">Drupal</a></em>: follow the <a href="#apache">Apache</a> or <a href="#nginx">nginx</a> instructions below.
|
||||
</li>
|
||||
|
||||
<li id="apache"><em><a href="http://httpd.apache.org/">Apache</a></em>: add this to your <code>.htaccess</code> file:<br />
|
||||
<pre>RewriteEngine on
|
||||
RewriteBase /
|
||||
RewriteRule ^.well-known/(host-meta|webfinger).* https://fed.brid.gy/$0 [redirect=302,last]</pre>
|
||||
(<code>RewriteEngine on</code> is optional if you already have it earlier in your <code>.htaccess</code>. <code>RewriteBase /</code> is optional if you don't have any other <code>RewriteBase</code> directives, or if you put this <code>RewriteRule</code> inside an existing <code>RewriteBase /</code> section.)
|
||||
</li>
|
||||
|
||||
<li id="nginx"><em><a href="https://nginx.org/">nginx</a></em>: add this to your <code>nginx.conf</code> file, in the <code>server</code> section:<br />
|
||||
<pre>rewrite ^/\.well-known/(host-meta|webfinger).* https://fed.brid.gy$request_uri? redirect;</pre>
|
||||
</li>
|
||||
|
||||
<li id="netlify"><em><a href="https://docs.netlify.com/routing/redirects/">Netlify</a></em>: add this to your <code>netlify.toml</code> file.
|
||||
<pre>
|
||||
[[redirects]]
|
||||
from = "/.well-known/host-meta*"
|
||||
to = "https://fed.brid.gy/.well-known/host-meta:splat"
|
||||
status = 302
|
||||
[[redirects]]
|
||||
from = "/.well-known/webfinger*"
|
||||
to = "https://fed.brid.gy/.well-known/webfinger"
|
||||
status = 302
|
||||
</pre>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
|
||||
<br>
|
||||
|
||||
<h3 id="from-bluesky">From Bluesky</h3>
|
||||
|
||||
<li id="bluesky-get-started" class="question">How do I get started?</li>
|
||||
<li class="answer">
|
||||
<p>To bridge your Bluesky account into the fediverse and interact with people there, follow <a href="https://bsky.app/profile/ap.brid.gy">@ap.brid.gy</a> on Bluesky.</p>
|
||||
<p><a href="https://fed.brid.gy/docs#bluesky-delay">After a few minutes</a>, your Bluesky account will appear in the fediverse as <code>@[handle]@bsky.brid.gy</code>. For example, <a href="https://bsky.app/profile/snarfed.bsky.social">@snarfed.bsky.social</a> on Bluesky is bridged into the fediverse as <code>@snarfed.bsky.social@bsky.brid.gy</code>.</p>
|
||||
<p>Alternatively, <a href="#bluesky-follow">you can find and follow bridged fediverse accounts</a> without bridging your own account, but they won't see your posts or interactions.<p>
|
||||
</li>
|
||||
|
||||
|
||||
<li id="bluesky-follow" class="question">How do I find a bridged fediverse account?</li>
|
||||
<li class="answer">
|
||||
<p>Bridged fediverse accounts appear in Bluesky as <code>@[user].[instance].ap.brid.gy</code>. For example, <a href="https://indieweb.social/@snarfed">@snarfed@indieweb.social</a> is bridged into Bluesky as <a href="https://bsky.app/profile/snarfed.indieweb.social.ap.brid.gy">@snarfed.indieweb.social.ap.brid.gy</a>.</p>
|
||||
</li>
|
||||
|
||||
|
||||
<li id="bluesky-delay" class="question">I followed <a href="https://bsky.app/profile/ap.brid.gy">@ap.brid.gy</a>, or followed someone else or posted or did something else in Bluesky, but it hasn't shown up in the fediverse yet!</li>
|
||||
<li class="answer">
|
||||
<p>Bluesky uses a pull-based event architecture, so we have to poll every bridged user's notifications to discover and bridge interactions, including your initial follow of <a href="https://bsky.app/profile/ap.brid.gy">@ap.brid.gy</a>. We currently do this every 5 minutes. Sorry for the delay!
|
||||
</li>
|
||||
|
||||
|
||||
<li id="bluesky-what-from" class="question">Which stuff of mine from Bluesky will get bridged?</li>
|
||||
<li class="answer">
|
||||
<p>Anything that interacts with fediverse users. This includes replies, @-mentions, likes, reposts, and if you have any fediverse followers, your own posts. Hashtags, links, link previews, images, and even alt text are also included.</p>
|
||||
|
||||
|
||||
<li id="bluesky-reply-controls" class="question">Can I use Bluesky's reply controls?</li>
|
||||
<li class="answer">
|
||||
<p>Yes! Bluesky's <a href="https://bsky.app/profile/safety.bsky.app/post/3khhw67cxqg22">reply controls</a> apply to accounts bridged from the fediverse as well as to native Bluesky accounts.</p>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<br>
|
||||
|
||||
<h3 id="to-bluesky">To Bluesky</h3>
|
||||
|
||||
<li id="bluesky-what-to" class="question">Which stuff of mine can get bridged into Bluesky?</li>
|
||||
<li class="answer">
|
||||
<p>Profiles, following, posts, replies, likes, reposts, images, hashtags, and @-mentions.</p>
|
||||
</li>
|
||||
|
||||
<li id="bluesky-what-not-to" class="question">Which stuff can't get bridged into Bluesky?</li>
|
||||
<li class="answer">
|
||||
<p><a href="https://github.com/bluesky-social/atproto/discussions/1310">Polls</a>, edits/updates, <a href="https://docs.joinmastodon.org/user/posting/#cw">content warnings</a>, videos or (most) GIFs. <a href="https://github.com/snarfed/bridgy-fed/issues/987">Deletes aren't supported yet, but they're on the roadmap.</a></p>
|
||||
</li>
|
||||
|
||||
<li id="bluesky-hashtags-in-text" class="question">Why didn't my hashtag show up?</li>
|
||||
<li class="answer">
|
||||
<p>To appear in Bluesky, hashtags need to be in your post text, not just attached separately.</a></p>
|
||||
</li>
|
||||
|
||||
<li id="bluesky-report" class="question">What happens when I report a bridged Bluesky user?</li>
|
||||
<li class="answer">
|
||||
<p>Bridgy Fed sends your report to the Bluesky team's <a href="official moderation service">official moderation service</a>, which handles it, and takes action if necessary, just like with native Bluesky accounts.</p>
|
||||
<p>Also see Bridgy Fed's <a href="#moderation-policy">moderation policy</a> and <a href="#moderation">functionality</a>.</p>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
<br>
|
||||
|
||||
<h3>From the web</h3>
|
||||
|
@ -247,6 +503,7 @@
|
|||
</p>
|
||||
</li>
|
||||
|
||||
|
||||
<li id="web-profile" class="question">Where does my profile info come from?</li>
|
||||
<li class="answer">
|
||||
<p>Your site's bridged profile can come from a few different things on your home page. Here's what Bridgy Fed looks for, in order of preference:
|
||||
|
@ -276,11 +533,6 @@
|
|||
</p>
|
||||
</li>
|
||||
|
||||
<li id="web-update-profile" class="question">How do I update my profile?</li>
|
||||
<li class="answer">
|
||||
<p> If you've changed the <a href="#web-profile">profile metadata</a> on your site's home page and you want to update your profile in bridged networks, click the <button class="btn btn-default glyphicon glyphicon-refresh"></button> button next to your domain <a href="/web-site">on your user page</a>. Alternatively, you can send a webmention from your home page to <code>https://fed.brid.gy/</code>.
|
||||
</li>
|
||||
|
||||
|
||||
<li id="web-how-post" class="question">How does Bridgy Fed find my posts?</li>
|
||||
<li class="answer">
|
||||
|
@ -305,7 +557,7 @@
|
|||
</p>
|
||||
</li>
|
||||
|
||||
<li id="web-interpret" class="question">How does it interpret and translate my post?</li>
|
||||
<li id="web-interpret" class="question">How does it interpret and translate my posts?</li>
|
||||
<li class="answer">
|
||||
<p>If your post has <a href="http://microformats.org/">microformats</a>, which many web servers include automatically, Bridgy Fed uses them to determine whether it's a <a href="https://indieweb.org/note#How_to">note</a>, <a href="https://indieweb.org/article">article</a>, <a href="#web-like">like</a>, <a href="#web-repost">repost</a>, <a href="#web-reply">reply</a>, or <a href="#web-follow">follow</a>. Here's an example of a note:
|
||||
|
||||
|
@ -528,96 +780,11 @@ To receive likes, reposts, replies, @-mentions, and follows from the fediverse,
|
|||
<p>Another difficulty is that accounts on Bluesky and Nostr have long-lived, server-independent ids. If we used a Bluesky user's PDS domain in their fediverse handle, that handle would change every time they migrated to a new PDS, and they'd lose all of their followers and followings, even though their Bluesky account ID itself hadn't changed.</p>
|
||||
</li>
|
||||
|
||||
<br>
|
||||
|
||||
<h3 id="from-fediverse">From the fediverse</h3>
|
||||
|
||||
<li id="fediverse-follow" class="question">How do I follow someone from the fediverse?</li>
|
||||
<li class="answer">
|
||||
<p>You can follow any web site, eg <a class="handle" href="https://example.com/">example.com</a>, by searching for <span class="handle">@example.com@web.brid.gy</span> in your fediverse instance.</p>
|
||||
<p>Bridged web sites appear in the fediverse as either <code>@[domain]@[domain]</code>, <code>@[domain]@web.brid.gy</code>, or <code>@[domain]@fed.brid.gy</code>, depending on the fediverse server and whether the web site owner has <a href="#fediverse-enhanced">connected their domain to Bridgy Fed</a>. All bridged web sites behave the same in the fediverse; the different instances in their handles are purely cosmetic.</p>
|
||||
</li>
|
||||
|
||||
<br>
|
||||
|
||||
<h3 id="to-fediverse">To the fediverse</h3>
|
||||
|
||||
<li id="fediverse-servers" class="question">Which fediverse servers are supported?</li>
|
||||
<li class="answer">
|
||||
<p>Lots! <a href="https://joinmastodon.org/">Mastodon</a>, <a href="https://friendi.ca/">Friendica</a>, <a href="https://misskey.page/">Misskey</a>, <a href="https://joinpeertube.org/">PeerTube</a>, <a href="https://hubzilla.org/">Hubzilla</a>, and more. We're working on interoperation with others; <a href="https://github.com/snarfed/bridgy-fed/issues/12">see GitHub issues with the <code>app</code> label for details.</a></p>
|
||||
</li>
|
||||
|
||||
<li id="mastodon-link-verification" class="question">How do I verify my profile links (ie get green checks) in Mastodon?</li>
|
||||
<li class="answer">
|
||||
<p>Mastodon's verified profile links with ✅ green checks are fun! <a href="https://docs.joinmastodon.org/user/profile/#verification"></a> Follow these steps to get one on your Bridgy Fed profile:</p>
|
||||
|
||||
<ul>
|
||||
<li>Add a <a href="https://indieweb.org/rel-me"><code>rel=me</code> link</a> on your site that points to <code>https://web.brid.gy/r/https://[DOMAIN]/</code> for your domain, eg <code>https://web.brid.gy/r/https://snarfed.org/</code></li>
|
||||
<li>Click the <button class="btn btn-default glyphicon glyphicon-refresh"></button> button on your Bridgy Fed <a href="#user-page">user page</a> to update your profile on all of your followers' instances.</li>
|
||||
<li>Log into any Mastodon instance where you have an account.</li>
|
||||
<li>Search for your fediverse handle, eg <code>@snarfed.org@snarfed.org</code>.</li>
|
||||
<li>Click on your fediverse user in the search results.</li>
|
||||
<li>Wait a minute or two (or ten 😐), then refresh the page. You should see a green check on the profile link for your web site.</li>
|
||||
</ul>
|
||||
|
||||
<p>When you're logged into a Mastodon instance, searching for your Bridgy Fed user triggers that instance to check and verify its profile link(s) in the background. This only works when you're logged in with a native Mastodon account. Also, each instance does this independently; verified links are not synched across instances.</p>
|
||||
</li>
|
||||
|
||||
<li id="fediverse-enhanced" class="question">Can I use my own domain as my fediverse handle?</li>
|
||||
<li class="answer">
|
||||
<p>Yes! By default, bridged fediverse handles use a subdomain of <code>brid.gy</code> as their instance, eg <code>@mysite.com@web.brid.gy</code>, but you can change the instance part to your own domain. It takes a bit of setup and technical know-how, but it's very doable.</p>
|
||||
<p>First, your domain needs to serve HTTP requests. You don't need an actual web site, but you do need a minimal web server.<p>
|
||||
<p>Second, your web server needs to support SSL. Bridgy Fed uses your domain as your identity, so it depends on SSL to prove that you own it.</p>
|
||||
<p>Lastly, your web server needs to redirect a couple URL paths, including query parameters, to the same paths on <code>https://fed.brid.gy/</code>:</li>
|
||||
<pre>
|
||||
/.well-known/host-meta
|
||||
/.well-known/webfinger
|
||||
</pre>
|
||||
|
||||
<p>Here are instructions for a few common web servers:</p>
|
||||
|
||||
<ul>
|
||||
<li>
|
||||
<p><em><a href="http://wordpress.org/">WordPress</a> (self-hosted)</em>: install the <a href="https://wordpress.org/plugins/safe-redirect-manager/">Safe Redirect Manager</a> plugin, then add these entries:</p>
|
||||
<code>
|
||||
/.well-known/host-meta* => https://fed.brid.gy/.well-known/host-meta*<br/>
|
||||
/.well-known/webfinger* => https://fed.brid.gy/.well-known/webfinger*
|
||||
</code>
|
||||
</li>
|
||||
|
||||
<li><em><a href="http://withknown.com/">Known</a></em> or <em><a href="https://drupal.org/project/indieweb">Drupal</a></em>: follow the <a href="#apache">Apache</a> or <a href="#nginx">nginx</a> instructions below.
|
||||
</li>
|
||||
|
||||
<li id="apache"><em><a href="http://httpd.apache.org/">Apache</a></em>: add this to your <code>.htaccess</code> file:<br />
|
||||
<pre>RewriteEngine on
|
||||
RewriteBase /
|
||||
RewriteRule ^.well-known/(host-meta|webfinger).* https://fed.brid.gy/$0 [redirect=302,last]</pre>
|
||||
(<code>RewriteEngine on</code> is optional if you already have it earlier in your <code>.htaccess</code>. <code>RewriteBase /</code> is optional if you don't have any other <code>RewriteBase</code> directives, or if you put this <code>RewriteRule</code> inside an existing <code>RewriteBase /</code> section.)
|
||||
</li>
|
||||
|
||||
<li id="nginx"><em><a href="https://nginx.org/">nginx</a></em>: add this to your <code>nginx.conf</code> file, in the <code>server</code> section:<br />
|
||||
<pre>rewrite ^/\.well-known/(host-meta|webfinger).* https://fed.brid.gy$request_uri? redirect;</pre>
|
||||
</li>
|
||||
|
||||
<li id="netlify"><em><a href="https://docs.netlify.com/routing/redirects/">Netlify</a></em>: add this to your <code>netlify.toml</code> file.
|
||||
<pre>
|
||||
[[redirects]]
|
||||
from = "/.well-known/host-meta*"
|
||||
to = "https://fed.brid.gy/.well-known/host-meta:splat"
|
||||
status = 302
|
||||
[[redirects]]
|
||||
from = "/.well-known/webfinger*"
|
||||
to = "https://fed.brid.gy/.well-known/webfinger"
|
||||
status = 302
|
||||
</pre>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
|
||||
<br>
|
||||
|
||||
<h3 id="about">About</h3>
|
||||
<h3 id="background">Background</h3>
|
||||
|
||||
<li id="who" class="question">Who are you? Why did you make this?</li>
|
||||
<li class="answer">
|
||||
|
@ -659,7 +826,7 @@ I'm <a href="https://snarfed.org/">Ryan Barrett</a>. I'm just a guy who likes <a
|
|||
<p><a href="https://snarfed.org/2024-01-19_moderate-people-not-code">Content moderation for decentralized social networks, and for bridges, is complicated.</a> Bridgy Fed itself doesn't have an exhaustive content moderation policy. Instead, I try to keep these principles in mind:</p>
|
||||
<ul>
|
||||
<li>
|
||||
<p><strong>My primary goal is to <a href="#moderation">empower each network's existing moderation ecosystem</a>.</strong> Most decentralized social networks have existing, often mature mechanisms for content moderation. The fediverse has <a href="https://docs.joinmastodon.org/user/moderating/#block">blocks</a> and <a href="https://docs.joinmastodon.org/admin/moderation/#server-wide-moderation">defederation</a> and <a href="https://about.iftas.org/">IFTAS</a>, the IndieWeb has <a href="https://indieweb.org/Vouch">Vouch</a> and <a href="https://akismet.com/">Akismet</a>, Bluesky has <a href="https://blueskyweb.xyz/blog/4-13-2023-moderation">labeling</a>, even Nostr has <a href="https://github.com/nostr-protocol/nips/blob/master/28.md">mutes</a> and <a href="https://github.com/nostr-protocol/nips/blob/master/51.md#standard-lists">shared mutelists</a> and <a href="https://github.com/nostr-protocol/nips/blob/master/72.md">moderated groups</a>.</p>
|
||||
<p><strong>My primary goal is to <a href="#moderation">empower each network's existing moderation ecosystem</a>.</strong> Most decentralized social networks have existing, often mature mechanisms for content moderation. The fediverse has <a href="https://docs.joinmastodon.org/user/moderating/#block">blocks</a> and <a href="https://docs.joinmastodon.org/admin/moderation/#server-wide-moderation">defederation</a> and <a href="https://about.iftas.org/">IFTAS</a>, the IndieWeb has <a href="https://indieweb.org/Vouch">Vouch</a> and <a href="https://akismet.com/">Akismet</a>, Bluesky has <a href="https://bsky.social/about/blog/4-13-2023-moderation">labeling</a>, even Nostr has <a href="https://github.com/nostr-protocol/nips/blob/master/28.md">mutes</a> and <a href="https://github.com/nostr-protocol/nips/blob/master/51.md#standard-lists">shared mutelists</a> and <a href="https://github.com/nostr-protocol/nips/blob/master/72.md">moderated groups</a>.</p>
|
||||
<p>I try to ensure that those mechanisms all work with bridged accounts just as well as with native accounts, up to and including defederation. I'm always ready to hear admins' concerns and try to help! But if an instance determines that they need to block a Bridgy Fed network (domain) entirely, that's their prerogative, and I'll support them.</p>
|
||||
</li>
|
||||
<li>
|
||||
|
@ -784,7 +951,7 @@ I'm <a href="https://snarfed.org/">Ryan Barrett</a>. I'm just a guy who likes <a
|
|||
<td><a href="https://websub.net/">push</a>/<a href="https://indieweb.org/Microsub">pull</a> posts</a>,<br>
|
||||
<a href="https://webmention.net/">push responses</a></td>
|
||||
<td><a href="https://www.w3.org/TR/activitypub/#delivery">push</a></td>
|
||||
<td><a href="https://blueskyweb.xyz/blog/5-5-2023-federation-architecture">pull</a></td>
|
||||
<td><a href="https://bsky.social/about/blog/5-5-2023-federation-architecture">pull</a></td>
|
||||
<td><a href="https://github.com/nostr-protocol/nips/blob/master/01.md#from-client-to-relay-sending-events-and-creating-subscriptions">pull</a></td>
|
||||
</tr>
|
||||
|
||||
|
@ -800,8 +967,8 @@ I'm <a href="https://snarfed.org/">Ryan Barrett</a>. I'm just a guy who likes <a
|
|||
<th>topology</th>
|
||||
<td>peer to peer</td>
|
||||
<td><a href="https://activitypub.rocks/">federated servers, two tier</a></td>
|
||||
<td><a href="https://blueskyweb.xyz/blog/5-5-2023-federation-architecture">federated servers</a>,<br>
|
||||
<a href="https://blueskyweb.xyz/blog/4-13-2023-moderation">decoupled</a> <a href="https://blueskyweb.xyz/blog/3-30-2023-algorithmic-choice">services</a>, multi-tier</td>
|
||||
<td><a href="https://bsky.social/about/blog/5-5-2023-federation-architecture">federated servers</a>,<br>
|
||||
<a href="https://bsky.social/about/blog/4-13-2023-moderation">decoupled</a> <a href="https://bsky.social/about/blog/3-30-2023-algorithmic-choice">services</a>, multi-tier</td>
|
||||
<td><a href="https://github.com/nostr-protocol/nostr#how-does-nostr-work">interchangeable relays,<br>two tier</a></td>
|
||||
</tr>
|
||||
|
||||
|
@ -820,7 +987,7 @@ I'm <a href="https://snarfed.org/">Ryan Barrett</a>. I'm just a guy who likes <a
|
|||
<th>app semantics live in...</th>
|
||||
<td>servers, clients</td>
|
||||
<td>servers, clients</td>
|
||||
<td><a href="https://blueskyweb.xyz/blog/5-5-2023-federation-architecture">dedicated service</a>, clients</td>
|
||||
<td><a href="https://bsky.social/about/blog/5-5-2023-federation-architecture">dedicated service</a>, clients</td>
|
||||
<td>clients</td>
|
||||
</tr>
|
||||
|
||||
|
@ -836,7 +1003,7 @@ I'm <a href="https://snarfed.org/">Ryan Barrett</a>. I'm just a guy who likes <a
|
|||
<th>monetization</th>
|
||||
<td><a href="https://indieweb.org/business-models">hosting</a></td>
|
||||
<td>donations</td>
|
||||
<td><a href="https://blueskyweb.xyz/blog/7-05-2023-business-plan">services</a></td>
|
||||
<td><a href="https://bsky.social/about/blog/7-05-2023-business-plan">services</a></td>
|
||||
<td><a href="https://nostr.how/en/zaps">microtransactions</a></td>
|
||||
</tr>
|
||||
|
||||
|
@ -865,7 +1032,7 @@ I'm <a href="https://snarfed.org/">Ryan Barrett</a>. I'm just a guy who likes <a
|
|||
<td><a href="https://indieweb.org/">IndieWeb</a> <a href="https://www.oscollective.org/">non-profit</a>,<br>
|
||||
<a href="https://www.w3.org/community/socialcg/">some W3C</a></td>
|
||||
<td><a href="https://socialhub.activitypub.rocks/t/about-the-fediverse-enhancement-proposals/1168">FEPs</a>, <a href="https://www.w3.org/community/socialcg/">some W3C</a></td>
|
||||
<td><a href="https://blueskyweb.xyz/blog/7-05-2023-business-plan">Bluesky C-corp now</a>,<br>
|
||||
<td><a href="https://bsky.social/about/blog/7-05-2023-business-plan">Bluesky C-corp now</a>,<br>
|
||||
<a href="https://blue.amazingca.dev/user/did:plc:44ybard66vv44zksje25o7dz/post/3k3p6upex4x2l">IETF eventually?</a></td>
|
||||
<td><a href="https://fiatjaf.com/">mildly BDFL(s) now</a>,<br>
|
||||
<a href="https://github.com/nostr-protocol/nips/issues/162">decentralized eventually?</a></td>
|
||||
|
@ -877,11 +1044,11 @@ I'm <a href="https://snarfed.org/">Ryan Barrett</a>. I'm just a guy who likes <a
|
|||
|
||||
<li id="translate" class="question">How are the different protocols translated?</li>
|
||||
<li class="answer">
|
||||
<p>Here are internal details on how Bridgy Fed translates user identity and events between protocols, including some like <a href="https://github.com/nostr-protocol/nostr">Nostr</a> and <a href="https://blueskyweb.xyz/">Bluesky</a>/<a href="https://atproto.com/">AT Protocol</a> that aren't launched here, or even fully implemented or thought through yet. Caveat hacker!</p>
|
||||
<p>Here are internal details on how Bridgy Fed translates user identity and events between protocols, including some like <a href="https://github.com/nostr-protocol/nostr">Nostr</a>/<a href="https://atproto.com/">AT Protocol</a> that aren't launched here, or even fully implemented or thought through yet. Caveat hacker!</p>
|
||||
|
||||
<p>In the tables below, BF is Bridgy Fed. <span class="done">Green parts</span> have been implemented and running here for years, the rest are still in the early design phase.</p>
|
||||
|
||||
<p>Here's how we (hope to) translate <em>user identity</em> between protocols. Specifically, each cell shows how a user in a given column is identified to the protocol in a given row. These identities uniquely identify users, and are intended primarily to be machine readable and usable. (Scroll down for the equivalent table for translating human-meaningful user handles.)</p>
|
||||
<p>Here's how we translate <em>user identity</em> between protocols. Specifically, each cell shows how a user in a given column is identified to the protocol in a given row. These identities uniquely identify users, and are intended primarily to be machine readable and usable. (Scroll down for the equivalent table for translating human-meaningful user handles.)</p>
|
||||
|
||||
<p>Note that Bridgy Fed generates some of these ids itself behind the scenes, notably <a href="https://atproto.com/specs/did-plc"><code>did:plc</code>s</a> for Bluesky/AT Protocol and <a href="https://github.com/nostr-protocol/nips/blob/master/19.md#bare-keys-and-ids">npub</a></code> public keys</a> for Nostr.</p>
|
||||
|
||||
|
@ -901,7 +1068,7 @@ I'm <a href="https://snarfed.org/">Ryan Barrett</a>. I'm just a guy who likes <a
|
|||
<th>Web URL</th>
|
||||
<td class="na">-</td>
|
||||
<td class="done">Fediverse profile URL</td>
|
||||
<td class="done"><code>https://bsky.app/profile/[<a href="https://atproto.com/specs/did">did</a>]</code><br>
|
||||
<td class="done"><code>https://bsky.app/profile/[<a href="https://atproto.com/specs/handle">handle</a>]</code><br>
|
||||
(<a href="https://github.com/bluesky-social/atproto/discussions/1652">can we avoid hard-coding bsky.app?</a>)</td>
|
||||
<td><a href="https://github.com/nostr-protocol/nips/blob/master/05.md">NIP-05</a> domain or BF user page</td>
|
||||
</tr>
|
||||
|
@ -924,8 +1091,8 @@ I'm <a href="https://snarfed.org/">Ryan Barrett</a>. I'm just a guy who likes <a
|
|||
|
||||
<tr>
|
||||
<th>AT Protocol</th>
|
||||
<td><a href="https://atproto.com/specs/did-plc"><code>did:plc</code></a></td>
|
||||
<td><a href="https://atproto.com/specs/did-plc"><code>did:plc</code></a></td>
|
||||
<td class="done"><a href="https://atproto.com/specs/did-plc"><code>did:plc</code></a></td>
|
||||
<td class="done"><a href="https://atproto.com/specs/did-plc"><code>did:plc</code></a></td>
|
||||
<td class="na">-</td>
|
||||
<td><a href="https://atproto.com/specs/did-plc"><code>did:plc</code></a></td>
|
||||
</tr>
|
||||
|
@ -942,7 +1109,7 @@ I'm <a href="https://snarfed.org/">Ryan Barrett</a>. I'm just a guy who likes <a
|
|||
</table>
|
||||
|
||||
|
||||
<p>Here's how we (hope to) translate <em>user handles</em> (aka usernames) between protocols. Each cell shows how a user's handle in a given column is translated to the protocol in a given row. These handles are human-chosen, human-meaningful, generally unique, but may not be the primary machine-usable ids in each protocol. Scroll down to the next table for examples, up to the previous table for machine-usable ids.</p>
|
||||
<p>Here's how we translate <em>user handles</em> (aka usernames) between protocols. Each cell shows how a user's handle in a given column is translated to the protocol in a given row. These handles are human-chosen, human-meaningful, generally unique, but may not be the primary machine-usable ids in each protocol. Scroll down to the next table for examples, up to the previous table for machine-usable ids.</p>
|
||||
|
||||
<p><em>Basic</em> is the default, <em>enhanced</em> requires extra setup on the user's part (or their fediverse instance's) to forward some of their <code>/.well-known</code> HTTP requests to Bridgy Fed.</p>
|
||||
|
||||
|
@ -979,7 +1146,7 @@ I'm <a href="https://snarfed.org/">Ryan Barrett</a>. I'm just a guy who likes <a
|
|||
<tr>
|
||||
<th class="subhead">enhanced</th>
|
||||
<td class="done"><code>@[domain]@[domain]</code></td>
|
||||
<td class="done"><code>@[<a href="https://atproto.com/specs/handle">handle</a>]@[<a href="https://atproto.com/specs/handle">handle</a>]</code></td>
|
||||
<td><code>@[<a href="https://atproto.com/specs/handle">handle</a>]@[<a href="https://atproto.com/specs/handle">handle</a>]</code></td>
|
||||
<td><code>@[<a href="https://github.com/nostr-protocol/nips/blob/master/05.md">NIP-05</a>]</code></td>
|
||||
</tr>
|
||||
|
||||
|
@ -1049,13 +1216,13 @@ I'm <a href="https://snarfed.org/">Ryan Barrett</a>. I'm just a guy who likes <a
|
|||
<th class="subhead">basic</th>
|
||||
<td><code>@me.com@web.brid.gy</code></td>
|
||||
<td rowspan="2" class="na">-</td>
|
||||
<td><code>@me.com@bsky.brid.gy</code></td>
|
||||
<td class="done"><code>@me.com@bsky.brid.gy</code></td>
|
||||
<td><code>@me[domain.]com@nostr.brid.gy</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="subhead">enhanced</th>
|
||||
<td class="done"><code>@me.com@me.com</code></td>
|
||||
<td class="done"><code>@me.com@me.com</code></td>
|
||||
<td><code>@me.com@me.com</code></td>
|
||||
<td><code>@me@domain.com</code><br>
|
||||
<code>@me.com@me.com</code></td>
|
||||
</tr>
|
||||
|
@ -1071,7 +1238,7 @@ I'm <a href="https://snarfed.org/">Ryan Barrett</a>. I'm just a guy who likes <a
|
|||
<tr>
|
||||
<th class="subhead">enhanced</th>
|
||||
<td class="done"><code>me.com</code></td>
|
||||
<td class="done"><code>me.instance.com</code></td>
|
||||
<td><code>me.instance.com</code></td>
|
||||
<td><code>me.[domain.]com</code></td>
|
||||
</tr>
|
||||
|
||||
|
@ -1094,7 +1261,7 @@ I'm <a href="https://snarfed.org/">Ryan Barrett</a>. I'm just a guy who likes <a
|
|||
</table>
|
||||
|
||||
|
||||
<p>Here's how we (hope to) infer the protocol for any string id. In the Format column, <span class="yes">green parts</span> are deterministic, ie they conclusively determine that a matching id belongs to the protocol, and <span class="maybe">yellow parts</span> are ambiguous, ie a matching id may or may not belong to the protocol:
|
||||
<p>Here's how we infer the protocol for any string id. In the Format column, <span class="yes">green parts</span> are deterministic, ie they conclusively determine that a matching id belongs to the protocol, and <span class="maybe">yellow parts</span> are ambiguous, ie a matching id may or may not belong to the protocol:
|
||||
</p>
|
||||
|
||||
<table>
|
||||
|
@ -1191,7 +1358,7 @@ I'm <a href="https://snarfed.org/">Ryan Barrett</a>. I'm just a guy who likes <a
|
|||
</table>
|
||||
|
||||
|
||||
<p>Here's how we (hope to) translate <em>events and operations</em> between protocols, both inbound to and outbound from Bridgy Fed:
|
||||
<p>Here's how we translate <em>events and operations</em> between protocols, both inbound to and outbound from Bridgy Fed:
|
||||
</p>
|
||||
|
||||
<table>
|
||||
|
@ -1207,7 +1374,7 @@ I'm <a href="https://snarfed.org/">Ryan Barrett</a>. I'm just a guy who likes <a
|
|||
<tbody>
|
||||
<tr>
|
||||
<th>User discovery inbound</th>
|
||||
<td>serve <code><a href="https://microformats.org/wiki/h-card">h-card</a></code> on BF user page</td>
|
||||
<td class="done">serve <code><a href="https://microformats.org/wiki/h-card">h-card</a></code> on BF user page</td>
|
||||
<td class="done"><em>basic</em>: serve <a href="https://webfinger.net/">WebFinger</a> and <a href="https://www.w3.org/TR/activitypub/#actors">AP actor</a> on fed.brid.gy<br>
|
||||
<em>enhanced</em>: user's site serves and redirects <a href="https://webfinger.net/">WebFinger</a> to fed.brid.gy
|
||||
</td>
|
||||
|
@ -1232,7 +1399,7 @@ I'm <a href="https://snarfed.org/">Ryan Barrett</a>. I'm just a guy who likes <a
|
|||
<th>Publish outbound</th>
|
||||
<td class="done">serve on BF user page followings <code><a href="https://microformats.org/wiki/h-feed">h-feed</a></code></td>
|
||||
<td class="done">deliver to recipient's <a href="https://www.w3.org/TR/activitypub/#inbox">inbox</a></td>
|
||||
<td class="done">serve repo diff via <a href="https://atproto.com/lexicons/com-atproto-sync"><code>sync</code> XRPCs</a> to subscribing <a href="https://blueskyweb.xyz/blog/5-5-2023-federation-architecture">BGSes</a></td>
|
||||
<td class="done">serve repo diff via <a href="https://atproto.com/lexicons/com-atproto-sync"><code>sync</code> XRPCs</a> to subscribing <a href="https://bsky.social/about/blog/5-5-2023-federation-architecture">BGSes</a></td>
|
||||
<td>serve to subscribers</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
{% extends "user_base.html" %}
|
||||
{% set tab = "home" %}
|
||||
{% set show_activity_actors = True %}
|
||||
|
||||
{% block subtabs %}
|
||||
<div class="row">
|
||||
|
|
|
@ -24,6 +24,10 @@
|
|||
</div>
|
||||
|
||||
<div class="row big front-light">
|
||||
<p>Bridgy Fed connects <a class="web" href="https://indieweb.org/">🌐 web sites</a>, the <a class="fediverse" href="https://enwp.org/fediverse"><img src="/static/fediverse_logo.svg"> fediverse</a>, and <a class="bluesky" href="https://bsky.social/"><img src="/oauth_dropins_static/bluesky.svg"> Bluesky</a>. You can use it to make your profile on one visible in another, follow people, see their posts, and reply and like and repost them. Interactions work in both directions as much as possible. <a href="/docs">See the docs for more info.</a></p>
|
||||
</div>
|
||||
|
||||
<div class="row big front-dark">
|
||||
<p>Got a <span class="web">🌐 web</span> site? Enter it here to use it on the <a class="fediverse" href="https://en.wikipedia.org/wiki/Fediverse"><img src="/static/fediverse_logo.svg"> fediverse</a>:
|
||||
<form method="post" action="/web-site">
|
||||
<input required type="url" name="url" id="url" placeholder="example.com" />
|
||||
|
@ -32,20 +36,24 @@
|
|||
</p>
|
||||
</div>
|
||||
|
||||
<div class="row big front-dark">
|
||||
<p>Got a <a class="fediverse" href="https://en.wikipedia.org/wiki/Fediverse"><img src="/static/fediverse_logo.svg"> fediverse</a> account? Follow any <span class="web">🌐 web</span> site, eg <a class="handle" href="https://example.com/">example.com</a>, by searching for <span class="handle">@example.com@web.brid.gy</span> in your fediverse instance.</p>
|
||||
</div>
|
||||
|
||||
<div class="row big front-light">
|
||||
<p>Bridgy Fed connects some of the most popular decentralized social networks. You can use it from one network to make your profile visible in another network, follow people there, see their posts, and reply and like and repost them. All interactions work in both directions. <a href="/docs">See the docs for more info.</a></p>
|
||||
<p>Got a <a class="fediverse" href="https://en.wikipedia.org/wiki/Fediverse"><img src="/static/fediverse_logo.svg"> fediverse</a> account? <a href="/docs#fediverse-get-started">Bridge it to <span class="bluesky"><img src="/oauth_dropins_static/bluesky.svg"> Bluesky</span></a> by following <em>@bsky.brid.gy@bsky.brid.gy</em><button class="btn btn-default btn-copy glyphicon glyphicon-duplicate" onclick="navigator.clipboard.writeText('@bsky.brid.gy@bsky.brid.gy')"></button>. <!-- <a href="/docs#fediverse-get-started">More details.</a> --></p>
|
||||
<br>
|
||||
<p>Or, <a href="/docs#fediverse-follow-web">follow a <span class="web">🌐 web</span> site</a> like <a class="handle" href="https://example.com/">example.com</a> by searching for <span class="handle">@example.com@web.brid.gy</span><button class="btn btn-default btn-copy glyphicon glyphicon-duplicate" onclick="navigator.clipboard.writeText('@example.com@web.brid.gy')"></button>. <!-- <a href="/docs#fediverse-follow-web">More details.</a> --></p>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="row big front-dark">
|
||||
<p>Bridgy Fed currently supports web sites and blogs and the <a href="https://enwp.org/fediverse">fediverse</a> via <a href="https://activitypub.rocks/">ActivityPub</a>. <a href="https://blueskyweb.xyz/">Bluesky</a>/<a href="https://atproto.com/">AT Protocol</a> and <a href="https://en.wikipedia.org/wiki/Nostr">Nostr</a> are planned for 2024.</p>
|
||||
<p>Got a <a class="bluesky" href="https://bsky.social/"><img src="/oauth_dropins_static/bluesky.svg"> Bluesky</a> account? <a href="/docs#bluesky-get-started">Bridge it to the <span class="fediverse"><img src="/static/fediverse_logo.svg"> fediverse</span></a> by following <a href="https://bsky.app/profile/ap.brid.gy"><em>@ap.brid.gy</em></a>. <!-- <a href="http://localhost:8080/docs#bluesky-get-started">More details.</a> --></p>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<!-- <div class="row big front-light"> -->
|
||||
<!-- <p><a href="https://en.wikipedia.org/wiki/Nostr">Nostr</a> and <a href="https://www.farcaster.xyz/">Farcaster</a> are under consideration for the future.</p> -->
|
||||
<!-- </div> -->
|
||||
|
||||
<div class="row big front-light">
|
||||
<p>Bridgy Fed is a free, non-commercial, <a href="https://github.com/snarfed/bridgy-fed">open source</a> service. <a href="https://snarfed.org/2023-11-27_re-introducing-bridgy-fed">More background here.</a> <a href="mailto:feedback@brid.gy">Feedback</a> and <a href="https://github.com/snarfed/bridgy-fed/issues">bug reports</a> are welcome!</a></p>
|
||||
<p>Bridgy Fed is a free, non-commercial, <a href="https://github.com/snarfed/bridgy-fed">open source</a> service. <a href="https://snarfed.org/2023-11-27_re-introducing-bridgy-fed">More background here.</a> <a href="https://github.com/snarfed/bridgy-fed/issues">Bug reports, feature requests</a>, and <a href="mailto:feedback@brid.gy">other feedback</a> are welcome!</a></p>
|
||||
</div>
|
||||
|
||||
<div id="front-logo-bottom" class="row">
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
{% extends "user_base.html" %}
|
||||
{% set tab = "notifications" %}
|
||||
{% set show_activity_actors = True %}
|
||||
|
||||
{% block subtabs %}
|
||||
<div class="row">
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
{% extends "user_base.html" %}
|
||||
{% set tab = "profile" %}
|
||||
{% set show_activity_actors = False %}
|
||||
|
||||
{% block subtabs %}
|
||||
<div class="row tabs">
|
||||
|
|
|
@ -30,23 +30,8 @@
|
|||
|
||||
<div class="row">
|
||||
<span class="big">
|
||||
{% if user.name() != user.handle_or_id() %}
|
||||
{{ user.user_link()|safe }}
|
||||
·
|
||||
{% else %}
|
||||
{% if user.profile_picture() %}
|
||||
<img src="{{ user.profile_picture() }}" class="profile">
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
<nobr>
|
||||
|
||||
<a href="{{ user.web_url() }}"
|
||||
title="{{ user.__class__.__name__ }} (original)">
|
||||
<span class="logo">{{ user.LOGO_HTML|safe }}</span>
|
||||
{{ user.handle_or_id() }}
|
||||
</a>
|
||||
|
||||
{{ user.user_link(handle=True, maybe_internal_link=False)|safe }}
|
||||
<form method="post" action="{{ user.user_page_path('update-profile') }}">
|
||||
<button id="update-profile-button" type="submit" title="Update profile"
|
||||
class="btn btn-default glyphicon glyphicon-refresh"></button>
|
||||
|
@ -57,7 +42,7 @@
|
|||
{% set copies = user.copies|map(attribute='protocol')|list %}
|
||||
{% for proto in set(PROTOCOLS.values()) %}
|
||||
{% if proto and not isinstance(user, proto) and proto.LABEL not in ('ui', 'web')
|
||||
and user.is_enabled_to(proto, user=user) %}
|
||||
and user.is_enabled(proto) %}
|
||||
{% set url = proto.bridged_web_url_for(user) %}
|
||||
·
|
||||
<nobr title="{{ proto.__name__ }} (bridged)">
|
||||
|
|
|
@ -868,7 +868,7 @@ class ActivityPubTest(TestCase):
|
|||
def test_follow_bot_user_enables_protocol(self, *mocks):
|
||||
user = self.make_user('https://mas.to/users/swentel', cls=ActivityPub,
|
||||
obj_as2=ACTOR)
|
||||
self.assertFalse(ActivityPub.is_enabled_to(ExplicitEnableFake, user))
|
||||
self.assertFalse(user.is_enabled(ExplicitEnableFake))
|
||||
|
||||
id = 'https://inst/follow'
|
||||
with self.assertRaises(NoContent):
|
||||
|
@ -882,11 +882,11 @@ class ActivityPubTest(TestCase):
|
|||
self.assertEqual(['https://mas.to/users/swentel'],
|
||||
ExplicitEnableFake.created_for)
|
||||
user = user.key.get()
|
||||
self.assertTrue(ActivityPub.is_enabled_to(ExplicitEnableFake, user))
|
||||
self.assertTrue(user.is_enabled(ExplicitEnableFake))
|
||||
|
||||
def test_inbox_dm_yes_to_bot_user_enables_protocol(self, *mocks):
|
||||
user = self.make_user(ACTOR['id'], cls=ActivityPub)
|
||||
self.assertFalse(ActivityPub.is_enabled_to(ExplicitEnableFake, user))
|
||||
self.assertFalse(user.is_enabled(ExplicitEnableFake))
|
||||
|
||||
got = self.post('/ap/sharedInbox', json={
|
||||
'type': 'Create',
|
||||
|
@ -902,7 +902,7 @@ class ActivityPubTest(TestCase):
|
|||
})
|
||||
self.assertEqual(200, got.status_code, got.get_data(as_text=True))
|
||||
user = user.key.get()
|
||||
self.assertTrue(ActivityPub.is_enabled_to(ExplicitEnableFake, user))
|
||||
self.assertTrue(user.is_enabled(ExplicitEnableFake))
|
||||
|
||||
def test_inbox_actor_blocklisted(self, mock_head, mock_get, mock_post):
|
||||
got = self.post('/ap/sharedInbox', json={
|
||||
|
@ -1960,6 +1960,15 @@ class ActivityPubUtilsTest(TestCase):
|
|||
],
|
||||
}))
|
||||
|
||||
def test_postprocess_as2_strips_link_attachment(self):
|
||||
self.assertNotIn('attachment', postprocess_as2({
|
||||
'type': 'Note',
|
||||
'attachment': [{
|
||||
'type': 'Link',
|
||||
'url': 'http://a/link',
|
||||
}],
|
||||
}))
|
||||
|
||||
def test_postprocess_as2_actor_url_attachments(self):
|
||||
got = postprocess_as2_actor(as2.from_as1({
|
||||
'objectType': 'person',
|
||||
|
@ -2279,13 +2288,6 @@ class ActivityPubUtilsTest(TestCase):
|
|||
'object': ACTOR,
|
||||
}, ActivityPub.convert(obj))
|
||||
|
||||
# TODO: remove
|
||||
@skip
|
||||
def test_convert_protocols_not_enabled(self):
|
||||
obj = Object(our_as1={'foo': 'bar'}, source_protocol='atproto')
|
||||
with self.assertRaises(BadRequest):
|
||||
ActivityPub.convert(obj)
|
||||
|
||||
def test_postprocess_as2_idempotent(self):
|
||||
for obj in (ACTOR, REPLY_OBJECT, REPLY_OBJECT_WRAPPED, REPLY,
|
||||
NOTE_OBJECT, NOTE, MENTION_OBJECT, MENTION, LIKE,
|
||||
|
|
|
@ -239,7 +239,7 @@ class ATProtoTest(TestCase):
|
|||
self.assertEqual('opt-out', user.status)
|
||||
|
||||
def test_target_for_user_no_stored_did(self):
|
||||
self.assertEqual('https://atproto.brid.gy/', ATProto.target_for(
|
||||
self.assertEqual('https://atproto.brid.gy', ATProto.target_for(
|
||||
Object(id='at://foo')))
|
||||
self.assertIsNone(ATProto.target_for(Object(id='fake:post')))
|
||||
|
||||
|
@ -720,7 +720,7 @@ class ATProtoTest(TestCase):
|
|||
assert did
|
||||
self.assertEqual([Target(uri=did, protocol='atproto')], user.copies)
|
||||
did_obj = ATProto.load(did, did_doc=True)
|
||||
self.assertEqual('http://localhost/',
|
||||
self.assertEqual('http://localhost',
|
||||
did_obj.raw['service'][0]['serviceEndpoint'])
|
||||
|
||||
# check repo, record
|
||||
|
@ -754,7 +754,7 @@ class ATProtoTest(TestCase):
|
|||
'services': {
|
||||
'atproto_pds': {
|
||||
'type': 'AtprotoPersonalDataServer',
|
||||
'endpoint': 'http://localhost/',
|
||||
'endpoint': 'http://localhost',
|
||||
}
|
||||
},
|
||||
'prev': None,
|
||||
|
@ -813,7 +813,7 @@ class ATProtoTest(TestCase):
|
|||
user = self.make_user_and_repo()
|
||||
obj = self.store_object(id='fake:post', source_protocol='fake',
|
||||
our_as1=NOTE_AS)
|
||||
self.assertTrue(ATProto.send(obj, 'https://bsky.brid.gy/'))
|
||||
self.assertTrue(ATProto.send(obj, 'https://bsky.brid.gy'))
|
||||
|
||||
# check repo, record
|
||||
did = user.key.get().get_copy(ATProto)
|
||||
|
@ -842,7 +842,7 @@ class ATProtoTest(TestCase):
|
|||
'verb': 'update',
|
||||
'object': note.our_as1,
|
||||
})
|
||||
self.assertTrue(ATProto.send(update, 'https://bsky.brid.gy/'))
|
||||
self.assertTrue(ATProto.send(update, 'https://bsky.brid.gy'))
|
||||
|
||||
# check repo, record
|
||||
did = self.user.key.get().get_copy(ATProto)
|
||||
|
@ -936,7 +936,7 @@ class ATProtoTest(TestCase):
|
|||
'actor': 'fake:user',
|
||||
'object': 'at://did:bob/app.bsky.feed.post/tid',
|
||||
})
|
||||
self.assertTrue(ATProto.send(obj, 'https://bsky.brid.gy/'))
|
||||
self.assertTrue(ATProto.send(obj, 'https://bsky.brid.gy'))
|
||||
|
||||
# check repo, record
|
||||
did = user.get_copy(ATProto)
|
||||
|
@ -971,7 +971,7 @@ class ATProtoTest(TestCase):
|
|||
'actor': 'fake:user',
|
||||
'object': 'did:plc:bob',
|
||||
})
|
||||
self.assertTrue(ATProto.send(obj, 'https://bsky.brid.gy/'))
|
||||
self.assertTrue(ATProto.send(obj, 'https://bsky.brid.gy'))
|
||||
|
||||
# check repo, record
|
||||
did = user.get_copy(ATProto)
|
||||
|
|
|
@ -30,10 +30,11 @@ class CommonTest(TestCase):
|
|||
|
||||
# current user's homepage gets converted to BF user page
|
||||
self.assert_multiline_equals("""\
|
||||
<a class="h-card u-author" href="https://user.com/">
|
||||
|
||||
<span class="logo" title="Web">🌐</span>
|
||||
<a class="h-card u-author" href="/web/user.com" title="user.com">
|
||||
user.com
|
||||
</a>""", common.pretty_link('https://user.com/', user=Web(id='user.com')))
|
||||
</a>""", common.pretty_link('https://user.com/', user=Web(id='user.com')),
|
||||
ignore_blanks=True)
|
||||
|
||||
def test_redirect_wrap_empty(self):
|
||||
self.assertIsNone(common.redirect_wrap(None))
|
||||
|
|
|
@ -142,7 +142,7 @@ class ConvertTest(testutil.TestCase):
|
|||
|
||||
resp = self.client.get(f'/convert/web/{url}',
|
||||
base_url='https://ap.brid.gy/')
|
||||
self.assertEqual(200, resp.status_code)
|
||||
self.assertEqual(200, resp.status_code, resp.get_data(as_text=True))
|
||||
self.assertEqual(CONTENT_TYPE_HTML, resp.content_type)
|
||||
self.assert_multiline_equals(HTML, resp.get_data(as_text=True),
|
||||
ignore_blanks=True)
|
||||
|
@ -271,10 +271,8 @@ A ☕ reply
|
|||
# self.assertEqual(f'https://ap.brid.gy/convert/web/https:/foo%3Fbar%23baz',
|
||||
# resp.headers['Location'])
|
||||
|
||||
@patch('requests.get')
|
||||
@patch('requests.get', return_value=requests_response(HTML_NO_ID))
|
||||
def test_web_to_activitypub_object(self, mock_get):
|
||||
mock_get.return_value = requests_response(HTML_NO_ID)
|
||||
|
||||
self.make_user('user.com', cls=Web)
|
||||
|
||||
url = 'https://user.com/bar?baz=baj&biff'
|
||||
|
@ -322,11 +320,9 @@ A ☕ reply
|
|||
'attributedTo': 'https://web.brid.gy/nope.com',
|
||||
}, resp.json, ignore=['to'])
|
||||
|
||||
@patch('requests.get')
|
||||
@patch('requests.get', return_value=requests_response(HTML_NO_ID))
|
||||
def test_web_to_activitypub_url_decode(self, mock_get):
|
||||
"""https://github.com/snarfed/bridgy-fed/issues/581"""
|
||||
mock_get.return_value = requests_response(HTML_NO_ID)
|
||||
|
||||
self.make_user('user.com', cls=Web)
|
||||
self.store_object(id='http://user.com/a#b',
|
||||
mf2=parse_mf2(HTML_NO_ID)['items'][0])
|
||||
|
|
|
@ -120,14 +120,17 @@ class IdsTest(TestCase):
|
|||
(Web, 'user.com', ActivityPub, '@user.com@web.brid.gy'),
|
||||
(Web, 'user.com', ATProto, 'user.com.web.brid.gy'),
|
||||
(Web, 'user.com', Fake, 'fake:handle:user.com'),
|
||||
(Web, 'u_se-r.com', Fake, 'fake:handle:u_se-r.com'),
|
||||
(Web, 'user.com', Web, 'user.com'),
|
||||
|
||||
(ActivityPub, '@user@instance', ActivityPub, '@user@instance'),
|
||||
(ActivityPub, '@user@instance', ATProto, 'user.instance.ap.brid.gy'),
|
||||
(ActivityPub, '@u_se~r@instance', ATProto, 'u-se-r.instance.ap.brid.gy'),
|
||||
(ActivityPub, '@user@instance', Fake, 'fake:handle:@user@instance'),
|
||||
(ActivityPub, '@user@instance', Web, 'https://instance/@user'),
|
||||
|
||||
(ATProto, 'user.com', ActivityPub, '@user.com@bsky.brid.gy'),
|
||||
(ATProto, 'u-se-r.com', ActivityPub, '@u-se-r.com@bsky.brid.gy'),
|
||||
(ATProto, 'user.com', ATProto, 'user.com'),
|
||||
(ATProto, 'user.com', Fake, 'fake:handle:user.com'),
|
||||
(ATProto, 'user.com', Web, 'user.com'),
|
||||
|
|
|
@ -241,7 +241,7 @@ class IntegrationTests(TestCase):
|
|||
# send webmention
|
||||
resp = self.post('/webmention', data={
|
||||
'source': 'https://bob.com/follow',
|
||||
'target': 'http://localhost/',
|
||||
'target': 'http://localhost',
|
||||
})
|
||||
self.assertEqual(202, resp.status_code)
|
||||
|
||||
|
@ -390,7 +390,7 @@ class IntegrationTests(TestCase):
|
|||
|
||||
# check results
|
||||
user = ActivityPub.get_by_id('https://inst/alice')
|
||||
self.assertTrue(ActivityPub.is_enabled_to(ATProto, user=user))
|
||||
self.assertTrue(user.is_enabled(ATProto))
|
||||
|
||||
self.assertEqual(1, len(user.copies))
|
||||
self.assertEqual('atproto', user.copies[0].protocol)
|
||||
|
@ -470,4 +470,4 @@ class IntegrationTests(TestCase):
|
|||
self.assertEqual(200, resp.status_code)
|
||||
|
||||
user = ATProto.get_by_id('did:plc:alice')
|
||||
self.assertTrue(ATProto.is_enabled_to(ActivityPub, user=user))
|
||||
self.assertTrue(user.is_enabled(ActivityPub))
|
||||
|
|
|
@ -18,7 +18,7 @@ from oauth_dropins.webutil.testutil import NOW, requests_response
|
|||
from oauth_dropins.webutil import util
|
||||
|
||||
# import first so that Fake is defined before URL routes are registered
|
||||
from .testutil import Fake, OtherFake, TestCase
|
||||
from .testutil import ExplicitEnableFake, Fake, OtherFake, TestCase
|
||||
|
||||
from activitypub import ActivityPub
|
||||
from atproto import ATProto
|
||||
|
@ -145,7 +145,7 @@ class UserTest(TestCase):
|
|||
|
||||
def test_get_or_create_opted_out(self):
|
||||
user = self.make_user('fake:user', cls=Fake,
|
||||
obj_as1 = {'summary': '#nobridge'})
|
||||
obj_as1={'summary': '#nobridge'})
|
||||
self.assertIsNone(Fake.get_or_create('fake:user'))
|
||||
|
||||
def test_public_pem(self):
|
||||
|
@ -167,15 +167,16 @@ class UserTest(TestCase):
|
|||
|
||||
def test_user_link(self):
|
||||
self.assert_multiline_equals("""\
|
||||
<a class="h-card u-author" href="https://y.z/">
|
||||
|
||||
<span class="logo" title="Web">🌐</span>
|
||||
<a class="h-card u-author" href="/web/y.z" title="y.z">
|
||||
y.z
|
||||
</a>""", self.user.user_link())
|
||||
</a>""", self.user.user_link(), ignore_blanks=True)
|
||||
|
||||
self.user.obj = Object(id='a', as2=ACTOR)
|
||||
self.assert_multiline_equals("""\
|
||||
<a class="h-card u-author" href="https://y.z/">
|
||||
<img src="https://user.com/me.jpg" class="profile">
|
||||
<span class="logo" title="Web">🌐</span>
|
||||
<a class="h-card u-author" href="/web/y.z" title="Mrs. ☕ Foo">
|
||||
<img src="https://user.com/me.jpg" class="profile">
|
||||
Mrs. ☕ Foo
|
||||
</a>""", self.user.user_link())
|
||||
|
||||
|
@ -294,7 +295,6 @@ class UserTest(TestCase):
|
|||
|
||||
self.assertIsNone(OtherFake().get_copy(Fake))
|
||||
|
||||
|
||||
def test_count_followers(self):
|
||||
self.assertEqual((0, 0), self.user.count_followers())
|
||||
|
||||
|
@ -310,6 +310,65 @@ class UserTest(TestCase):
|
|||
del self.user
|
||||
self.assertEqual((1, 2), user.count_followers())
|
||||
|
||||
def test_is_enabled_default_enabled_protocols(self):
|
||||
self.assertTrue(Web(id='').is_enabled(ActivityPub))
|
||||
self.assertTrue(ActivityPub(id='').is_enabled(Web))
|
||||
self.assertTrue(ActivityPub(id='').is_enabled(ActivityPub))
|
||||
self.assertTrue(Fake(id='').is_enabled(OtherFake))
|
||||
self.assertTrue(Fake(id='').is_enabled(ExplicitEnableFake))
|
||||
|
||||
self.assertFalse(ActivityPub(id='').is_enabled(ATProto))
|
||||
self.assertFalse(ATProto(id='').is_enabled(ActivityPub))
|
||||
self.assertFalse(ATProto(id='').is_enabled(Web))
|
||||
self.assertFalse(Web(id='').is_enabled(ATProto))
|
||||
self.assertFalse(ExplicitEnableFake(id='').is_enabled(Fake))
|
||||
self.assertFalse(ExplicitEnableFake(id='').is_enabled(Web))
|
||||
|
||||
def test_is_enabled_enabled_protocols_overrides_bio_opt_out(self):
|
||||
user = self.make_user('eefake:user', cls=ExplicitEnableFake,
|
||||
obj_as1={'summary': '#nobridge'})
|
||||
self.assertFalse(user.is_enabled(Web))
|
||||
|
||||
user.enabled_protocols = ['web']
|
||||
user.put()
|
||||
self.assertTrue(user.is_enabled(Web))
|
||||
|
||||
def test_is_enabled_manual_opt_out(self):
|
||||
user = self.make_user('user.com', cls=Web)
|
||||
self.assertTrue(user.is_enabled(ActivityPub))
|
||||
|
||||
user.manual_opt_out = True
|
||||
user.put()
|
||||
self.assertFalse(user.is_enabled(ActivityPub))
|
||||
|
||||
user.enabled_protocols = ['activitypub']
|
||||
user.put()
|
||||
self.assertFalse(user.is_enabled(ActivityPub))
|
||||
|
||||
def test_is_enabled_enabled_protocols(self):
|
||||
user = self.make_user(id='eefake:foo', cls=ExplicitEnableFake)
|
||||
self.assertFalse(user.is_enabled(Fake))
|
||||
|
||||
user.enabled_protocols = ['web']
|
||||
user.put()
|
||||
self.assertFalse(user.is_enabled(Fake))
|
||||
|
||||
user.enabled_protocols = ['web', 'fake']
|
||||
user.put()
|
||||
self.assertTrue(user.is_enabled(Fake))
|
||||
|
||||
def test_is_enabled_protocol_bot_users(self):
|
||||
# protocol bot users should always be enabled to *other* protocols
|
||||
self.assertTrue(Web(id='eefake.brid.gy').is_enabled(Fake))
|
||||
self.assertTrue(Web(id='fa.brid.gy').is_enabled(ExplicitEnableFake))
|
||||
self.assertTrue(Web(id='other.brid.gy').is_enabled(Fake))
|
||||
self.assertTrue(Web(id='ap.brid.gy').is_enabled(ATProto))
|
||||
self.assertTrue(Web(id='bsky.brid.gy').is_enabled(ActivityPub))
|
||||
|
||||
# ...but not to their own protocol
|
||||
self.assertFalse(Web(id='ap.brid.gy').is_enabled(ActivityPub))
|
||||
self.assertFalse(Web(id='bsky.brid.gy').is_enabled(ATProto))
|
||||
|
||||
|
||||
class ObjectTest(TestCase):
|
||||
def setUp(self):
|
||||
|
@ -520,7 +579,8 @@ class ObjectTest(TestCase):
|
|||
):
|
||||
with self.subTest(expected=expected, as2=as2):
|
||||
obj = Object(id='x', as2=as2)
|
||||
self.assert_multiline_in(expected, obj.actor_link())
|
||||
self.assert_multiline_in(expected, obj.actor_link(),
|
||||
ignore_blanks=True)
|
||||
|
||||
self.assertEqual(
|
||||
'<a class="h-card u-author" href="http://foo">foo</a>',
|
||||
|
@ -531,7 +591,7 @@ class ObjectTest(TestCase):
|
|||
obj = Object(id='x', source_protocol='ui', users=[self.user.key])
|
||||
|
||||
got = obj.actor_link(user=self.user)
|
||||
self.assertIn('href="fake:user">', got)
|
||||
self.assertIn('href="fake:user" title="Alice">', got)
|
||||
self.assertIn('Alice', got)
|
||||
|
||||
def test_actor_link_object_in_datastore(self):
|
||||
|
@ -562,7 +622,7 @@ class ObjectTest(TestCase):
|
|||
<a class="h-card u-author" href="" title="Alice">
|
||||
<img class="profile" src="foo.jpg" width="32"/>
|
||||
Alice
|
||||
</a>""", obj.actor_link(sized=True))
|
||||
</a>""", obj.actor_link(sized=True), ignore_blanks=True)
|
||||
|
||||
def test_actor_link_composite_url(self):
|
||||
obj = Object(id='x', our_as1={
|
||||
|
@ -628,6 +688,22 @@ class ObjectTest(TestCase):
|
|||
self.assertEqual({'id': 'x', 'foo': 'bar'},
|
||||
Object(id='x', our_as1={'foo': 'bar'}).as1)
|
||||
|
||||
def test_as1_from_as2_protocol_bot_user(self):
|
||||
self.assert_equals({
|
||||
'objectType': 'application',
|
||||
'id': 'fed.brid.gy',
|
||||
'url': 'https://fed.brid.gy/',
|
||||
'displayName': 'Bridgy Fed',
|
||||
'username': 'fed.brid.gy',
|
||||
'image': [{
|
||||
'displayName': 'Bridgy Fed',
|
||||
'url': 'https://fed.brid.gy/static/bridgy_logo_square.jpg',
|
||||
}, {
|
||||
'objectType': 'featured',
|
||||
'url': 'https://fed.brid.gy/static/bridgy_logo.jpg',
|
||||
}],
|
||||
}, Web.load('https://fed.brid.gy/').as1, ignore=['summary'])
|
||||
|
||||
def test_atom_url_overrides_id(self):
|
||||
obj = {
|
||||
'objectType': 'note',
|
||||
|
|
|
@ -30,9 +30,9 @@ ACTOR_WITH_PREFERRED_USERNAME = {
|
|||
|
||||
|
||||
def contents(activities):
|
||||
return [util.parse_html((a.get('object') or a)['content'].splitlines()[0]
|
||||
).get_text().strip()
|
||||
for a in activities]
|
||||
return [
|
||||
' '.join(util.parse_html((a.get('object') or a)['content']).get_text().split())
|
||||
for a in activities]
|
||||
|
||||
|
||||
class PagesTest(TestCase):
|
||||
|
@ -40,7 +40,7 @@ class PagesTest(TestCase):
|
|||
EXPECTED_SNIPPETS = [
|
||||
'Dr. Eve replied a comment',
|
||||
'tag:fake.com:44... posted a mention',
|
||||
'tag:fake.com:44... posted my note',
|
||||
'🌐 user.com posted my note',
|
||||
]
|
||||
|
||||
def setUp(self):
|
||||
|
@ -179,7 +179,7 @@ class PagesTest(TestCase):
|
|||
got = self.client.post('/fa/fake:user/update-profile')
|
||||
self.assert_equals(302, got.status_code)
|
||||
self.assert_equals('/fa/fake:handle:user', got.headers['Location'])
|
||||
self.assertEqual(['Updating profile for fake:handle:user'],
|
||||
self.assertEqual(['Updating profile from <a href="fake:user">fake:handle:user</a>...'],
|
||||
get_flashed_messages())
|
||||
|
||||
self.assertEqual(['fake:user'], Fake.fetched)
|
||||
|
|
|
@ -175,53 +175,6 @@ class ProtocolTest(TestCase):
|
|||
def test_for_handle_atproto_resolve(self, _):
|
||||
self.assertEqual((ATProto, 'did:plc:123abc'), Protocol.for_handle('han.dull'))
|
||||
|
||||
def test_is_enabled_to(self):
|
||||
self.assertTrue(Web.is_enabled_to(ActivityPub))
|
||||
self.assertTrue(ActivityPub.is_enabled_to(Web))
|
||||
self.assertTrue(ActivityPub.is_enabled_to(ActivityPub))
|
||||
self.assertTrue(Fake.is_enabled_to(OtherFake))
|
||||
self.assertTrue(Fake.is_enabled_to(ExplicitEnableFake))
|
||||
|
||||
self.assertFalse(ActivityPub.is_enabled_to(ATProto))
|
||||
self.assertFalse(ATProto.is_enabled_to(ActivityPub))
|
||||
self.assertFalse(ATProto.is_enabled_to(Web))
|
||||
self.assertFalse(Web.is_enabled_to(ATProto))
|
||||
self.assertFalse(ExplicitEnableFake.is_enabled_to(Fake))
|
||||
self.assertFalse(ExplicitEnableFake.is_enabled_to(Web))
|
||||
|
||||
def test_is_enabled_to_opt_out(self):
|
||||
user = self.make_user('user.com', cls=Web)
|
||||
self.assertTrue(Web.is_enabled_to(ActivityPub, user))
|
||||
|
||||
user.manual_opt_out = True
|
||||
user.put()
|
||||
protocol.objects_cache.clear()
|
||||
self.assertFalse(Web.is_enabled_to(ActivityPub, 'user.com'))
|
||||
|
||||
def test_is_enabled_to_enabled_protocols(self):
|
||||
user = self.make_user(id='eefake:foo', cls=ExplicitEnableFake)
|
||||
self.assertFalse(ExplicitEnableFake.is_enabled_to(Fake, 'eefake:foo'))
|
||||
|
||||
user.enabled_protocols = ['web']
|
||||
user.put()
|
||||
self.assertFalse(ExplicitEnableFake.is_enabled_to(Fake, 'eefake:foo'))
|
||||
|
||||
user.enabled_protocols = ['web', 'fake']
|
||||
user.put()
|
||||
self.assertTrue(ExplicitEnableFake.is_enabled_to(Fake, 'eefake:foo'))
|
||||
|
||||
def test_is_enabled_to_protocol_bot_users(self):
|
||||
# protocol bot users should always be enabled to *other* protocols
|
||||
self.assertTrue(Web.is_enabled_to(Fake, 'eefake.brid.gy'))
|
||||
self.assertTrue(Web.is_enabled_to(ExplicitEnableFake, 'fa.brid.gy'))
|
||||
self.assertTrue(Web.is_enabled_to(Fake, 'other.brid.gy'))
|
||||
self.assertTrue(Web.is_enabled_to(ATProto, 'ap.brid.gy'))
|
||||
self.assertTrue(Web.is_enabled_to(ActivityPub, 'bsky.brid.gy'))
|
||||
|
||||
# ...but not to their own protocol
|
||||
self.assertFalse(Web.is_enabled_to(ActivityPub, 'ap.brid.gy'))
|
||||
self.assertFalse(Web.is_enabled_to(ATProto, 'bsky.brid.gy'))
|
||||
|
||||
def test_load(self):
|
||||
Fake.fetchable['foo'] = {'x': 'y'}
|
||||
|
||||
|
@ -476,7 +429,7 @@ class ProtocolTest(TestCase):
|
|||
self.store_object(id='at://did:plc:foo/co.ll/post', our_as1={'foo': 'bar'})
|
||||
self.store_object(id='fake:post', our_as1={'foo': 'baz'})
|
||||
|
||||
obj = Object(our_as1={
|
||||
obj = Object(source_protocol='other', our_as1={
|
||||
'id': 'other:reply',
|
||||
'objectType': 'note',
|
||||
'inReplyTo': [
|
||||
|
@ -489,7 +442,7 @@ class ProtocolTest(TestCase):
|
|||
})
|
||||
self.assertCountEqual([
|
||||
Target(protocol='fake', uri='fake:post:target'),
|
||||
Target(protocol='atproto', uri='https://atproto.brid.gy/'),
|
||||
Target(protocol='atproto', uri='https://atproto.brid.gy'),
|
||||
], Protocol.targets(obj).keys())
|
||||
|
||||
def test_targets_composite_inreplyto(self):
|
||||
|
@ -497,7 +450,7 @@ class ProtocolTest(TestCase):
|
|||
'objectType': 'note',
|
||||
}
|
||||
self.assertEqual({Target(protocol='fake', uri='fake:post:target')},
|
||||
Fake.targets(Object(our_as1={
|
||||
OtherFake.targets(Object(our_as1={
|
||||
'objectType': 'activity',
|
||||
'verb': 'post',
|
||||
'object': {
|
||||
|
@ -846,23 +799,26 @@ class ProtocolReceiveTest(TestCase):
|
|||
self.assertEqual([], Fake.sent)
|
||||
|
||||
def test_create_reply(self):
|
||||
self.make_followers()
|
||||
eve = self.make_user('other:eve', cls=OtherFake, obj_id='other:eve')
|
||||
|
||||
Fake.fetchable['fake:post'] = {
|
||||
frank = self.make_user('other:frank', cls=OtherFake, obj_id='other:frank')
|
||||
Follower.get_or_create(to=self.alice, from_=frank)
|
||||
|
||||
OtherFake.fetchable['other:post'] = {
|
||||
'objectType': 'note',
|
||||
'author': 'fake:bob',
|
||||
'author': 'other:eve',
|
||||
}
|
||||
reply_as1 = {
|
||||
'id': 'fake:reply',
|
||||
'objectType': 'note',
|
||||
'inReplyTo': 'fake:post',
|
||||
'inReplyTo': 'other:post',
|
||||
'author': 'fake:alice',
|
||||
}
|
||||
create_as1 = {
|
||||
'id': 'fake:create',
|
||||
'objectType': 'activity',
|
||||
'verb': 'post',
|
||||
'actor': 'fake:user',
|
||||
'actor': 'fake:alice',
|
||||
'object': reply_as1,
|
||||
}
|
||||
self.assertEqual(('OK', 202), Fake.receive_as1(create_as1))
|
||||
|
@ -874,27 +830,29 @@ class ProtocolReceiveTest(TestCase):
|
|||
obj = self.assert_object('fake:create',
|
||||
status='complete',
|
||||
our_as1=create_as1,
|
||||
delivered=['fake:post:target'],
|
||||
delivered=['other:post:target'],
|
||||
delivered_protocol='other',
|
||||
type='post',
|
||||
users=[self.user.key, self.alice.key],
|
||||
notify=[self.bob.key],
|
||||
users=[self.alice.key],
|
||||
notify=[eve.key],
|
||||
)
|
||||
|
||||
self.assertEqual([(obj.key.id(), 'fake:post:target')], Fake.sent)
|
||||
# not a self reply, shouldn't deliver to follower frank
|
||||
self.assertEqual([(obj.key.id(), 'other:post:target')], OtherFake.sent)
|
||||
|
||||
def test_create_reply_bare_object(self):
|
||||
self.make_followers()
|
||||
eve = self.make_user('other:eve', cls=OtherFake, obj_id='other:eve')
|
||||
|
||||
reply_as1 = {
|
||||
'id': 'fake:reply',
|
||||
'objectType': 'note',
|
||||
'inReplyTo': 'fake:post',
|
||||
'inReplyTo': 'other:post',
|
||||
'author': 'fake:alice',
|
||||
}
|
||||
Fake.fetchable['fake:post'] = {
|
||||
OtherFake.fetchable['other:post'] = {
|
||||
'objectType': 'note',
|
||||
'id': 'fake:post',
|
||||
'author': 'fake:bob',
|
||||
'id': 'other:post',
|
||||
'author': 'other:eve',
|
||||
}
|
||||
self.assertEqual(('OK', 202), Fake.receive_as1(reply_as1))
|
||||
|
||||
|
@ -914,16 +872,42 @@ class ProtocolReceiveTest(TestCase):
|
|||
obj = self.assert_object('fake:reply#bridgy-fed-create',
|
||||
status='complete',
|
||||
our_as1=create_as1,
|
||||
delivered=['fake:post:target'],
|
||||
delivered=['other:post:target'],
|
||||
delivered_protocol='other',
|
||||
type='post',
|
||||
users=[self.alice.key],
|
||||
notify=[self.bob.key],
|
||||
notify=[eve.key],
|
||||
)
|
||||
|
||||
self.assertEqual([(obj.key.id(), 'fake:post:target')], Fake.sent)
|
||||
self.assertEqual([(obj.key.id(), 'other:post:target')], OtherFake.sent)
|
||||
|
||||
def test_create_reply_to_self_delivers_to_followers(self):
|
||||
self.make_followers()
|
||||
eve = self.make_user('other:eve', cls=OtherFake, obj_id='other:eve')
|
||||
Follower.get_or_create(to=self.user, from_=eve)
|
||||
|
||||
reply_as1 = {
|
||||
'id': 'fake:reply',
|
||||
'objectType': 'note',
|
||||
'inReplyTo': 'fake:post',
|
||||
'author': 'fake:user',
|
||||
}
|
||||
self.store_object(id='fake:post', source_protocol='fake',
|
||||
copies=[Target(protocol='other', uri='other:post')],
|
||||
our_as1={
|
||||
'objectType': 'note',
|
||||
'id': 'fake:post',
|
||||
'author': 'fake:user',
|
||||
})
|
||||
self.assertEqual(('OK', 202), Fake.receive_as1(reply_as1))
|
||||
|
||||
self.assert_object('fake:reply', our_as1=reply_as1, type='note',
|
||||
feed=[eve.key])
|
||||
|
||||
obj = Object.get_by_id(id='fake:reply#bridgy-fed-create')
|
||||
self.assertEqual([(obj.key.id(), 'fake:post:target')], Fake.sent)
|
||||
self.assertEqual([(obj.key.id(), 'other:eve:target')], OtherFake.sent)
|
||||
|
||||
def test_create_reply_isnt_bridged_if_original_isnt_bridged(self):
|
||||
eve = self.make_user('other:eve', cls=OtherFake, obj_id='other:eve')
|
||||
Follower.get_or_create(to=self.user, from_=eve)
|
||||
|
||||
|
@ -938,19 +922,14 @@ class ProtocolReceiveTest(TestCase):
|
|||
'id': 'fake:post',
|
||||
'author': 'fake:user',
|
||||
}
|
||||
self.assertEqual(('OK', 202), Fake.receive_as1(reply_as1))
|
||||
|
||||
self.assert_object('fake:reply', our_as1=reply_as1, type='note',
|
||||
feed=[self.alice.key, self.bob.key, eve.key])
|
||||
with self.assertRaises(NoContent):
|
||||
Fake.receive_as1(reply_as1)
|
||||
|
||||
obj = Object.get_by_id(id='fake:reply#bridgy-fed-create')
|
||||
self.assertEqual([
|
||||
(obj.key.id(), 'fake:post:target'),
|
||||
(obj.key.id(), 'shared:target'),
|
||||
], Fake.sent)
|
||||
self.assertEqual([
|
||||
(obj.key.id(), 'other:eve:target'),
|
||||
], OtherFake.sent)
|
||||
reply = self.assert_object('fake:reply', our_as1=reply_as1, type='note')
|
||||
self.assertEqual([], reply.copies)
|
||||
self.assertEqual([], Fake.sent)
|
||||
self.assertEqual([], OtherFake.sent)
|
||||
|
||||
def test_reply_skips_mention_of_original_post_author(self):
|
||||
bob = self.store_object(id='fake:bob', our_as1={'foo': 1})
|
||||
|
@ -988,16 +967,16 @@ class ProtocolReceiveTest(TestCase):
|
|||
], Fake.sent)
|
||||
|
||||
def test_update_reply(self):
|
||||
self.make_followers()
|
||||
eve = self.make_user('other:eve', cls=OtherFake, obj_id='other:eve')
|
||||
|
||||
Fake.fetchable['fake:post'] = {
|
||||
OtherFake.fetchable['other:post'] = {
|
||||
'objectType': 'note',
|
||||
'author': 'fake:bob',
|
||||
'author': 'other:eve',
|
||||
}
|
||||
reply_as1 = {
|
||||
'id': 'fake:reply',
|
||||
'objectType': 'note',
|
||||
'inReplyTo': 'fake:post',
|
||||
'inReplyTo': 'other:post',
|
||||
'author': 'fake:alice',
|
||||
}
|
||||
self.store_object(id='fake:reply', our_as1=reply_as1)
|
||||
|
@ -1018,12 +997,13 @@ class ProtocolReceiveTest(TestCase):
|
|||
obj = self.assert_object('fake:update',
|
||||
status='complete',
|
||||
our_as1=update_as1,
|
||||
delivered=['fake:post:target'],
|
||||
delivered=['other:post:target'],
|
||||
delivered_protocol='other',
|
||||
type='update',
|
||||
users=[self.user.key, self.alice.key],
|
||||
notify=[self.bob.key],
|
||||
notify=[eve.key],
|
||||
)
|
||||
self.assertEqual([(obj.key.id(), 'fake:post:target')], Fake.sent)
|
||||
self.assertEqual([(obj.key.id(), 'other:post:target')], OtherFake.sent)
|
||||
|
||||
def test_repost(self):
|
||||
self.make_followers()
|
||||
|
@ -1870,7 +1850,7 @@ class ProtocolReceiveTest(TestCase):
|
|||
}
|
||||
|
||||
user = self.make_user('eefake:user', cls=ExplicitEnableFake)
|
||||
self.assertFalse(ExplicitEnableFake.is_enabled_to(Fake, user))
|
||||
self.assertFalse(user.is_enabled(Fake))
|
||||
|
||||
# fake protocol isn't enabled yet, block should be a noop
|
||||
self.assertEqual(('OK', 200), ExplicitEnableFake.receive_as1(block))
|
||||
|
@ -1884,7 +1864,7 @@ class ProtocolReceiveTest(TestCase):
|
|||
user = user.key.get()
|
||||
self.assertEqual(['fake'], user.enabled_protocols)
|
||||
self.assertEqual(['eefake:user'], Fake.created_for)
|
||||
self.assertTrue(ExplicitEnableFake.is_enabled_to(Fake, user))
|
||||
self.assertTrue(user.is_enabled(Fake))
|
||||
self.assertEqual([('fa.brid.gy/followers#accept-eefake:follow',
|
||||
'eefake:user:target')],
|
||||
ExplicitEnableFake.sent)
|
||||
|
@ -1904,7 +1884,7 @@ class ProtocolReceiveTest(TestCase):
|
|||
user = user.key.get()
|
||||
self.assertEqual([], user.enabled_protocols)
|
||||
self.assertEqual([], Fake.created_for)
|
||||
self.assertFalse(ExplicitEnableFake.is_enabled_to(Fake, user))
|
||||
self.assertFalse(user.is_enabled(Fake))
|
||||
|
||||
def test_dm_no_yes_sets_enabled_protocols(self):
|
||||
dm = {
|
||||
|
@ -1916,7 +1896,7 @@ class ProtocolReceiveTest(TestCase):
|
|||
}
|
||||
|
||||
user = self.make_user('eefake:user', cls=ExplicitEnableFake)
|
||||
self.assertFalse(ExplicitEnableFake.is_enabled_to(Fake, user))
|
||||
self.assertFalse(user.is_enabled(Fake))
|
||||
|
||||
# fake protocol isn't enabled yet, no DM should be a noop
|
||||
self.assertEqual(('OK', 200), ExplicitEnableFake.receive_as1(dm))
|
||||
|
@ -1931,7 +1911,7 @@ class ProtocolReceiveTest(TestCase):
|
|||
user = user.key.get()
|
||||
self.assertEqual(['fake'], user.enabled_protocols)
|
||||
self.assertEqual(['eefake:user'], Fake.created_for)
|
||||
self.assertTrue(ExplicitEnableFake.is_enabled_to(Fake, user))
|
||||
self.assertTrue(user.is_enabled(Fake))
|
||||
|
||||
# another yes DM should be a noop
|
||||
dm['id'] += '3'
|
||||
|
@ -1948,7 +1928,7 @@ class ProtocolReceiveTest(TestCase):
|
|||
user = user.key.get()
|
||||
self.assertEqual([], user.enabled_protocols)
|
||||
self.assertEqual([], Fake.created_for)
|
||||
self.assertFalse(ExplicitEnableFake.is_enabled_to(Fake, user))
|
||||
self.assertFalse(user.is_enabled(Fake))
|
||||
|
||||
def test_receive_task_handler(self):
|
||||
note = {
|
||||
|
@ -2089,17 +2069,18 @@ class ProtocolReceiveTest(TestCase):
|
|||
@patch('oauth_dropins.webutil.appengine_config.tasks_client.create_task')
|
||||
def test_reply_send_tasks_orig_obj(self, mock_create_task):
|
||||
common.RUN_TASKS_INLINE = False
|
||||
eve = self.make_user('other:eve', cls=OtherFake, obj_id='other:eve')
|
||||
|
||||
reply_as1 = {
|
||||
'id': 'fake:reply',
|
||||
'objectType': 'note',
|
||||
'inReplyTo': 'fake:post',
|
||||
'inReplyTo': 'other:post',
|
||||
'author': 'fake:user',
|
||||
}
|
||||
Fake.fetchable['fake:post'] = {
|
||||
OtherFake.fetchable['other:post'] = {
|
||||
'objectType': 'note',
|
||||
'id': 'fake:post',
|
||||
'author': 'fake:bob',
|
||||
'id': 'other:post',
|
||||
'author': 'other:eve',
|
||||
}
|
||||
self.assertEqual(('OK', 202), Fake.receive_as1(reply_as1))
|
||||
|
||||
|
@ -2109,10 +2090,10 @@ class ProtocolReceiveTest(TestCase):
|
|||
)
|
||||
|
||||
create_key = Object(id='fake:reply#bridgy-fed-create').key.urlsafe()
|
||||
orig_obj_key = Object(id='fake:post').key.urlsafe()
|
||||
self.assert_task(mock_create_task, 'send', '/queue/send', protocol='fake',
|
||||
obj=create_key, orig_obj=orig_obj_key, url='fake:post:target',
|
||||
user=self.user.key.urlsafe())
|
||||
orig_obj_key = Object(id='other:post').key.urlsafe()
|
||||
self.assert_task(mock_create_task, 'send', '/queue/send', protocol='other',
|
||||
obj=create_key, orig_obj=orig_obj_key,
|
||||
url='other:post:target', user=self.user.key.urlsafe())
|
||||
|
||||
self.assertEqual([], OtherFake.sent)
|
||||
self.assertEqual([], Fake.sent)
|
||||
|
|
|
@ -2903,7 +2903,7 @@ class WebUtilTest(TestCase):
|
|||
def test_convert(self, mock_get, __):
|
||||
mock_get.return_value = ACTOR_HTML_RESP
|
||||
|
||||
obj = Object(id='http://orig', mf2=ACTOR_MF2)
|
||||
obj = Object(id='http://orig', mf2=ACTOR_MF2, source_protocol='web')
|
||||
self.assert_multiline_equals("""\
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
|
|
@ -71,6 +71,7 @@ class Fake(User, protocol.Protocol):
|
|||
PHRASE = 'fake-phrase'
|
||||
CONTENT_TYPE = 'fa/ke'
|
||||
HAS_COPIES = True
|
||||
LOGO_HTML = '<img src="fake-logo">'
|
||||
|
||||
# maps string ids to dict AS1 objects that can be fetched
|
||||
fetchable = {}
|
||||
|
|
8
web.py
8
web.py
|
@ -26,7 +26,7 @@ from werkzeug.exceptions import BadGateway, BadRequest, HTTPException, NotFound
|
|||
import common
|
||||
from common import add, DOMAIN_RE, PRIMARY_DOMAIN, PROTOCOL_DOMAINS, SUPERDOMAIN
|
||||
from flask_app import app, cache
|
||||
from ids import translate_handle, translate_object_id, translate_user_id
|
||||
from ids import translate_object_id, translate_user_id
|
||||
from models import Follower, Object, PROTOCOLS, Target, User
|
||||
from protocol import Protocol
|
||||
|
||||
|
@ -554,11 +554,11 @@ class Web(User, Protocol):
|
|||
return ''
|
||||
|
||||
obj_as1 = obj.as1
|
||||
if from_user and not from_user.is_enabled(cls):
|
||||
error(f'{from_user.key.id()} => {cls.LABEL} not enabled')
|
||||
|
||||
from_proto = PROTOCOLS.get(obj.source_protocol)
|
||||
if from_proto:
|
||||
if not from_proto.is_enabled_to(cls, user=from_user):
|
||||
error(f'{cls.LABEL} <=> {from_proto.LABEL} not enabled')
|
||||
|
||||
# fill in author/actor if available
|
||||
for field in 'author', 'actor':
|
||||
val = as1.get_object(obj.as1, field)
|
||||
|
|
|
@ -90,7 +90,7 @@ class Webfinger(flask_util.XrdOrJrd):
|
|||
if user and not user.direct:
|
||||
error(f"{user.key} hasn't signed up yet", status=404)
|
||||
|
||||
if not user or not user.is_enabled_to(activitypub.ActivityPub, user=user):
|
||||
if not user or not user.is_enabled(activitypub.ActivityPub):
|
||||
error(f'No {cls.LABEL} user found for {id}', status=404)
|
||||
|
||||
ap_handle = user.handle_as('activitypub')
|
||||
|
|
Ładowanie…
Reference in New Issue