Files
Scrobbler/src/scrobbler/federation/protocol/nodeinfo.py
T
mattandClaude Opus 5.5 e890568c54
CI / validate-monitoring (push) Successful in 7s
CI / lint (push) Successful in 12s
CI / test (push) Successful in 57s
CI / images (push) Skipped
CI / assets (push) Skipped
CI / python-package (push) Skipped
CI / notify (push) Successful in 6s
Federation protocol building blocks (phase 1, step 2)
Pure, framework-free code in federation/protocol:
- media: ActivityPub content types and Accept negotiation
- vocab: actor URLs, Person and Application actors (Mastodon's extension
  terms), public keys, collections, plain text to safe HTML
- webfinger: acct:/actor-URL resource parsing (other domains and bad
  usernames rejected) and JRD documents
- nodeinfo: discovery and NodeInfo 2.1; hostmeta: XRD pointing at
  WebFinger

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MK52BGoJbPhZ1vSFuKcGUW
2026-09-25 20:20:24 +01:00

20 lines
695 B
Python

"""NodeInfo 2.1 (https://nodeinfo.diaspora.software/): what software a server runs."""
SCHEMA_21 = "http://nodeinfo.diaspora.software/ns/schema/2.1"
def discovery(base_url: str) -> dict:
return {"links": [{"rel": SCHEMA_21, "href": f"{base_url}/nodeinfo/2.1"}]}
def document(*, version: str, users_total: int, open_registrations: bool) -> dict:
return {
"version": "2.1",
"software": {"name": "scrobbler", "version": version},
"protocols": ["activitypub"],
"services": {"inbound": [], "outbound": []},
"openRegistrations": open_registrations,
"usage": {"users": {"total": users_total}, "localPosts": 0},
"metadata": {},
}