1
0
Fork
You've already forked fediverse-server
0
A persistent ActivityPub server that uses the apkit library
Python 100%
2025年10月21日 17:43:51 +02:00
.gitignore Initial commit 2025年10月21日 12:28:42 +02:00
LICENSE Initial commit 2025年10月21日 12:27:18 +02:00
models.py extract database models into separate file 2025年10月21日 17:43:51 +02:00
poetry.lock update apkit to version 0.3.3 2025年10月21日 17:42:44 +02:00
pyproject.toml update apkit to version 0.3.3 2025年10月21日 17:42:44 +02:00
README.md Initial commit 2025年10月21日 12:28:42 +02:00
server.py extract database models into separate file 2025年10月21日 17:43:51 +02:00

fediverse-server

A persistent ActivityPub server that uses the apkit library.

The server has two sides:

  1. the one facing the Fediverse that speaks ActivityPub
  2. an internal API to send status messages and retrieve information

Connection to the internet

You need a TLS endpoint to make the server visible on the internet. I use the Caddy webserver on a VPS for that. Let's assume the server is available at https://fedi.example.com

Set an environment variable with that domain name:

export APKIT_DOMAIN=fedi.example.com

Local testing

For testing purpouses you can also use ngrok expose it on the internet:

ngrok http 8000

ngrok will show you an address like https://846e26f1e1ee.ngrok-free.app that can be used to access your server from the internet.

Set an environment variable with that domain name:

export APKIT_DOMAIN=846e26f1e1ee.ngrok-free.app 

Run the server

If you have poetry on your system you can simple run

poetry install # needed only the first time
poetry run uvicorn --host=0.0.0.0 server:app

Without poetry

If you do not use poetry you can manually install the required libraries in a virtual environment:

python -m venv .venv
. .venv/bin/activate
pip install fastapi uvicorn sqlalchemy apkit[server]
uvicorn --host=0.0.0.0 server:app

Using the server

The server will display it's Fediverse user name (currently starting with demo). You can interact with this account from the Fediverse.

Local API

You can send a status message to all your followers by POSTing to http://localhost:8000/api/status like this:

curl -XPOST -d 'Hello, world!' http://localhost:8000/api/status

This message will be send to all accounts that follow your account.