Mechanical Bull
Mechanical Bull is an ActivityPub Client application build based on bovine. It's main goal is to provide a platform for automating activities undertaking in the FediVerse. Furthermore, it serves as a demonstration how ActivityPub Clients can be build with bovine.
Installation
One can simply install mechanical_bull with pip via
pip install mechanical-bull
Once can then add a new user by running
python -m mechanical_bull.add_user [--accept] name hostname
This will then prompt you to add a new did:key to your ActivityPub Actor. This did:key will be used to authenticate mechanical_bull against your server. Once you have added the key, press enter, and mechanical_bull is running. This method of authentication is called Moo-Auth-1 and described here.
The configuration is saved in config.toml. bovine also supports authentication through private keys and HTTP signatures. For the details on how to configure this, please consult bovine. You can add further automations there.
Then you should be able to run mechanical bull via
python -m mechanical_bull.run
Configuration
First by adding log_file = "mechanical_bull.log" to your config.toml you can make mechanical_bull write log entries to a file. Second, the config file has the following format
logfile = "mechanical_bull.log"
[cow]
private_key = "z3u2Yxcowsarethebestcowsarethebestcowsarethebest"
host = "cows.rocks"
[cow.handlers]
"mechanical_bull.actions.reject_follow_request" = true
# "mechanical_bull.actions.accept_follow_request" = true
"mechanical_bull.actions.log_to_file" = { filename = "cow.txt" }
The listed handlers are provided by mechanical_bull. They allow to accept / reject follow requests automatically, and the final one logs all traffic on the event source to "cow.txt".
Writing automations
The examples of mechanical_bull.actions.accept_follow_request and mechanical_bull.actions.log_to_file should show how to write a new automation. The basic idea is that each file contains a function handle with signature
async def handle(client: BovineClient, data: dict, **kwargs):
return
here the kwargs are the dict given by the definiton in the handler block, i.e.
[user.handlers]
"my.package" = { arg1 = "value1", arg2 = "value2 }
Contibuting
Please report bugs, etc. to the issue tracker. Contributings in the form of pull requests are welcome. You can also contact me on the FediVerse at @helge@mymath.rocks.
Finally, I plan a multi-user "server" version of this project called mechanical_herd. The functionality should be similar, but updating the configuration should not require a restart. One might also think hooking into the redis from bovine_pubsub for this. mechanical_herd will probably be part of the bovine user management interface.
Metadata
Release files for mechanical-bull 0.2.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| mechanical_bull-0.2.6.tar.gz | 12.2 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| mechanical_bull-0.2.6-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 24.0 kB
Release files / mechanical_bull-0.2.6.tar.gz
| Download URL | mechanical_bull-0.2.6.tar.gz |
|---|---|
| Size | 12.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
868f4a1c9656f8fab9e7c62620ac98a95af9ca752804e6c0a5a256f450c41733
|
|
BLAKE2b-256 checksum How to use checksums |
66f5bd630db64297a85005839c27fb4e1761b5fcdb923002bc19c1a67f8de611
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.4.2 CPython/3.11.3 Linux/6.1.0-0.deb11.6-amd64
|
Release files / mechanical_bull-0.2.6-py3-none-any.whl
| Download URL | mechanical_bull-0.2.6-py3-none-any.whl |
|---|---|
| Size | 11.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
032c2bdd380527836e82f93fd72f40cd87ce628db543c9db8b5e4dd67c52f1c8
|
|
BLAKE2b-256 checksum How to use checksums |
c3f5c9c2fe162ed75b623b605f834dfac5ecb93dd30f34759390bdec2867a5bc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.4.2 CPython/3.11.3 Linux/6.1.0-0.deb11.6-amd64
|
Security for mechanical-bull 0.2.6
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.