PHPackages                             lucamauri/activitywiki - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. lucamauri/activitywiki

ActiveMediawiki-extension[API Development](/categories/api)

lucamauri/activitywiki
======================

ActivityPub support for MediaWiki - Integrate your MediaWiki instance with the Fediverse via ActivityPub.

101[1 PRs](https://github.com/lucamauri/ActivityWiki/pulls)PHP

Since Jan 8Pushed 4mo agoCompare

[ Source](https://github.com/lucamauri/ActivityWiki)[ Packagist](https://packagist.org/packages/lucamauri/activitywiki)[ RSS](/packages/lucamauri-activitywiki/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

ActivityWiki
============

[](#activitywiki)

Integrate your MediaWiki instance with the Fediverse via ActivityPub.

Overview
--------

[](#overview)

ActivityWiki is a MediaWiki extension that enables wiki instances to participate in the Fediverse by implementing the ActivityPub protocol. This allows:

- **Share wiki activity**: Article creation and modifications are broadcast to the Fediverse
- **User attribution**: Track which user made edits and attribute contributions accurately
- **Discoverability**: Make your wiki discoverable to Mastodon, Pixelfed, and other ActivityPub-compatible platforms
- **Federation**: Connect your wiki with other federated services

Features
--------

[](#features)

### Current (Phase 1)

[](#current-phase-1)

- ✅ Wiki actor profile (ActivityPub compatible)
- ✅ Activity creation for page edits (Create/Update)
- ✅ REST API endpoints for ActivityPub discovery
- ✅ Activity logging and storage
- ✅ Configuration management

### Planned (Phase 2+)

[](#planned-phase-2)

- 🔄 HTTP signature delivery to follower inboxes
- 🔄 Receive Follow/Unfollow requests
- 🔄 Per-user ActivityPub actor profiles
- 🔄 Inbox endpoint for incoming activities

Requirements
------------

[](#requirements)

- MediaWiki 1.35 or later
- PHP 7.2 or later
- Database: MySQL/MariaDB or PostgreSQL
- HTTP access to external Fediverse servers (for Phase 2+)

Installation
------------

[](#installation)

### 1. Clone the extension

[](#1-clone-the-extension)

```
cd /path/to/your/mediawiki/extensions
git clone https://github.com/lucamauri/ActivityWiki.git ActivityWiki
cd ActivityWiki
```

### 2. Add to LocalSettings.php

[](#2-add-to-localsettingsphp)

```
// Enable ActivityWiki extension
wfLoadExtension( 'ActivityWiki' );

// Configuration (optional)
$wgActivityPubEnabled = true;
$wgActivityPubActorName = 'MyWiki';  // Display name in Fediverse
$wgActivityPubEnableUserActors = false;  // Per-user actors (Phase 3)
```

### 3. Run database setup

[](#3-run-database-setup)

```
php maintenance/run.php update.php
```

This creates the necessary database tables.

### 4. Verify installation

[](#4-verify-installation)

Visit: `https://your-wiki.example.com/api/rest_v1/activitypub/actor`

You should see a JSON ActivityPub actor profile.

Configuration
-------------

[](#configuration)

### Basic Settings (LocalSettings.php)

[](#basic-settings-localsettingsphp)

```
// Enable/disable the extension
$wgActivityPubEnabled = true;

// How the wiki appears in the Fediverse
$wgActivityPubActorName = 'My Wiki';

// Optional: Enable per-user ActivityPub actors
$wgActivityPubEnableUserActors = false;

// Optional: Exclude certain namespaces from federation
$wgActivityPubExcludedNamespaces = [ NS_TEMPLATE, NS_CATEGORY ];

// Optional: Exclude bot edits from ActivityPub feed
$wgActivityPubExcludeBots = true;

// Optional: Exclude minor edits
$wgActivityPubExcludeMinor = false;
```

API Endpoints
-------------

[](#api-endpoints)

Once installed, the following ActivityPub endpoints become available:

### Actor Profile

[](#actor-profile)

```
GET /api/rest_v1/activitypub/actor

```

Returns the wiki's ActivityPub actor profile (Service type).

**Response:**

```
{
  "@context": "https://www.w3.org/ns/activitystreams",
  "id": "https://your-wiki.example.com/api/rest_v1/activitypub/actor",
  "type": "Service",
  "name": "My Wiki",
  "preferredUsername": "mywiki",
  "inbox": "https://your-wiki.example.com/api/rest_v1/activitypub/inbox",
  "outbox": "https://your-wiki.example.com/api/rest_v1/activitypub/outbox",
  "followers": "https://your-wiki.example.com/api/rest_v1/activitypub/followers",
  "publicKey": { ... },
  "summary": "The My Wiki wiki"
}
```

### Activity Outbox

[](#activity-outbox)

```
GET /api/rest_v1/activitypub/outbox?limit=10&page=1

```

Returns paginated list of activities (Create/Update).

### Followers

[](#followers)

```
GET /api/rest_v1/activitypub/followers

```

Returns list of Fediverse accounts following your wiki.

Usage
-----

[](#usage)

### Following Your Wiki

[](#following-your-wiki)

1. Open your Fediverse client (Mastodon, Pixelfed, etc.)
2. Search for: `@yourwikiname@your-wiki.example.com`
3. Click Follow
4. When users edit articles, activities appear in your Fediverse feed

### Example Activity

[](#example-activity)

When a user edits an article, an Activity is created:

```
{
  "@context": "https://www.w3.org/ns/activitystreams",
  "type": "Create",
  "actor": "https://your-wiki.example.com/api/rest_v1/activitypub/actor",
  "object": {
    "type": "Article",
    "name": "Example Article",
    "url": "https://your-wiki.example.com/wiki/Example_Article",
    "content": "Article content...",
    "attributedTo": "https://your-wiki.example.com/api/rest_v1/activitypub/actor"
  },
  "published": "2025-12-08T22:17:00Z"
}
```

Development
-----------

[](#development)

### Repository Structure

[](#repository-structure)

```
ActivityWiki/
├── extension.json           # Extension metadata
├── README.md               # This file
├── includes/
│   ├── Hooks.php           # MediaWiki hook handlers
│   ├── ActivityBuilder.php  # Build ActivityPub JSON
│   ├── DeliveryQueue.php    # Queue activities
│   ├── Api/
│   │   └── ActivityPubModule.php  # REST endpoints
│   └── Jobs/
│       └── DeliveryJob.php  # Async delivery job
├── db/
│   └── tables.sql          # Database schema
└── tests/
    └── phpunit/            # Unit tests

```

### Running Tests

[](#running-tests)

```
cd /path/to/mediawiki
php tests/phpunit/phpunit.php extensions/ActivityWiki/tests
```

### Code Style

[](#code-style)

This extension follows MediaWiki coding standards:

- PSR-12 for PHP
- 4-space indentation
- No trailing whitespace

### Contributing

[](#contributing)

We welcome contributions! Please:

1. Fork the repository
2. Create a feature branch (`git checkout -b feature/my-feature`)
3. Commit changes (`git commit -m 'Add my feature'`)
4. Push to the branch (`git push origin feature/my-feature`)
5. Open a Pull Request

Please ensure:

- Code follows MediaWiki standards
- Tests pass
- Commits are descriptive

See [CONTRIBUTING.md](CONTRIBUTING.md) for detailed guidelines.

Roadmap
-------

[](#roadmap)

### Phase 1: Activity Broadcasting (Current)

[](#phase-1-activity-broadcasting-current)

- Hook into page saves
- Build ActivityPub activities
- Store activities in database
- Expose REST API endpoints
- Testing on real wiki

### Phase 2: HTTP Delivery

[](#phase-2-http-delivery)

- HTTP signature implementation
- POST activities to follower inboxes
- Retry logic for failed deliveries
- Request queuing and rate limiting

### Phase 3: Per-User Actors

[](#phase-3-per-user-actors)

- User profile endpoints
- Per-user activity attribution
- User preferences for federation

### Phase 4: Inbox &amp; Interactions

[](#phase-4-inbox--interactions)

- POST /inbox endpoint
- Handle Follow/Unfollow requests
- Track followers
- (Future: Handle replies, likes, etc.)

Security Considerations
-----------------------

[](#security-considerations)

- **HTTP Signatures**: Phase 2 will implement RFC 8017 to sign outgoing requests
- **Content Sanitization**: Page content is sanitized before inclusion in activities
- **Rate Limiting**: Configuration options prevent spamming followers
- **Private Key Storage**: Private keys stored securely in LocalSettings.php
- **Access Control**: Only public wiki content is federated

Troubleshooting
---------------

[](#troubleshooting)

### Activities not appearing in the Fediverse

[](#activities-not-appearing-in-the-fediverse)

1. Verify the extension is enabled:

    ```
    curl https://your-wiki.example.com/api/rest_v1/activitypub/actor
    ```

    Should return actor JSON, not 404.
2. Check MediaWiki error logs:

    ```
    tail -f /path/to/mediawiki/logs/debug.log | grep -i activitypub
    ```
3. Verify REST API is enabled in LocalSettings.php:

    ```
    $wgEnableRestAPI = true;
    ```

### "No public key found"

[](#no-public-key-found)

1. Generate key pair (will be automatic in v0.2)
2. Verify keys are in database

License
-------

[](#license)

GPL-3.0-or-later

This extension is licensed under the GNU General Public License v3.0 or later. See LICENSE file for details.

Support
-------

[](#support)

- **Issues**: Report bugs on [GitHub Issues](https://github.com/lucamauri/ActivityWiki/issues)
- **Discussions**: Ask questions on [GitHub Discussions](https://github.com/lucamauri/ActivityWiki/discussions)
- **Documentation**: Full docs at [mediawiki.org](https://www.mediawiki.org/wiki/Extension:ActivityWiki)

References
----------

[](#references)

- [ActivityPub Specification](https://www.w3.org/TR/activitypub/)
- [MediaWiki Extension Development](https://www.mediawiki.org/wiki/Manual:Developing_extensions)
- [Fediverse Overview](https://en.wikipedia.org/wiki/Fediverse)

Acknowledgments
---------------

[](#acknowledgments)

Inspired by XWiki's ActivityPub implementation and the need for federation in wiki communities.

---

**Created for WikiTrek and the broader MediaWiki community.**

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance52

Moderate activity, may be stable

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity12

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/dd8777d6a2cb6716bb24cef15643edf8f463a9ff9de1c3c7efeda0f1111cf342?d=identicon)[lucamauri](/maintainers/lucamauri)

---

Top Contributors

[![lucamauri](https://avatars.githubusercontent.com/u/433582?v=4)](https://github.com/lucamauri "lucamauri (18 commits)")

### Embed Badge

![Health badge](/badges/lucamauri-activitywiki/health.svg)

```
[![Health](https://phpackages.com/badges/lucamauri-activitywiki/health.svg)](https://phpackages.com/packages/lucamauri-activitywiki)
```

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[facebook/php-business-sdk

PHP SDK for Facebook Business

90821.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

74513.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

265103.1M454](/packages/google-gax)[google/common-protos

Google API Common Protos for PHP

173103.7M50](/packages/google-common-protos)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
