This script initialy comes from www.bentasker.co.uk
Some changes have been made in order to use YAML instead of JSON for the feed list, and the feed listing now allows to pass some more data, such as "sensitive" for content-warning tag (which would apply to the whole feed), and custom, static tags.
The following parameters are supported, and should passed as environment variables.
Set the hash directory. String. Defaults to /hashdir
Display entry author or not. Boolean. Defaults to True
For feed using tags, allows to switch the "content warning" flag for the post entry if this
CW_TAG is set. String. Defaults to content-warning
Set the Mastodon instance URL. String. Defaults to https://mastodon.social
Set the mastodon authentication token. String. Mandatory.
Set the visibility of the content. String. Defaults to public
Toggle mode - if yet to Y
will not actually send data to mastodon, but output what would
have been sent. Char. Defaults to N
For feed using tags, allow to not show the specified tags. Coma separated value.
Sets the maximal amount of entries to show. Integer. Defaults to 10
buildah bud --format docker -f Dockerfile -t mastobot:latest .
mkdir -p hashdir
podman run --rm \
-e MASTODON_TOKEN="<token>" \
-e MASTODON_URL="https://mastodon.bentasker.co.uk" \
-v $PWD/feeds.yaml:/app/feeds.yaml:Z,ro \
-v $PWD/hashdir:/hashdir:Z \
-e DRY_RUN="Y" \
mastobot:latest
mkdir -p hashdir
podman run --rm \
-e MASTODON_TOKEN="<token>" \
-e MASTODON_URL="https://mastodon.bentasker.co.uk" \
-v $PWD/feeds.yaml:/app/feeds.yaml:Z,ro \
-v $PWD/hashdir:/hashdir:Z \
-e DRY_RUN="N" \
mastobot:latest
If you're running as a standard user, in your home directory, you may face some SELinux denials. In order to sort this out, you can pass the following option to podman:
--security-opt label=disable
Also, if you want to run multiple bots using the same hashdir (not a good idea, but..), you will
need to modify the command and replace the Z
by a z
on the volume.