Friendica — 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.php → App::processRequest()
- CLI:
bin/console.php → App::processConsole()
- Worker:
bin/console.php worker (or legacy bin/worker.php)
Configuration Hierarchy (increasing priority)
static/defaults.config.php — system defaults
static/settings.config.php — admin-configurable defaults
config/local.config.php — instance-specific overrides
config database table — runtime settings (highest)
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:
spec/dfrn2.pdf in the Friendica repository
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 |
dfrn_request |
Friend/contact requests |
dfrn_notify |
Delivery (push) |
dfrn_poll |
Feed retrieval (pull) |
Handshake
- Remote site POSTs to
dfrn_poll with type=profile-check
- Includes duplex direction, relationship
dfrn_id, and a random number
encrypted with the site's DFRN public key
- Original site decodes
dfrn_id, verifies relationship, decodes challenge,
matches sec string
Delivery Model
- Public messages: dual path — BBCode to DFRN clients + HTML conversion
with PubSubHubbub notification
- Private messages: direct delivery via
dfrn_notify to recipients only;
public hubs remain uninformed
- Polling:
src/Worker/OnePoll.php with configurable intervals (up to
5-minute checks)
- 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 |
| Email |
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., [abstract=twit] 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 |
item-uri |
URI registry for deduplication |
post |
Protocol-agnostic metadata (author-id, owner-id, created) |
post-user |
Per-user states (starred, hidden, visibility) |
post-content |
Body text |
post-media |
Attachments with MIME types |
post-thread / post-thread-user |
Thread structure |
post-history |
Edit history |
post-delivery / post-delivery-data |
Delivery tracking |
post-tag / post-category |
Tags and categories |
post-question / post-question-option |
Polls |
delayed-post |
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 |
contact |
Both local and remote actors |
apcontact |
ActivityPub-specific contact data |
fcontact |
Diaspora-specific contact data |
contact-relation |
Relationship graph |
user-contact |
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
(
static/routes.config.php), modules, API endpoints
- Business Logic Layer — Model classes:
Item, Contact, User
- Content Processing Layer — BBCode formatting, media processing, URL
parsing
- Federation Layer —
Friendica\Protocol\ActivityPub,
Friendica\Protocol\Diaspora, Friendica\Protocol\DFRN
- Data Layer — Database abstraction (
DBA), schema management
(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 |
post_local, post_local_end, post_remote, display_item, prepare_body |
| Auth |
authenticate, logged_in, register_post |
| Profile |
profile_post, profile_edit, profile_sidebar |
| Contacts |
follow, unfollow, revoke_follow, block, unblock |
| Settings |
addon_settings, connector_settings |
| System |
init_1, load_config, route_collection |
| Federation |
probe_detect, item_by_link |
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 + composer install --no-dev +
web installer
- CLI:
bin/console autoinstall with config file or env vars
- Docker:
docker pull friendica (official image)
- YunoHost: app package available
Critical Requirements
- Cron every 5-10 minutes:
bin/worker.php (or daemon mode)
- 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
Application instance actor: Friendica uses an
instance-level actor for some federation tasks — verify keys from
Application actors, not just Person
- 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
1---2name: kb-friendica3description: Background knowledge about Friendica, the federated social networking platform (Facebook alternative). Covers Friendica's history and lineage (Mistpark 2010, Friendika, Friendica, the Red Matrix/Hubzilla fork), its multi-protocol architecture (ActivityPub, DFRN, Diaspora protocol simultaneously), the DFRN protocol (Distributed Friends and Relations Network — Atom/ActivityStreams XML with public-key crypto handshake, dfrn_notify/dfrn_poll/dfrn_request endpoints), the ActivityPub implementation (Receiver/Processor/Transmitter classes, APDelivery workers, Mastodon-compatible API), the Diaspora protocol integration (reverse-engineered PHP implementation), the addon/plugin system (hook-based with 100+ hooks, Smarty3 templates, module intercept), cross-network connectors (Bluesky bidirectional, Tumblr, GNU Social, email IMAP/SMTP, RSS/Atom, WordPress/LiveJournal/Dreamwidth post-only), privacy controls (ACLs, Circles/Groups, multiple profiles, per-post permissions), content model (200,000-char posts, BBCode, photo a4---5
6# Friendica — Complete Reference
7
8## Overview
9
10Friendica is a free, open-source, decentralized social networking platform
11— the Fediverse's answer to Facebook. Created by Mike Macgirvin (former
12Netscape/AOL/Sun messaging engineer) in July 2010 under the original name
13"Mistpark," it is one of the oldest continuously active Fediverse projects,
14predating Mastodon by six years. Licensed AGPL-3.0.
15
16Friendica's defining characteristic is its **multi-protocol bridge role**.
17It simultaneously speaks ActivityPub, the Diaspora protocol, and its native
18DFRN protocol, and connects (via addons) to Bluesky, Tumblr, GNU Social,
19email (IMAP/SMTP), and RSS/Atom feeds. Fedi.Tips calls it "a sort of Swiss
20Army knife of the Fediverse." Where Mastodon is a Twitter replacement
21(microblogging), Friendica is a Facebook replacement (full social networking)
22with Circles/Groups, photo albums, events, forums, 200,000-character posts,
23and fine-grained ACL-based privacy controls.
24
25Current maintainers are Tobias Diekershoff (FSFE) and Michael Vogel. As of
262025: ~220 active instances, ~20,800 registered users, ~2.8 million
27statuses, 27,000+ commits from 250+ contributors.
28
29---
30
31## 1. History and Lineage
32
33| Date | Event |
34|------|-------|
35| July 2010 | Mike Macgirvin creates **Mistpark** in Australia, motivated by "Quit Facebook Day" privacy concerns |
36| Mid-2010 | Within first month: federation with StatusNet (OStatus), RSS, email integration |
37| Late 2010 | Renamed to **Friendika** |
38| July 2011 | Zot protocol first named (Macgirvin's next-gen protocol design) |
39| Sep 2011 | Macgirvin forks as "Free-Friendika" (MIT license) |
40| Oct 2011 | Name changed to **Friendica** |
41| Jan 2012 | First "Friendica" release (v2.37) |
42| 2012 | Diaspora protocol reverse-engineered from scratch (~6 months) |
43| May 2012 | Macgirvin departs, forks into **Red** / **Friendica Red** (MIT) |
44| 2012-2013 | Red becomes **Red Matrix** |
45| May 2015 | Red Matrix renamed to **Hubzilla** |
46| Dec 2018 | **ActivityPub** support shipped |
47| May 2023 | Initial Bluesky connector |
48| Dec 2023 | Bidirectional Bluesky; Circles and Channels introduced |
49| Jan 2025 | v2024.12: **OStatus dropped**, Prometheus metrics, FEP-67ff |
50| Jan 2026 | v2026.01 "Blutwurz": reworked hook system, media embedding overhaul |
51
52### The Fork Lineage
53
54```
55Mistpark (2010)
56 └─> Friendika (2010) ─> Friendica (2011, AGPL-3.0)
57 └─> Free-Friendika (2011, MIT)
58 └─> Red / Friendica Red (2012)
59 └─> Red Matrix (2013)
60 └─> Hubzilla (2015, Zot protocol)
61 └─> Osada, Zap, Roadhouse (2018-2022)
62 └─> Streams (2021-present, Nomad protocol)
63 └─> Forte (2024, ActivityPub-only)
64```
65
66### Founding Motivation
67
68Macgirvin left Facebook in early 2010 and found no decentralized alternative
69with both Facebook-like interactivity and privacy. StatusNet's OStatus had
70"absolutely nothing in the way of privacy." He created the DFRN protocol to
71address four gaps:
72
731. No protocol for friend connections
742. No privacy support in social protocols
753. No cross-server wall posting
764. Private media required sending copies to all recipients
77
78---
79
80## 2. Technology Stack
81
82| Layer | Technology |
83|-------|-----------|
84| Backend language | PHP (7.4+, 8.x recommended, supports 8.5) |
85| Database | MariaDB (recommended), MySQL, PostgreSQL 9.6+ |
86| Web server | Apache (mod-rewrite) or Nginx |
87| Template engine | Smarty3 |
88| Dependency management | Composer |
89| DI container | Dice |
90| Themes | frio (default), vier, quattro |
91| License | AGPL-3.0 |
92| Hardware minimum | 2 GB RAM |
93| Required PHP extensions | Curl, GD, GMP, PDO, mbstring, Intl, MySQLi, OpenSSL, POSIX |
94
95### Entry Points
96
97- **Web**: `index.php` → `App::processRequest()`
98- **CLI**: `bin/console.php` → `App::processConsole()`
99- **Worker**: `bin/console.php worker` (or legacy `bin/worker.php`)
100
101### Configuration Hierarchy (increasing priority)
102
1031. `static/defaults.config.php` — system defaults
1042. `static/settings.config.php` — admin-configurable defaults
1053. `config/local.config.php` — instance-specific overrides
1064. `config` database table — runtime settings (highest)
107
108---
109
110## 3. Federation Protocols
111
112Friendica is unique in speaking **multiple federation protocols
113simultaneously**, acting as a bridge between otherwise-separate ecosystems.
114
115### Currently Supported
116
117| Protocol | Purpose | Since |
118|----------|---------|-------|
119| **ActivityPub** | Federation with Mastodon, Pleroma, Pixelfed, PeerTube, Lemmy, etc. | Dec 2018 |
120| **Diaspora protocol** | Federation with Diaspora pods, Hubzilla | 2012 |
121| **DFRN** | Native Friendica-to-Friendica federation | July 2010 |
122| **WebFinger** | User discovery | — |
123| **HTTP Signatures** | Request authentication for ActivityPub | — |
124| **NodeInfo** | Server metadata discovery | — |
125| **Salmon** | Message exchange for replies and mentions | — |
126
127### Dropped
128
129| Protocol | Dropped | Reason |
130|----------|---------|--------|
131| **OStatus** (PubSubHubbub + Atom) | v2024.12 | Too few active OStatus-only servers |
132
133### Supported FEPs
134
135Nine FEPs including: group federation (Lemmy/Kbin compatible), OpenWebAuth
136(Hubzilla login), long-form text (partial), application actor identification,
137object links, and FEP-67ff (FEDERATION.md).
138
139---
140
141## 4. The DFRN Protocol
142
143**Distributed Friends and Relations Network** — Friendica's native protocol
144for Friendica-to-Friendica federation. Creates an authenticated pipe between
145users using public-key cryptography.
146
147### Message Format
148
149- Atom Syndication Protocol wrapper with ActivityStreams 1.0, threading,
150 and media extensions
151- Content in BBCode internally
152- Specification: `spec/dfrn2.pdf` in the Friendica repository
153
154### Key Concepts
155
156- Distinguishes **author** (content creator) from **owner** (profile host)
157- Communication boundary is the individual's profile page
158- "Friends of friends" are visible, but direct contact required for
159 communication with third parties
160
161### Endpoints
162
163| Endpoint | Purpose |
164|----------|---------|
165| `dfrn_request` | Friend/contact requests |
166| `dfrn_notify` | Delivery (push) |
167| `dfrn_poll` | Feed retrieval (pull) |
168
169### Handshake
170
1711. Remote site POSTs to `dfrn_poll` with `type=profile-check`
1722. Includes duplex direction, relationship `dfrn_id`, and a random number
173 encrypted with the site's DFRN public key
1743. Original site decodes `dfrn_id`, verifies relationship, decodes challenge,
175 matches `sec` string
176
177### Delivery Model
178
179- **Public messages**: dual path — BBCode to DFRN clients + HTML conversion
180 with PubSubHubbub notification
181- **Private messages**: direct delivery via `dfrn_notify` to recipients only;
182 public hubs remain uninformed
183- **Polling**: `src/Worker/OnePoll.php` with configurable intervals (up to
184 5-minute checks)
185- **Retry**: failed deliveries are queued for automatic retry
186
187---
188
189## 5. ActivityPub Implementation
190
191### Architecture
192
193Three main classes in `src/Protocol/ActivityPub/`:
194
195| Class | Role |
196|-------|------|
197| **Receiver** | HTTP Signature verification, activity validation, JSON decoding |
198| **Processor** | Activity type handling (Create, Update, Delete, Like, Announce) |
199| **Transmitter** | JSON-LD generation for outbound activities |
200
201Delivery: `Worker/Notifier` calculates recipients by protocol, spawning
202`APDelivery` workers for ActivityPub contacts.
203
204### Supported Features
205
206- Follow/unfollow accounts
207- Public and non-public messaging
208- Posting, commenting, liking, unliking, deletion
209- Bidirectional comment distribution (thread-based and per-posting models)
210- Thread completion (prevents conversation fragmentation)
211- Failed delivery retry queuing
212- Sends Follow for root post IDs to request inclusion in receiver collections
213
214### Known Limitations
215
216- No native direct messages via ActivityPub (workaround: non-public post
217 restricted to single recipient)
218- No account migration between nodes via ActivityPub
219
220### Mastodon-Compatible API
221
222Extensive coverage:
223
224- **Accounts**: verify_credentials, follow/unfollow/block/unblock/mute/unmute,
225 followers, following, relationships, search
226- **Statuses**: create/get/delete, favourite/unfavourite, reblog/unreblog,
227 bookmark, pin/unpin, context
228- **Timelines**: home, public, tag, list, direct
229- **Notifications**: list, get, clear, dismiss
230- **Other**: conversations, lists, media, search v1/v2, instance info,
231 follow requests, emojis, directory, polls, push subscriptions
232
233**Not implemented**: profile updates via API, familiar followers, trending,
234poll voting, streaming, admin functions, domain blocks
235
236Compatible clients: Tusky, Fedilab, Sengi, Twidere, AndStatus, Bitlbee,
237Raccoon for Friendica.
238
239---
240
241## 6. Cross-Network Connectivity
242
243### Built-in (no addon needed)
244
245| Network | Protocol |
246|---------|----------|
247| Mastodon, Pleroma, Pixelfed, PeerTube, Lemmy, Kbin, Misskey | ActivityPub |
248| Diaspora, Hubzilla, Socialhome | Diaspora protocol |
249| Other Friendica nodes | DFRN |
250| Email | IMAP4rev1 / ESMTP (bidirectional) |
251| Any website/blog | RSS/Atom feed import |
252
253### Addon Connectors (bidirectional)
254
255| Network | Notes |
256|---------|-------|
257| **Bluesky** | No API key needed; bidirectional since v2023.12 |
258| **pump.io** | Posting, relaying, reading |
259| **GNU Social** | Via statusnet addon |
260
261### Addon Connectors (post-only)
262
263Tumblr, WordPress (XMLRPC), LiveJournal, Dreamwidth, InsaneJournal,
264Libertree, Blogger, Buffer
265
266### Deprecated
267
268- **Twitter** — removed due to API changes under Musk
269- **Facebook/Google+** — removed when APIs shut down
270
271---
272
273## 7. Privacy and Access Control
274
275Friendica's privacy model is significantly more granular than most Fediverse
276platforms:
277
278- **Posts default to private** (configurable by admin to default public)
279- **Access Control Lists (ACLs)** on every post via lock icon UI
280- **Circles** (formerly Groups) for organizing contacts into permission sets
281- **Per-post overrides**: select specific individuals or Circles to
282 allow/deny
283- **Multiple profiles**: different profiles for different audiences (family,
284 friends, public)
285- Anonymous profile viewing can be disabled
286- Post deletion triggers removal notifications to all recipients
287- Content expiration with automated removal from remote Friendica servers
288
289### Cross-Network Limitation
290
291Privacy only fully works **within Friendica's native protocols**. Posts
292shared via ActivityPub or other protocols lose fine-grained ACL enforcement
293— the receiving server controls display. Private photo sharing only works
294reliably between Friendica members.
295
296**Once published, post permissions CANNOT be changed.**
297
298---
299
300## 8. Content Model
301
302### Post Capabilities
303
304| Feature | Details |
305|---------|---------|
306| Maximum length | 200,000 characters |
307| Markup | BBCode (bold, italic, headings h1-h6, code blocks, tables, spoilers, lists) |
308| Media | Images (with alt text, dimensions), video (YouTube/Vimeo/generic), audio, OEmbed |
309| Albums | Photo albums with tagging and per-album privacy |
310| Events | Date, time, location, RSVP |
311| Forums | Public and private, federated |
312| Polls | Limited (not supported via Diaspora protocol) |
313| Notes | Private notebook (notes to self) |
314| Maps | By address, coordinates, or post location |
315| Abstract/summary | Per-network overrides (e.g., `[abstract=twit]` for Twitter-length) |
316
317### Object Types
318
319Friendica represents posts as ActivityPub `Note` objects when federating
320via ActivityPub. Internally, content is stored in BBCode and converted to
321HTML or ActivityPub JSON as needed for each protocol.
322
323---
324
325## 9. Database Schema
326
327**97 tables**, utf8mb4 charset. Schema version tracked by
328`DB_UPDATE_VERSION`.
329
330### Hub-and-Spoke Content Model
331
332| Table | Purpose |
333|-------|---------|
334| `item-uri` | URI registry for deduplication |
335| `post` | Protocol-agnostic metadata (author-id, owner-id, created) |
336| `post-user` | Per-user states (starred, hidden, visibility) |
337| `post-content` | Body text |
338| `post-media` | Attachments with MIME types |
339| `post-thread` / `post-thread-user` | Thread structure |
340| `post-history` | Edit history |
341| `post-delivery` / `post-delivery-data` | Delivery tracking |
342| `post-tag` / `post-category` | Tags and categories |
343| `post-question` / `post-question-option` | Polls |
344| `delayed-post` | Scheduled posts |
345
346A single post can be visible to multiple users with different permission
347levels without duplicating content — the `post-user` table stores per-user
348state separately from `post-content`.
349
350### Contact Tables
351
352| Table | Purpose |
353|-------|---------|
354| `contact` | Both local and remote actors |
355| `apcontact` | ActivityPub-specific contact data |
356| `fcontact` | Diaspora-specific contact data |
357| `contact-relation` | Relationship graph |
358| `user-contact` | Per-user contact settings |
359
360### Relationship Constants
361
362`NOTHING=0`, `FOLLOWER=1`, `SHARING=2`, `FRIEND=3`, `SELF=4`
363
364### Server/Federation Tables
365
366`gserver` (known servers), `endpoint` (AP endpoints), `inbox-status`
367(AP inbox tracking), `diaspora-interaction` (signed Diaspora interactions)
368
369---
370
371## 10. Architecture
372
373### 8-Layer Model
374
3751. **Client Layer** — browsers, mobile apps (Raccoon, Fedilab), third-party
376 clients via Mastodon API
3772. **Frontend Layer** — theme system (frio/vier/quattro), JavaScript,
378 localization
3793. **Application Layer** — Router with 600+ routes
380 (`static/routes.config.php`), modules, API endpoints
3814. **Business Logic Layer** — Model classes: `Item`, `Contact`, `User`
3825. **Content Processing Layer** — BBCode formatting, media processing, URL
383 parsing
3846. **Federation Layer** — `Friendica\Protocol\ActivityPub`,
385 `Friendica\Protocol\Diaspora`, `Friendica\Protocol\DFRN`
3867. **Data Layer** — Database abstraction (`DBA`), schema management
387 (`DBStructure`)
3888. **Background Processing** — Worker queue with priority levels
389
390### Worker Queue
391
392| Priority | Value |
393|----------|-------|
394| CRITICAL | 10 |
395| HIGH | 20 |
396| MEDIUM | 30 |
397| LOW | 40 |
398| NEGLIGIBLE | 50 |
399
400Tasks enqueued via `Worker::add()` into `workerqueue` table. Default 10
401parallel instances. `Worker/Notifier` routes deliveries to protocol-specific
402workers (`APDelivery`, `Delivery`).
403
404### Namespaces
405
406`Friendica\Module`, `Friendica\Model`, `Friendica\Protocol`,
407`Friendica\Worker`, `Friendica\Core`, `Friendica\Database`, `Friendica\Util`
408
409### Dependency Injection
410
411Dice DI container. Services accessed via static `DI` class: `DI::dba()`,
412`DI::config()`, `DI::logger()`, `DI::session()`, `DI::baseUrl()`,
413`DI::l10n()`.
414
415---
416
417## 11. Addon/Plugin System
418
419Hook-based architecture with 100+ hooks. Addons live in `addon/` directory,
420each in its own subdirectory.
421
422### Required Functions
423
424```php
425function <addon>_install() {
426 \Friendica\Core\Hook::register($hookname, $file, $function);
427}
428function <addon>_uninstall() { }
429```
430
431### Callback Signature
432
433```php
434function <addon>_<hookname>(App $a, &$b) { }
435```
436
437`$a` is the Friendica App class; `$b` is hook-specific data passed by
438reference.
439
440### Major Hook Categories
441
442| Category | Hooks |
443|----------|-------|
444| Content | `post_local`, `post_local_end`, `post_remote`, `display_item`, `prepare_body` |
445| Auth | `authenticate`, `logged_in`, `register_post` |
446| Profile | `profile_post`, `profile_edit`, `profile_sidebar` |
447| Contacts | `follow`, `unfollow`, `revoke_follow`, `block`, `unblock` |
448| Settings | `addon_settings`, `connector_settings` |
449| System | `init_1`, `load_config`, `route_collection` |
450| Federation | `probe_detect`, `item_by_link` |
451
452### Module Intercept
453
454Addons can act as full page modules by defining:
455
456```php
457function <addon>_module() {} // signals module capability
458function <addon>_content(App $a) {} // returns HTML
459```
460
461### Notable Addons
462
463- **Cross-posting**: bluesky, tumblr, diaspora, discourse, wppost,
464 ljpost, dwpost
465- **Storage**: s3_storage, webdav_storage
466- **Auth**: ldapauth, saml, keycloakpassword
467- **Privacy**: securemail (GPG-encrypted notifications)
468- **Filters**: advancedcontentfilter, langfilter, nsfw, superblock
469
470---
471
472## 12. Installation and Deployment
473
474### Methods
475
4761. **Git clone**: `git clone -b stable` + `composer install --no-dev` +
477 web installer
4782. **CLI**: `bin/console autoinstall` with config file or env vars
4793. **Docker**: `docker pull friendica` (official image)
4804. **YunoHost**: app package available
481
482### Critical Requirements
483
484- Cron every 5-10 minutes: `bin/worker.php` (or daemon mode)
485- HTTPS/TLS mandatory
486- Must be at top-level domain or subdomain (not directory path) for
487 Diaspora federation
488- Domain **cannot be changed** after installation
489
490### Scaling
491
492- Nginx preferred over Apache (~2x capacity)
493- Database tuning via mysqltuner.pl
494- PHP-FPM for faster processing
495- Configurable worker queue parallelism (default 10)
496- Extended poller intervals (30-60 min) for large instances
497
498---
499
500## 13. Federation Interoperability
501
502### Friendica as Protocol Bridge
503
504Friendica's unique value is connecting users across protocol boundaries:
505
506```
507Mastodon user ←─ActivityPub─→ Friendica ←─Diaspora protocol─→ Diaspora pod
508 ↕
509 DFRN native
510 ↕
511 Bluesky (addon)
512 ↕
513 RSS/Atom/Email/Tumblr
514```
515
516A Friendica user can follow a Mastodon account, a Diaspora contact, a
517Bluesky account, and an RSS feed — all in the same timeline.
518
519### vs. Mastodon
520
521| Feature | Friendica | Mastodon |
522|---------|-----------|----------|
523| Post length | 200,000 chars | 500 chars |
524| Protocols | AP + Diaspora + DFRN + addons | AP only |
525| Contact groups | Circles with ACLs | Lists (no ACLs) |
526| RSS reader | Built-in | No |
527| Photo albums | Yes | No |
528| Events/calendar | Yes | No |
529| Quote posts | Yes (early pioneer) | Added later |
530| Forums | Yes (public + private) | No |
531| BBCode | Yes | No |
532
533### Known Issues
534
535- Friendica's rich content (BBCode formatting, long posts) may be
536 truncated or stripped by Mastodon's HTML filtering
537- Privacy ACLs only enforceable within Friendica — remote servers
538 control their own display
539- Private photos only reliable between Friendica members
540- Comment counts may be inaccurate on remote instances due to
541 incomplete thread federation
542
543---
544
545## 14. Governance and Community
546
547- **No corporation, foundation, or board** — informal volunteer governance
548- **Core maintainers**: Tobias Diekershoff (FSFE), Michael Vogel
549- **Communication**: Friendica forums (dogfooding the platform)
550- **Code**: GitHub + self-hosted Gitea at git.friendi.ca
551- **Mascot**: Flaxy O'Hare (rabbit, CC0)
552- **Release cadence**: quarterly stable releases, year.month versioning
553- **No direct donations accepted** — covers server costs only
554
555---
556
557## 15. Common Implementation Mistakes
558
559- **Assuming Friendica only speaks ActivityPub**: Friendica may deliver
560 content via DFRN or Diaspora protocol depending on the contact type —
561 inspect the contact's protocol, not just the server software
562- **Not handling long posts**: Friendica posts can be up to 200,000
563 characters — truncate gracefully rather than rejecting
564- **Ignoring BBCode in content**: Friendica's native format is BBCode,
565 converted to HTML for ActivityPub — the HTML may contain richer
566 formatting than typical Mastodon posts
567- **Expecting Mastodon API parity**: Friendica's Mastodon API has gaps
568 (no streaming, no admin API, no poll voting) — test against a real
569 Friendica instance
570- **Not supporting the `Application` instance actor**: Friendica uses an
571 instance-level actor for some federation tasks — verify keys from
572 `Application` actors, not just `Person`
573- **Dropping unknown properties**: Friendica posts may include properties
574 from DFRN or Diaspora context — ignore unknown properties rather than
575 rejecting the entire object
576- **Assuming public-by-default**: Friendica defaults to private posts
577 (admin-configurable) — a Friendica instance may send fewer public
578 posts than expected