Create a Mastodon bot to forward Twitter and RSS feeds to your timeline. Inspired by this Platypush blog post.
Recommended deployment: on containers (use Docker Compose or Kubernetes) running on a Raspberry Pi.
See NOTES.md for an important disclaimer when using Kubernetes.
To set up Raspberry Pi, Docker, and Kubernetes see this guide.
-
Grab the code.
git clone https://github.com/santisbon/mastodonbot.git && cd mastodonbot
-
Configure the app.
- Edit
config.yaml
to set your Mastodonbase_url
,access_token
, andsubscriptions
. - For Docker Compose:
Editcompose.yaml
to set the correctplatform
for your hardware.
Inconfig.yaml
make sure the Redishost
matches the cache servicehostname
from thecompose.yaml
file. - For Kubernetes:
Inconfig.yaml
make sure the Redishost
islocalhost
as both containers (app and cache) are in the same pod.
Build the app image for your target architecture and push it to a private registry. Example:
docker build -f Dockerfile-app -t localhost:32000/mastodonbot --platform linux/arm64 . docker push localhost:32000/mastodonbot
- Edit
-
To start or stop the bot:
- With Docker Compose
docker compose -p mastodon-bot-project up --detach docker compose -p mastodon-bot-project down
- With Kubernetes (if using microk8s type
microk8s kubectl
)
kubectl create namespace botspace kubectl apply -f kubernetes-sc.yaml kubectl apply -f kubernetes-pv.yaml kubectl apply -f kubernetes-namespace.yaml -n botspace # apply or delete