-
Notifications
You must be signed in to change notification settings - Fork 626
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] Allow toml configuration to be parsed from remote/local URL #525
Conversation
|
EDIT: typos in original message fixed. sorry! ah shoot, I could see this getting bloated, and that's unfortunate. The idea was to use this to make translation channels more straightforward or Slack users. I was hoping to create another app that would auto-build config using a Slack token, from channel naming conventions, like this: #foo ;skipped
#bar-en ;skipped
#baz ;added to bridge (not translation)
#baz-en ;added to bridge (all msgs translated to english)
#baz-hk ;added to bridge (all msgs translated to chinese)
#baz-es ;added to bridge (all msgs translated to spanish) (The conventions could even be configured via regex, so others could adapt the little app to their needs.) I was planning to write something to restart/reload matterbridge that didn't require adding code to this, but do you think it should be added here? If so, we could discuss adding an endpoint to force a reload. Open to suggestions and feedback, as always :) |
Ok, so if I'm understanding correctly, I've gotten far enough that I now need to create a PR for this upstream :) Related: patcon/matterbridge-autoconfig#3 One ApproachAllow matterbridge to be run like so:
When an http config value is set rather than a local file:
Another Variation
EDIT: Just realized that this is already supported :) Yay!
I actually like this variant more. It would involve changes so that instead of setting config like this: # matterbridge.toml
[slack.myteam]
Token="xoxp-xxxxxxxxxxxxxxxxxx" We could set it like this: ConclusionI'm actually inclined to work on support for the variation. Seems more robust. I suppose basic auth would still be helpful for entities who don't want any config exposed publicly, even unpriviledged. So happy to accomodate both!
Eager to hear your thoughts on the webhook :) |
Just realized that envvar support I hoped for is already there (sorry, typo'd in my testing: #545) |
Ok, so I'm realizing that not all of matterbridge features can work on Heroku atm: heroku has web and worker processes. In short, only web can bind to a port and receive requests. But it also sleeps, and workers are the processes that stay active like matterbridge needs. So this might not be something you'd be willing to bring into core, but I'm currently investigating using queues. Specifically, abstract messages queues that use go channels: https://medium.com/@matryer/introducing-vice-go-channels-across-many-machines-bcac1147d7e2 Channels are really new to me, so I'm curious your thoughts on all this. Thanks wim. Sorry for all the noise the last few days ;) |
Ok, some comments.
|
heh, i was trying to create an app that could separate web and worker processes, as is advocated by heroku (and pressured by their free tier, due to limitations). A task queue (which i backed with redis) is required to pass tasks between processes. But I can understand that that's a hassle. I'll use the API bridge as you suggest (good idea!), and just pay heroku so that I can run this as a single process |
Ok, working on scaling this back in a local branch, but quick Q:
I'm reading this to mean that each API bridge gets an |
Well I would keep it very simple.
|
Sounds good to me. This would work for the common ephemeral filesystem setup of most PasS platforms, so long as we grab config as part of the process startup script in re: https://devcenter.heroku.com/articles/dynos#ephemeral-filesystem |
Ok, so I'm realizing that I'm confused about our config tactic. Should I store a It seems like it's supposed to be the latter right now, but that might result in wonky effects if someone tried to set it per-gateway (e.g. gateways fighting over what url the config is written from) |
Another potential issue of storing this url in config file itself (instead of setting as CLI flag or envvar) It can easily set people up to find themselves in odd territory, because it fetches the file that points to the config that will be used on the next reload. So if someone is using a config file in a gist or github repo, the current config url will not be in the file -- only the last raw url from previous commits. And so trying to let config be managed in a git repo will result in the file "walking back in time" on each reload 😆 Can be avoided by encouraging setting via envvar, but just a heads up. I'll make sure I document favoured approaches |
Closing in favour of #565 |
Still curious about the above clarifications though |
I'm thinking on how to create a web interface to manage the config, and my current thinking is just
theto generate a smallallapp that access the config via basic auth.Would you be opposed to this? That would allow me to start building adjacent things that don't need to impinge much on the larger project :)