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
309 stars 230 forks source link

Running container with docker compose does not accept configuration from environment file #62

Closed politas closed 1 year ago

politas commented 1 year ago

Putting command line options in as environment variables and launching using docker-compose always returns an error:

You must supply at least a server name and an access token

Docker documentation seems to say that the two methods should be identical. Is Fedifetcher reading from environment variables?

nanos commented 1 year ago

No, FediFetcher doesn’t read configuration options from environment variables when run in docker (don’t think it ever has - that was only ever possible for GitHub Action, and even that is no longer supported).

Can you tell me where in the documentation you got that from? I’d like to clarify this.

politas commented 1 year ago

No, I think I may have been misreading the Docker documentation. I've just figured out that I can embed the command line arguments in my docker-compose.yml file with:

command:
  - "--server=example.com"
  - "--access-token=longstringoflettersandnumbers"
  ...

It would be better if the code could check for environment variables to use, though. I might throw together a PR if it would be welcomed?

nanos commented 1 year ago

I'm not sure I want to add support of reading from environment variables back in: As I said, I just removed this for GitHub Actions (which admittedly work quite differently), because it was really confusing.

You could create a json file with your configuration options instead?

politas commented 1 year ago

And then use it with the -c option? I'll give that a go. I might try running it as an entirely separate application; it seems to be having problems running as part of the Mastodon app.