mirror of
https://github.com/tanrax/org-social-relay
synced 2026-07-25 02:34:58 +02:00
Expose external accounts as virtual Org Social feeds that any client
can follow with a plain #+FOLLOW: line:
- /bridge/activitypub/@{user}@{instance}/ bridges a Mastodon or any
ActivityPub account (WebFinger, actor and paginated outbox; only
public top-level notes, with CW, hashtags, language and attachments)
- /bridge/rss/?url={feed} bridges any RSS/Atom feed (entry title as
*** sub-heading, converted body and link to the original article)
Registration is implicit on first GET. Bridged data is stored in the
existing Profile/Post tables so /profile/, /search/ and the rest of
the API work on bridged feeds. Active bridges are refreshed every 15
minutes; bridges unrequested for 90 days are cleaned up.
Remote HTML is converted to Org text, escaping headline-like lines so
external content cannot inject posts. Fetches enforce the Webmention
SSRF protections, a 10s timeout and a 5MB size cap. Bridged posts
never queue Webmentions nor publish notifications.
24 lines
583 B
Python
24 lines
583 B
Python
from django.urls import path, re_path
|
|
|
|
from .views import (
|
|
ActivityPubBridgeFeedView,
|
|
ActivityPubBridgeListView,
|
|
BridgeIndexView,
|
|
RssBridgeView,
|
|
)
|
|
|
|
urlpatterns = [
|
|
path("", BridgeIndexView.as_view(), name="bridge-index"),
|
|
path(
|
|
"activitypub/",
|
|
ActivityPubBridgeListView.as_view(),
|
|
name="bridge-activitypub-list",
|
|
),
|
|
re_path(
|
|
r"^activitypub/(?P<handle>[^/]+)/$",
|
|
ActivityPubBridgeFeedView.as_view(),
|
|
name="bridge-activitypub-feed",
|
|
),
|
|
path("rss/", RssBridgeView.as_view(), name="bridge-rss"),
|
|
]
|