1
0
Fork
You've already forked appy
0
forked from spla/appy
a headless ActivityPub server written with Python and fastAPI.
  • Python 99.4%
  • HTML 0.5%
2025年02月03日 13:08:35 +01:00
app Fixed deleted activity 2025年02月03日 13:08:35 +01:00
dist Added nginx.conf 2024年06月22日 20:11:32 +02:00
static Added stats 2024年07月30日 17:41:28 +02:00
system Added default avatar 2024年11月14日 19:28:11 +01:00
LICENSE En desenvolupament 2023年11月29日 18:24:09 +01:00
README.md Creation of server admin user profile 2024年12月27日 20:55:09 +01:00
requirements.txt Switched database management to asyncpg 2024年12月19日 20:51:08 +01:00

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 Mastodon.
  • Accesible via API only.
  • HTTP Signatures support for secure communication.

Requirements

Dependencies

  • Python: Version 3.10 or later.
  • Postgresql: Running Postgresql server and created a role with LOGIN and CREATEDB privileges.
  • Redis: Running Redis server with requirepass enabled.
  • Libraries:
    • FastAPI
    • uvicorn
    • httpx
    • cryptography
    • asyncpg

Getting Started

Follow these steps to run the server locally:

  1. Clone the Repository
    Clone the project repository to your local machine:
git clone https://codeberg.org/spla/appy.git
cd repository-name
  1. Create Python Virtual Environment Create the Python Virtual Environment::
python3.x -m venv .

Don't forget the . at then end

  1. Activate it Enable Python Environment::
source bin/activate
  1. Install Dependencies Install the required Python libraries:
pip install -r requirements.txt
  1. Copy dist/nginx.conf to /etc/nginx/sites-available/<your_appy_domain>.conf and edit it to change <example.net> to your domain.

  2. Enable it with:

ln -s /etc/nginx/sites-available/<your_appy_domain>.conf /etc/nginx/sites-enabled/<your_appy_domain>.conf
  1. Check if nginx like it:
nginx -t
  1. Restart nginx.

  2. Run the Server
    Start the server with the following command:

python app/main.py --reload

First time run will ask for needed parameters and will create your user profile. Warning: server start will fail. Run it for a second time.The server will now be running locally at http://127.0.0.1:5010.

Usage Example

Here’s how to interact with the server. Use any of the following apps to sign in:

iOS: Mona, Tusker, Ivory
Android: Moshidon, Tusky

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:

  1. Fork this repository.
  2. Create a new branch for your feature or fix:
git checkout -b feature/new-feature
  1. Make your changes and commit them with a clear message:
git commit -m "Add new feature"
  1. Push your branch:
git push origin feature/new-feature
  1. 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.