A plugin architecture for self-hosted shields instances #9787
Labels
needs-discussion
A consensus is needed to move forward
self-hosting
Discussion, problems, features, and documentation related to self-hosting Shields
📋 Description
This doesn't come up all the time, but occasionally someone pops up and asks us to add a badge which would only make sense for a self-hosted install.
We usually say no to these requests. If there is no public instance of the service, it is difficult for us to test that this code works (either manually or via integration tests), making it hard to support, maintain or refactor.
That said, this has come up a non-zero number of times and the requests are not completely invalid. For some subset of self-hosting users, these badges could be useful.
So here's an idea: We provide some kind of plugin hook or extension point that allows self-hosting users to write and maintain a custom service. This would allow this category of users to self-serve their own feature requests without them having to maintain a fork or us having to take on the maintenance of code that would be zero use to the users of shields.io.
The thing that has made me think of this recently is Artifactory. I know this issue has come up before, but I can't think of any other examples to hand. So my first question is: Can anyone remember any other cases? It would be useful to collect up a few examples to help think about this. Also it would be useful to get some idea of whether there are enough use-cases to warrant solving the challenges this presents us with.
Here's some initial thoughts about what a plugin system might look like:
local-services
(for the sake of argument)..gitkeep
in it.services
dir, the loader also searches thelocal-services
dir./local
to namespace them. That means there won't be clashes with other URLs we add to core in future.That sounds kinda reasonable-ish, but it does bring up a number of problems, tradeoffs and questions:
shieldsio/shields
and copying some extra files into it. Another might be to mountlocal-services
as a volume and give it some files that way? Does anyone know of any examples of other projects that have this kind of setup? It would be interesting to look at some examples.BaseJsonService
at the moment, its a bit of a pain but fundamentally we only have to account for that in our own codebase. Once you have self hosting users extending that class, a non-backwards compatible change has wider implications.privateConfigSchema
. Of course, that wouldn't stop someone directly callingprocess.env.MYVAR
in the service code, but I feel like we could do better. What other obvious important things does my strawman implementation overlook?The text was updated successfully, but these errors were encountered: