Open OPNA2608 opened 4 months ago
As part of this, I have been working on a prototype implementation of this as a feature, found here: https://github.com/Infinidoge/PeerTube/tree/develop-nginix
How it works currently is you create a json file in the plugins directory, and it runs the internal installation/removal from there, handling the database where needed.
declarative_plugins.json
format:
{
"npm-package-name": {
"pluginPath": "/path/to/plugin/directory"
},
"other-npm-package-name": {
"version": "version.to.install"
}
}
I also intend on adding an offlineCache
option, to instruct yarn internally to use the given offline cache, allowing for pre-fetching plugins.
Something that would be worth doing is instead moving this into the PeerTube configuration, removing the need for the positional file and letting multiple config files declare plugins.
Describe the problem to be solved
For the NGI-funded Summer of Nix project, we (@infinidoge and I) are looking into how peertube plugins can be managed declaratively within a NixOS module.
From our understanding, plugins can only be installed imperatively: Start the CLI & tell it to install a plugin, and peertube will trigger a state change in the database to register the plugin and look for it in its plugin directory on startup. This extra requirement on a certain database state is a major pain point for our endeavour.
A previous effort around this found a workaround by
storage.plugins
package.jsonstorage.plugins
But we think this extra plugin management around your own plugin management is very unsatisfying & hacky solution.
Describe the solution you would like
We would like to find solution that doesn't rely on us doing plugin management around your plugin management.
Maybe there could be a way to tell peertube to read a list of additional plugins from somewhere, or have it automagically find additional plugins if they're in a certain directory.
Ideal for us (I think) would be a way to completely lock down the imperative plugin management and have it be fully managed by the external mechanism, so we can ensure that only the plugins the user desires are available to peertube.