| app | ||
| apps | ||
| dist | ||
| static | ||
| system | ||
| LICENSE | ||
| README.md | ||
| requirements.txt | ||
appy
A lightweight server implementing the ActivityPub protocol in Python over fastAPI.Key Features
- Full support for the ActivityPub protocol (actors, activities, inbox, outbox, etc.).
- Compatible with federated platforms like Akkoma, Mastodon, Misskey and Pleroma
- Accesible via API only.
- HTTP Signatures support for secure communication.
Built With
Requirements
Dependencies
- Python: version 3.10 or later.
- Postgresql: running Postgresql server with a created role with LOGIN and CREATEDB privileges.
- Redis: running Redis server with requirepass enabled.
- ffmpeg: must be installed on the system and available in PATH
- Libraries:
FastAPIuvicornhttpxcryptographyasyncpg
Getting Started
Follow these steps to run the server locally:
- Clone the project repository to your local machine:
git clone https://codeberg.org/spla/appy.git
cd appy
- Create the Python Virtual Environment:
python3.x -m venv .
Don't forget the . at then end
- Activate it
Enable Python Environment:
source bin/activate
- Install the required Python libraries:
pip install -r requirements.txt
-
Copy dist/nginx.conf to
/etc/nginx/sites-available/<your_appy_domain>.confand edit it to change<example.net>to your domain. -
Enable it with:
ln -s /etc/nginx/sites-available/<your_appy_domain>.conf /etc/nginx/sites-enabled/<your_appy_domain>.conf
- Check if nginx like it:
nginx -t
-
Restart nginx.
-
Start the appy server with the following command:
python app/main.py
First time run will ask for needed parameters and will create your user profile. Later on, the server will be running locally at http://127.0.0.1:{configured_port}.
Updating
Update appy by issuing:
git pull origin main && git fetch --tags
Usage Example
Here’s how to interact with the server. Use any of the following apps to sign in:
iOS: Icecubes, Ivory, Mastodon (official), Mona, Tusker
Android: Fedilab, Mastodon (official), Moshidon, Pachli, Tusky
Self destruct (clean defederation)
python app/selfdestruct.py
Run selfdestruct if you decide to stop your appy server the clean way. selfdestruct erase your server from the federation by sending Delete activities to all known remote servers.
Architecture
The server is built to follow the standard ActivityPub flow: 1. An actor sends an activity via the outbox. 2. The server signs the activity with HTTP Signatures and dispatches it to the inboxes of other actors. 3. Recipient actors process the activity in their inbox.
A simplified diagram of the flow:
[Client] --> [Outbox] --> [HTTP Signatures] --> [Remote Inbox]
↑ ↓
[ActivityPub Actor] <-- [Inbox] <-- [HTTP Signature check] <-- [Remote Outbox]
Contributing
We welcome contributions to the project! To get started:
- Fork this repository.
- Create a new branch for your feature or fix:
git checkout -b feature/new-feature
- Make your changes and commit them with a clear message:
git commit -m "Add new feature"
- Push your branch:
git push origin feature/new-feature
- Submit a pull request.
Please ensure that your code follows the PEP 8 style guide.
License
This project is licensed under the GNU GENERAL PUBLIC LICENSE. See the LICENSE file for more details.
Additional Resources
Here are some resources to help you understand ActivityPub and related technologies:
• Official ActivityPub Documentation
• Mastodon's really great API docs
• FastAPI Documentation
• Understanding ActivityPub
Support
If you encounter any issues, feel free to open an issue or contact the project maintainer.