Vibefed kb-friendica
git clone https://github.com/reiver/vibefed
T=$(mktemp -d) && git clone --depth=1 https://github.com/reiver/vibefed "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/kb-friendica" ~/.claude/skills/reiver-vibefed-kb-friendica && rm -rf "$T"
skills/kb-friendica/SKILL.mdFriendica — Complete Reference
Overview
Friendica is a free, open-source, decentralized social networking platform — the Fediverse's answer to Facebook. Created by Mike Macgirvin (former Netscape/AOL/Sun messaging engineer) in July 2010 under the original name "Mistpark," it is one of the oldest continuously active Fediverse projects, predating Mastodon by six years. Licensed AGPL-3.0.
Friendica's defining characteristic is its multi-protocol bridge role. It simultaneously speaks ActivityPub, the Diaspora protocol, and its native DFRN protocol, and connects (via addons) to Bluesky, Tumblr, GNU Social, email (IMAP/SMTP), and RSS/Atom feeds. Fedi.Tips calls it "a sort of Swiss Army knife of the Fediverse." Where Mastodon is a Twitter replacement (microblogging), Friendica is a Facebook replacement (full social networking) with Circles/Groups, photo albums, events, forums, 200,000-character posts, and fine-grained ACL-based privacy controls.
Current maintainers are Tobias Diekershoff (FSFE) and Michael Vogel. As of 2025: ~220 active instances, ~20,800 registered users, ~2.8 million statuses, 27,000+ commits from 250+ contributors.
1. History and Lineage
| Date | Event |
|---|---|
| July 2010 | Mike Macgirvin creates Mistpark in Australia, motivated by "Quit Facebook Day" privacy concerns |
| Mid-2010 | Within first month: federation with StatusNet (OStatus), RSS, email integration |
| Late 2010 | Renamed to Friendika |
| July 2011 | Zot protocol first named (Macgirvin's next-gen protocol design) |
| Sep 2011 | Macgirvin forks as "Free-Friendika" (MIT license) |
| Oct 2011 | Name changed to Friendica |
| Jan 2012 | First "Friendica" release (v2.37) |
| 2012 | Diaspora protocol reverse-engineered from scratch (~6 months) |
| May 2012 | Macgirvin departs, forks into Red / Friendica Red (MIT) |
| 2012-2013 | Red becomes Red Matrix |
| May 2015 | Red Matrix renamed to Hubzilla |
| Dec 2018 | ActivityPub support shipped |
| May 2023 | Initial Bluesky connector |
| Dec 2023 | Bidirectional Bluesky; Circles and Channels introduced |
| Jan 2025 | v2024.12: OStatus dropped, Prometheus metrics, FEP-67ff |
| Jan 2026 | v2026.01 "Blutwurz": reworked hook system, media embedding overhaul |
The Fork Lineage
Mistpark (2010) └─> Friendika (2010) ─> Friendica (2011, AGPL-3.0) └─> Free-Friendika (2011, MIT) └─> Red / Friendica Red (2012) └─> Red Matrix (2013) └─> Hubzilla (2015, Zot protocol) └─> Osada, Zap, Roadhouse (2018-2022) └─> Streams (2021-present, Nomad protocol) └─> Forte (2024, ActivityPub-only)
Founding Motivation
Macgirvin left Facebook in early 2010 and found no decentralized alternative with both Facebook-like interactivity and privacy. StatusNet's OStatus had "absolutely nothing in the way of privacy." He created the DFRN protocol to address four gaps:
- No protocol for friend connections
- No privacy support in social protocols
- No cross-server wall posting
- Private media required sending copies to all recipients
2. Technology Stack
| Layer | Technology |
|---|---|
| Backend language | PHP (7.4+, 8.x recommended, supports 8.5) |
| Database | MariaDB (recommended), MySQL, PostgreSQL 9.6+ |
| Web server | Apache (mod-rewrite) or Nginx |
| Template engine | Smarty3 |
| Dependency management | Composer |
| DI container | Dice |
| Themes | frio (default), vier, quattro |
| License | AGPL-3.0 |
| Hardware minimum | 2 GB RAM |
| Required PHP extensions | Curl, GD, GMP, PDO, mbstring, Intl, MySQLi, OpenSSL, POSIX |
Entry Points
- Web:
→index.phpApp::processRequest() - CLI:
→bin/console.phpApp::processConsole() - Worker:
(or legacybin/console.php worker
)bin/worker.php
Configuration Hierarchy (increasing priority)
— system defaultsstatic/defaults.config.php
— admin-configurable defaultsstatic/settings.config.php
— instance-specific overridesconfig/local.config.php
database table — runtime settings (highest)config
3. Federation Protocols
Friendica is unique in speaking multiple federation protocols simultaneously, acting as a bridge between otherwise-separate ecosystems.
Currently Supported
| Protocol | Purpose | Since |
|---|---|---|
| ActivityPub | Federation with Mastodon, Pleroma, Pixelfed, PeerTube, Lemmy, etc. | Dec 2018 |
| Diaspora protocol | Federation with Diaspora pods, Hubzilla | 2012 |
| DFRN | Native Friendica-to-Friendica federation | July 2010 |
| WebFinger | User discovery | — |
| HTTP Signatures | Request authentication for ActivityPub | — |
| NodeInfo | Server metadata discovery | — |
| Salmon | Message exchange for replies and mentions | — |
Dropped
| Protocol | Dropped | Reason |
|---|---|---|
| OStatus (PubSubHubbub + Atom) | v2024.12 | Too few active OStatus-only servers |
Supported FEPs
Nine FEPs including: group federation (Lemmy/Kbin compatible), OpenWebAuth (Hubzilla login), long-form text (partial), application actor identification, object links, and FEP-67ff (FEDERATION.md).
4. The DFRN Protocol
Distributed Friends and Relations Network — Friendica's native protocol for Friendica-to-Friendica federation. Creates an authenticated pipe between users using public-key cryptography.
Message Format
- Atom Syndication Protocol wrapper with ActivityStreams 1.0, threading, and media extensions
- Content in BBCode internally
- Specification:
in the Friendica repositoryspec/dfrn2.pdf
Key Concepts
- Distinguishes author (content creator) from owner (profile host)
- Communication boundary is the individual's profile page
- "Friends of friends" are visible, but direct contact required for communication with third parties
Endpoints
| Endpoint | Purpose |
|---|---|
| Friend/contact requests |
| Delivery (push) |
| Feed retrieval (pull) |
Handshake
- Remote site POSTs to
withdfrn_polltype=profile-check - Includes duplex direction, relationship
, and a random number encrypted with the site's DFRN public keydfrn_id - Original site decodes
, verifies relationship, decodes challenge, matchesdfrn_id
stringsec
Delivery Model
- Public messages: dual path — BBCode to DFRN clients + HTML conversion with PubSubHubbub notification
- Private messages: direct delivery via
to recipients only; public hubs remain uninformeddfrn_notify - Polling:
with configurable intervals (up to 5-minute checks)src/Worker/OnePoll.php - Retry: failed deliveries are queued for automatic retry
5. ActivityPub Implementation
Architecture
Three main classes in
src/Protocol/ActivityPub/:
| Class | Role |
|---|---|
| Receiver | HTTP Signature verification, activity validation, JSON decoding |
| Processor | Activity type handling (Create, Update, Delete, Like, Announce) |
| Transmitter | JSON-LD generation for outbound activities |
Delivery:
Worker/Notifier calculates recipients by protocol, spawning
APDelivery workers for ActivityPub contacts.
Supported Features
- Follow/unfollow accounts
- Public and non-public messaging
- Posting, commenting, liking, unliking, deletion
- Bidirectional comment distribution (thread-based and per-posting models)
- Thread completion (prevents conversation fragmentation)
- Failed delivery retry queuing
- Sends Follow for root post IDs to request inclusion in receiver collections
Known Limitations
- No native direct messages via ActivityPub (workaround: non-public post restricted to single recipient)
- No account migration between nodes via ActivityPub
Mastodon-Compatible API
Extensive coverage:
- Accounts: verify_credentials, follow/unfollow/block/unblock/mute/unmute, followers, following, relationships, search
- Statuses: create/get/delete, favourite/unfavourite, reblog/unreblog, bookmark, pin/unpin, context
- Timelines: home, public, tag, list, direct
- Notifications: list, get, clear, dismiss
- Other: conversations, lists, media, search v1/v2, instance info, follow requests, emojis, directory, polls, push subscriptions
Not implemented: profile updates via API, familiar followers, trending, poll voting, streaming, admin functions, domain blocks
Compatible clients: Tusky, Fedilab, Sengi, Twidere, AndStatus, Bitlbee, Raccoon for Friendica.
6. Cross-Network Connectivity
Built-in (no addon needed)
| Network | Protocol |
|---|---|
| Mastodon, Pleroma, Pixelfed, PeerTube, Lemmy, Kbin, Misskey | ActivityPub |
| Diaspora, Hubzilla, Socialhome | Diaspora protocol |
| Other Friendica nodes | DFRN |
| IMAP4rev1 / ESMTP (bidirectional) | |
| Any website/blog | RSS/Atom feed import |
Addon Connectors (bidirectional)
| Network | Notes |
|---|---|
| Bluesky | No API key needed; bidirectional since v2023.12 |
| pump.io | Posting, relaying, reading |
| GNU Social | Via statusnet addon |
Addon Connectors (post-only)
Tumblr, WordPress (XMLRPC), LiveJournal, Dreamwidth, InsaneJournal, Libertree, Blogger, Buffer
Deprecated
- Twitter — removed due to API changes under Musk
- Facebook/Google+ — removed when APIs shut down
7. Privacy and Access Control
Friendica's privacy model is significantly more granular than most Fediverse platforms:
- Posts default to private (configurable by admin to default public)
- Access Control Lists (ACLs) on every post via lock icon UI
- Circles (formerly Groups) for organizing contacts into permission sets
- Per-post overrides: select specific individuals or Circles to allow/deny
- Multiple profiles: different profiles for different audiences (family, friends, public)
- Anonymous profile viewing can be disabled
- Post deletion triggers removal notifications to all recipients
- Content expiration with automated removal from remote Friendica servers
Cross-Network Limitation
Privacy only fully works within Friendica's native protocols. Posts shared via ActivityPub or other protocols lose fine-grained ACL enforcement — the receiving server controls display. Private photo sharing only works reliably between Friendica members.
Once published, post permissions CANNOT be changed.
8. Content Model
Post Capabilities
| Feature | Details |
|---|---|
| Maximum length | 200,000 characters |
| Markup | BBCode (bold, italic, headings h1-h6, code blocks, tables, spoilers, lists) |
| Media | Images (with alt text, dimensions), video (YouTube/Vimeo/generic), audio, OEmbed |
| Albums | Photo albums with tagging and per-album privacy |
| Events | Date, time, location, RSVP |
| Forums | Public and private, federated |
| Polls | Limited (not supported via Diaspora protocol) |
| Notes | Private notebook (notes to self) |
| Maps | By address, coordinates, or post location |
| Abstract/summary | Per-network overrides (e.g., for Twitter-length) |
Object Types
Friendica represents posts as ActivityPub
Note objects when federating
via ActivityPub. Internally, content is stored in BBCode and converted to
HTML or ActivityPub JSON as needed for each protocol.
9. Database Schema
97 tables, utf8mb4 charset. Schema version tracked by
DB_UPDATE_VERSION.
Hub-and-Spoke Content Model
| Table | Purpose |
|---|---|
| URI registry for deduplication |
| Protocol-agnostic metadata (author-id, owner-id, created) |
| Per-user states (starred, hidden, visibility) |
| Body text |
| Attachments with MIME types |
/ | Thread structure |
| Edit history |
/ | Delivery tracking |
/ | Tags and categories |
/ | Polls |
| Scheduled posts |
A single post can be visible to multiple users with different permission levels without duplicating content — the
post-user table stores per-user
state separately from post-content.
Contact Tables
| Table | Purpose |
|---|---|
| Both local and remote actors |
| ActivityPub-specific contact data |
| Diaspora-specific contact data |
| Relationship graph |
| Per-user contact settings |
Relationship Constants
NOTHING=0, FOLLOWER=1, SHARING=2, FRIEND=3, SELF=4
Server/Federation Tables
gserver (known servers), endpoint (AP endpoints), inbox-status
(AP inbox tracking), diaspora-interaction (signed Diaspora interactions)
10. Architecture
8-Layer Model
- Client Layer — browsers, mobile apps (Raccoon, Fedilab), third-party clients via Mastodon API
- Frontend Layer — theme system (frio/vier/quattro), JavaScript, localization
- Application Layer — Router with 600+ routes
(
), modules, API endpointsstatic/routes.config.php - Business Logic Layer — Model classes:
,Item
,ContactUser - Content Processing Layer — BBCode formatting, media processing, URL parsing
- Federation Layer —
,Friendica\Protocol\ActivityPub
,Friendica\Protocol\DiasporaFriendica\Protocol\DFRN - Data Layer — Database abstraction (
), schema management (DBA
)DBStructure - Background Processing — Worker queue with priority levels
Worker Queue
| Priority | Value |
|---|---|
| CRITICAL | 10 |
| HIGH | 20 |
| MEDIUM | 30 |
| LOW | 40 |
| NEGLIGIBLE | 50 |
Tasks enqueued via
Worker::add() into workerqueue table. Default 10
parallel instances. Worker/Notifier routes deliveries to protocol-specific
workers (APDelivery, Delivery).
Namespaces
Friendica\Module, Friendica\Model, Friendica\Protocol,
Friendica\Worker, Friendica\Core, Friendica\Database, Friendica\Util
Dependency Injection
Dice DI container. Services accessed via static
DI class: DI::dba(),
DI::config(), DI::logger(), DI::session(), DI::baseUrl(),
DI::l10n().
11. Addon/Plugin System
Hook-based architecture with 100+ hooks. Addons live in
addon/ directory,
each in its own subdirectory.
Required Functions
function <addon>_install() { \Friendica\Core\Hook::register($hookname, $file, $function); } function <addon>_uninstall() { }
Callback Signature
function <addon>_<hookname>(App $a, &$b) { }
$a is the Friendica App class; $b is hook-specific data passed by
reference.
Major Hook Categories
| Category | Hooks |
|---|---|
| Content | , , , , |
| Auth | , , |
| Profile | , , |
| Contacts | , , , , |
| Settings | , |
| System | , , |
| Federation | , |
Module Intercept
Addons can act as full page modules by defining:
function <addon>_module() {} // signals module capability function <addon>_content(App $a) {} // returns HTML
Notable Addons
- Cross-posting: bluesky, tumblr, diaspora, discourse, wppost, ljpost, dwpost
- Storage: s3_storage, webdav_storage
- Auth: ldapauth, saml, keycloakpassword
- Privacy: securemail (GPG-encrypted notifications)
- Filters: advancedcontentfilter, langfilter, nsfw, superblock
12. Installation and Deployment
Methods
- Git clone:
+git clone -b stable
+ web installercomposer install --no-dev - CLI:
with config file or env varsbin/console autoinstall - Docker:
(official image)docker pull friendica - YunoHost: app package available
Critical Requirements
- Cron every 5-10 minutes:
(or daemon mode)bin/worker.php - HTTPS/TLS mandatory
- Must be at top-level domain or subdomain (not directory path) for Diaspora federation
- Domain cannot be changed after installation
Scaling
- Nginx preferred over Apache (~2x capacity)
- Database tuning via mysqltuner.pl
- PHP-FPM for faster processing
- Configurable worker queue parallelism (default 10)
- Extended poller intervals (30-60 min) for large instances
13. Federation Interoperability
Friendica as Protocol Bridge
Friendica's unique value is connecting users across protocol boundaries:
Mastodon user ←─ActivityPub─→ Friendica ←─Diaspora protocol─→ Diaspora pod ↕ DFRN native ↕ Bluesky (addon) ↕ RSS/Atom/Email/Tumblr
A Friendica user can follow a Mastodon account, a Diaspora contact, a Bluesky account, and an RSS feed — all in the same timeline.
vs. Mastodon
| Feature | Friendica | Mastodon |
|---|---|---|
| Post length | 200,000 chars | 500 chars |
| Protocols | AP + Diaspora + DFRN + addons | AP only |
| Contact groups | Circles with ACLs | Lists (no ACLs) |
| RSS reader | Built-in | No |
| Photo albums | Yes | No |
| Events/calendar | Yes | No |
| Quote posts | Yes (early pioneer) | Added later |
| Forums | Yes (public + private) | No |
| BBCode | Yes | No |
Known Issues
- Friendica's rich content (BBCode formatting, long posts) may be truncated or stripped by Mastodon's HTML filtering
- Privacy ACLs only enforceable within Friendica — remote servers control their own display
- Private photos only reliable between Friendica members
- Comment counts may be inaccurate on remote instances due to incomplete thread federation
14. Governance and Community
- No corporation, foundation, or board — informal volunteer governance
- Core maintainers: Tobias Diekershoff (FSFE), Michael Vogel
- Communication: Friendica forums (dogfooding the platform)
- Code: GitHub + self-hosted Gitea at git.friendi.ca
- Mascot: Flaxy O'Hare (rabbit, CC0)
- Release cadence: quarterly stable releases, year.month versioning
- No direct donations accepted — covers server costs only
15. Common Implementation Mistakes
- Assuming Friendica only speaks ActivityPub: Friendica may deliver content via DFRN or Diaspora protocol depending on the contact type — inspect the contact's protocol, not just the server software
- Not handling long posts: Friendica posts can be up to 200,000 characters — truncate gracefully rather than rejecting
- Ignoring BBCode in content: Friendica's native format is BBCode, converted to HTML for ActivityPub — the HTML may contain richer formatting than typical Mastodon posts
- Expecting Mastodon API parity: Friendica's Mastodon API has gaps (no streaming, no admin API, no poll voting) — test against a real Friendica instance
- Not supporting the
instance actor: Friendica uses an instance-level actor for some federation tasks — verify keys fromApplication
actors, not justApplicationPerson - Dropping unknown properties: Friendica posts may include properties from DFRN or Diaspora context — ignore unknown properties rather than rejecting the entire object
- Assuming public-by-default: Friendica defaults to private posts (admin-configurable) — a Friendica instance may send fewer public posts than expected