Skip to main content

Middleware for the Fediverse

Project description

cattle_grid

cattle_grid handles a few common tasks that plague Fediverse applications:

  • Maintaining an actor document and associated endpoints like inbox
  • Verifying HTTP signatures
  • Determine if somebody is authorized to view something or not
  • Manage follower collections

Furthermore with its muck_out extension it handles parsing ActivityPub objects.

cattle_grid relies on faststream and then RabbitMQ for message processing. If you want to use cattle_grid, you will be faced with using message queues.

cattle_grid has an internal account system.

Related links

Applications using cattle_grid

  • comments allows one to add comments to a static site
  • fedi-herds allows list management
  • roboherd allows one to build automatic posting bots (these have no frontend)

Related projects / utilities

  • almabtrieb implements one of the Client protocols used by cattle_grid
  • console provides a light weight frontend.

Development

Testing

You can run the pytest tests via

uv run pytest

or in watch mode

uv run ptw .

Running behave tests

Build the container via

./update_docker.sh

This script uses the requirements from pyproject.toml via uv export to install python dependencies in the container. This means this script needs to be rerun, if you make changes to the dependencies. Startup the docker environment via

docker compose up

Open a runner container

docker compose run --rm --name runner cattle_grid_app /bin/sh

Inside this container, you now run

fediverse-features
behave

The first step downloads some features from fediverse-features and the second step runs the test suite.

Building end 2 end reports (as done by CI)

The process to build the end to end reports is described here. The reports should be published to this repository and then made available here.

Running as stand alone

Create a requirements.txt file and start a virgin docker container

uv export --no-editable --no-emit-project --no-hashes --no-dev > requirements.txt
docker run --rm -ti -p 8000:8000\
    -v ./cattle_grid:/app/cattle_grid\
    -v ./requirements.txt:/app/requirements.txt \
    --workdir /app\
    helgekr/bovine:python3.13 /bin/sh

Once inside the docker container install dependencies

pip intall -r requirements.txt

and run cattle_grid via

uvicorn cattle_grid:create_app --factory --host 0.0.0.0

This currently fails.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cattle_grid-0.5.20.tar.gz (472.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cattle_grid-0.5.20-py3-none-any.whl (253.3 kB view details)

Uploaded Python 3

File details

Details for the file cattle_grid-0.5.20.tar.gz.

File metadata

  • Download URL: cattle_grid-0.5.20.tar.gz
  • Upload date:
  • Size: 472.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.11 {"installer":{"name":"uv","version":"0.9.11"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Alpine Linux","version":"3.22.2","id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for cattle_grid-0.5.20.tar.gz
Algorithm Hash digest
SHA256 a3c8bfe0c01fc443c788ce1f7b6faa4f8724a8d04bb5d9cc95f75d632c2adc3b
MD5 f92382cf94276972765c6a1206987044
BLAKE2b-256 e67bdf53c99c589c80f7f4d751c3c9c548e93646eceb1b52b1ff006f67b1ce02

See more details on using hashes here.

File details

Details for the file cattle_grid-0.5.20-py3-none-any.whl.

File metadata

  • Download URL: cattle_grid-0.5.20-py3-none-any.whl
  • Upload date:
  • Size: 253.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.11 {"installer":{"name":"uv","version":"0.9.11"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Alpine Linux","version":"3.22.2","id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for cattle_grid-0.5.20-py3-none-any.whl
Algorithm Hash digest
SHA256 0201ca61a3c42578c08b1a7acddd662ee6611f54d3e265b69c5c522a6707af4b
MD5 6aadd2b0b566a30117d3af82df2d058e
BLAKE2b-256 0e2e729b4bbf457a635f84b3bae67ab4503078a872bb17ce97842038470fb5d4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page