Missing replies in Mastodon
While using mastodon I noticed that a lot of post that I get reposted from other accounts doesn't have replies. I thought that it was weird, because when I open those posts in their original instance I can see a lot of replies.
This is a problem because I use Mastodon daily and I feel like I am missing on a lot of content because of this issue.
Googling a little bit I found this discussion pointing out that this is the expected behavior as your server is just not receiving this responses.
This is a problem only for small Mastodon instances. In my cause I run my own instance only for me, so it is the worse case scenario. This problem happens for every Fediverse server software from what I can see. It would be nice if Mastodon could fetch replies when you click in the post itself. I don't know if this is technically possible of if this feature is already present in any of the multiple Mastodon forks.
In the same discussion there is someone who wrote a Python script to fetch missing replies in your instance called FediFetcher. You can use it with Github actions or with a simple cron job. I prefer to not rely on external services, so I will try to use it as cron job.
In my home lab I am running Mastodon inside of docker with docker compose, so my preference is to run FediFetcher inside a docker container, so I don't have to install all the Python dependencies in my host computer.
In this case is simple, as there is an already available docker image that can be used.
The script also outputs some information, so I also map one local folder to the container. In my home lab everything related to docker is located in /media/docker
, so I created a fedi-fetcher folder where I created:
- Script with the command to be executed in cron. I don't want to have all the parameters and secrets in my cronfile. They even have an example script for this case.
- Folder that will be mapped to the container so the output is persisted and I can see it.
This is the script I created:
#!/usr/bin/env bash
docker run --rm -v /media/docker/fedi-fetcher/artifacts:/app/artifacts ghcr.io/nanos/fedifetcher:latest --access-token=<TOKEN> --server=mastodon.albertoluna.es --home-timeline-length=200 --max-followings=80 --from-notifications=1 --http-timeout=30 --lock-hours=1
I added --rm
to discard the container as soon as it finishes. Without this flag every time the script is executed the temporary container would remain in docker stopped.
Then I modified my cronfile so it is executed every 10 minutes adding this line:
*/10 * * * * /usr/bin/bash /media/docker/fedi-fetcher/run.sh
- Previous: Automating blog publishing