nanos / FediFetcher

FediFetcher is a tool for Mastodon that automatically fetches missing replies and posts from other fediverse instances, and adds them to your own Mastodon instance.
https://blog.thms.uk/fedifetcher?utm_source=github
MIT License
296 stars 215 forks source link

Add Dockerfile and container build workflow #13

Closed nikdoof closed 1 year ago

nikdoof commented 1 year ago

I'm in the process of setting up this script to run within my Kubernetes Mastodon instance and needed it packaging up for ease of use. So I thought I'd contribute back the changes.

This adds the following

The script is provided as a entry point, so the container can be used with docker run containername --server=mastodon.social ....

nanos commented 1 year ago

That's pretty cool. Thanks so much!

Can you add a section on how to use this with Docker to the README please? I'm not familiar with docker, so can't do it myself.

Once that's added I'll very happily merge this PR.

nikdoof commented 1 year ago

@nanos Done, added a k8s example CronJob for running the container as well.

nanos commented 1 year ago

Amazing! Thank you so much!

nanos commented 1 year ago

Actually, I just realised a couple of issues after I merged:

nikdoof commented 1 year ago

The 404 will fix itself once the container has built (as it's the URL for the container view on Github, e.g. https://github.com/nikdoof/mastodon_get_replies/pkgs/container/mastodon_get_replies).

You can modify the 'on' section of the workflow to restrict its run, if you only want it on a tagged version then remove the branch: main bit.

As for the error on the first run, it may be that the repo doesn't allow Actions to write to the repo: Go to Settings -> Actions -> General, then in the "Workflow permissions" set it to Read/Write.

nanos commented 1 year ago

Yep, the permissions were indeed the problem.

I now need to think about how I'll deal with this, because there are 54 forks for this repo. I don't think we'll want them all to run the Action to build the container. That makes no sense.

I'll have a look at the workflow 'on' bit to see what I can do to fix that

nanos commented 1 year ago

I think as long as I simply remove the branch: main bit, it should be fine, unless forks do their own releases, in which case, again, it's fine.

Thanks again for doing this! Much appreciated!