rivervanrain/activitypub
Composer 安装命令:
composer require rivervanrain/activitypub
包简介
ActivityPub integration for Elgg
关键字:
README 文档
README
ActivityPub integration for Elgg
About
Implements the ActivityPub protocol 1, 2, 3 for your Elgg app, allowing members to communicate with each other. Users will be able to follow content on Mastodon and other federated platforms that support ActivityPub.
With the ActivityPub plugin installed, your Elgg app itself function as a federated server in Fediverse 1, 2, along with profiles for each user and/or group.
For instance, if your Elgg app is app.url, then the app-wide profile can be found at @app.url@app.url, and users like Jane and Bob would have their individual profiles at @jane@app.url and @bob@app.url, respectively.
Inspired by ActivityPub Drupal plugin by Kristof De Jaeger aka swentel and Minds ActivityPub
Features
- Allow users to enable ActivityPub for their account
- Enable ActivityPub for Groups
- Allow or block domains from posting to inbox globally and/or per user/group
- Outbox, Inbox, Followers, Following and Liked endpoints
- Map Activity types and properties to content types and create posts to send out to the Fediverse
- Discovery via WebFinger for locating app, user and group profiles
- Signature verification for incoming activities
- Integration with the IndieWeb plugin
Supported Activity types
... more to come
Supported Actor types
... more to come
Supported Object types
... more to come
Supported Link types
The plugin has been tested with the following federated platforms:
- Diaspora
- Drupal
- Elgg
- Friendica
- Lemmy
- Mastodon
- Misskey
- Mitra
- Pixelfed
- Pleroma
- Smithereen
- WordPress
- Write as
Open an issue if you have successfully interacted with another platform.
Requirements Elgg plugins
You need to activate the following bundled Elgg plugins:
- Friends
- Groups: for enabling ActivityPub for Groups
- Messages and Site notifications: for sending and receiving the direct messages via Fediverse
Suggested Elgg plugins
- Event manager to enable
EventandPlaceobject types - The Wire tools to allow post and reshare via Groups
Installation
- You must have the required Elgg version installed.
Note: Don't forget to setup cron!
- Update server configurations:
For Apache
Change this rule in .htaccess:
RewriteRule "^.well-known/" - [L]
On these rules:
RewriteCond %{REQUEST_URI} !^/\.well-known/(webfinger|nodeinfo|x-nodeinfo2)
RewriteCond %{REQUEST_URI} ^/\. [NC]
For Nginx
Add these rules at the end of your config:
location = /.well-known/webfinger {
try_files $uri @elgg;
}
location = /.well-known/nodeinfo {
try_files $uri @elgg;
}
location = /.well-known/x-nodeinfo2 {
try_files $uri @elgg;
}
location ~ (^\.|/\.) {
deny all;
}
See examples in the /install/config folder of this plugin.
- Activate
ActivityPubplugin on the/admin/pluginspage.
Configure plugin
Basic config
Go to the plugin's settings /admin/plugin_settings/activitypub
Configure permissions:
- Allow users to enable ActivityPub for their account for authenticated user
- Enable ActivityPub for Groups for groups
- Allow users to resolve remote activities and actors to search remote accounts and posts in Fediverse
At this point, when a user has enabled ActivityPub at /settings/plugins/username/activitypub, they should be discoverable.
Test enabled ActivityPub by user on Elgg:
- Try searching for
@username@yourapp.urlon Mastodon. - Use Webfinger:
http://yourapp.url/.well-known/webfinger?resource=acct:username@yourapp.url
If you follow this user, Follow activity will arrive in the inbox and an Accept outbox activity will be created automatically.
Configure global settings to select how to process ActivityPub activities:
- Outbox: enable/disable Send activities
- Inbox: enable/disable Process incoming
This way you can configure your Elgg app as Client-to-Server or Server-to-Server interaction.
Control domains:
- Allow Globally whitelisted domains to send requests to your app
- Block Globally blocked domains from sending requests to your app
Server parameters:
Configure your ActivityPub instance.
Read documentation to learn more about Server instance configuration.
Types
On /admin/activitypub/types you get an overview of all ActivityPub types configuration entities.
Core types are enabled when enabling the bundled Elgg plugin and have locked ActivityPub types.
Dynamic types are not enabled yet since this depends on your setup.
Public and Private keys
Public and private keys are saved in /data/1/1/activitypub/keys/,
where data is your Elgg data folder.
Caching
For incoming or outgoing requests, images needs to be fetched to get the Inbox endpoint for example.
This is saved in /data/activitypub/cache/,
where data is your Elgg data folder.
Logs
Enable logs in Development section at /admin/plugin_settings/activitypub to check how the plugin works.
Logs are saved in /data/activitypub/log/,
where data is your Elgg data folder.
Inbox and outbox
Every user and group has an inbox and outbox where activities from remote users are stored and outgoing posts to your followers, unless it's an unlisted or private post.
Administrators can control all ActivityPub activities on /admin/activitypub/activities page.
Support
rivervanrain/activitypub 适用场景与选型建议
rivervanrain/activitypub 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1 次下载、GitHub Stars 达 12, 最近一次更新时间为 2025 年 03 月 10 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「activitypub」 「fediverse」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 rivervanrain/activitypub 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 rivervanrain/activitypub 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 rivervanrain/activitypub 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Temporary package which contains a fork of https://github.com/landrok/activitypub with changes for the Drupal AP module.
Open and ethical photo sharing platform, powered by ActivityPub federation.
Pixelfed PHP SDK
A package to enable Activitypub in Laravel
A Kirby CMS plugin to embed PeerTube videos using a simple KirbyTag. Supports autoplay, custom start/end times, and works with any PeerTube instance.
Fork of `landrok/activitypub` @ https://github.com/landrok/activitypub
统计信息
- 总下载量: 1
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 12
- 点击次数: 26
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: AGPL-3.0-or-later
- 更新时间: 2025-03-10