1.9 KiB
1.9 KiB
HackerNews -> Mastodon Bridge
This repo contains config to consume the HackerNews RSS feed (https://news.ycombinator.com/rss) and to toot the messages to https://mastodon.pub.solar/@hackernews_bot, a mastodon bot.
The dockerfile builds a container that uses feed2toot. All stateful data is expected to be mounted under /data
, namely:
feed2toot.ini
: config file in this repofeed2toot_clientcred.txt
: fromregister_feed2toot_app
scriptfeed2toot_usercred.txt
: fromregister_feed2toot_app
scriptfeed2toot_cache.db
: cache file to register previous posts
Docker image was built like this and pushed to registry:
docker build -t registry.greenbaum.cloud/library/mastodon-hackernews-feed2toot:0.0.1 .
docker push registry.greenbaum.cloud/library/mastodon-hackernews-feed2toot:0.0.1
Initial deployment, just for documentation, don't run this for updates:
# Run the steps from Deployment of updates section
# After initial deployment, copy secrets and cache file to volume mounted on /data
❯ find . -name 'feed2toot*' -type f
./feed2toot.ini
./secrets/feed2toot_clientcred.txt
./secrets/feed2toot_cache.db
./secrets/feed2toot_usercred.txt
❯ for FILE in $(find . -name 'feed2toot*' -type f -printf "%f\n"); \
do \
docker cp ./secrets/$FILE bot_mastodon-hackernews-feed2toot_1:/data/$FILE; \
done
❯ docker cp ./feed2toot.ini bot_mastodon-hackernews-feed2toot_1:/data/feed2toot.ini
# Uncomment external option of volume
Deployment of updates:
- Get tritonshell
- Enter
tritonshell
for DCcgn-1
cd tritonshell
nix develop --command $SHELL
eval "$(triton env cgn-1-pub_solar)"
cd ..
# Optional
# Check for running container
docker ps -a | grep mastodon-hackernews-feed2toot
- Update running container to a new version
docker-compose --project-name bot up --detach