Skip to content

santisbon/mastodonbot

Repository files navigation

Mastodon bot

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.


Instructions

  1. Grab the code.

    git clone https://github.com/santisbon/mastodonbot.git && cd mastodonbot
  2. Configure the app.

    • Edit config.yaml to set your Mastodon base_url, access_token, and subscriptions.
    • For Docker Compose:
      Edit compose.yaml to set the correct platform for your hardware.
      In config.yaml make sure the Redis host matches the cache service hostname from the compose.yaml file.
    • For Kubernetes:
      In config.yaml make sure the Redis host is localhost 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
  3. 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

About

Bot to publish Twitter and RSS feeds to Mastodon.

Resources

License

Stars

Watchers

Forks

Languages