This project provides a framework to test ActivityPub implementations by allowing users to copy a test account to their server, perform various operations, and retrieve test data for verification.
This tool is especially useful for developers looking to ensure compatibility with the ActivityPub protocol.
- Implement a Reference ActivityPub Account: Create a standardized ActivityPub test account that others can replicate on their own servers.
- Enable Data Comparison: Script functionality to pull test data back from a server and analyze it, highlighting differences or errors to assist developers in refining their ActivityPub implementations.
- Test Account Creation: Provides a ready-made ActivityPub-compatible account that can be replicated on external servers.
- Data Comparison Tool: Automated scripts to retrieve ActivityPub data from other servers and compare it against the expected data, logging any discrepancies.
- Endpoint Verification: Check whether common ActivityPub endpoints (e.g., /inbox, /outbox) behave as expected.
-
Clone the repository:
git clone https://github.com/yourusername/activitypub-testbed.git cd activitypub-testbed
-
Create and activate a virtual environment:
python -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
-
Install the dependencies:
pip install -r requirements.txt
-
Set up the environment variables:
cp .env-example .env # Edit .env file to set your environment variables
-
Run the database migrations:
python manage.py migrate
-
Seed the database with sample data:
python manage.py seed # This will prompt you if you want to create an admin account.
-
Run the development server:
python manage.py runserver
To run the tests, use the following command:
pytest
We use pre-commit to automatically lint and format code before each commit, ensuring code quality and consistency.
-
Install the pre-commit hook
This sets up Git hooks in your local repo:pre-commit install
-
You're all set!
Now, every time you commit,pre-commit
will automatically run checks (likeruff
) on staged files.
To run all hooks on all files manually:
pre-commit run --all-files
This is useful for checking your work before pushing large changes.
During local development, emails printed in the server output and not actually sent, including verification link emails. In production, you will need to pass EMAIL_HOST_USER
and EMAIL_HOST_PASSWORD
with valid Gmail credentials, where EMAIL_HOST_USER
is the email address to send mail from, and EMAIL_HOST_PASSWORD
is an app password for that account.
This project is licensed under the Apache License 2.0.