Plugins: Load plugins by order, aesthetic plugin dependency system (#2020)

* Plugins: Load plugins by order, aesthetic plugin dependency system

Introduces plugins loading in order of installation, BTCPay itself shows up as a system plugin, and that plugins can define other plugins as dependencies.

* use a proper type for plugin dependencies

* rebase fixes

* message when cannot install
This commit is contained in:
Andrew Camilleri
2020-11-05 15:43:14 +01:00
committed by GitHub
parent 38fb64130d
commit 31738c465d
8 changed files with 299 additions and 38 deletions

View File

@@ -66,6 +66,11 @@ namespace BTCPayServer.Plugins
UninstallPlugin(plugin);
PluginManager.QueueCommands(dest, ("install", plugin));
}
public void UpdatePlugin(string plugin)
{
var dest = _btcPayServerOptions.PluginDir;
PluginManager.QueueCommands(dest, ("update", plugin));
}
public async Task UploadPlugin(IFormFile plugin)
{
@@ -93,7 +98,7 @@ namespace BTCPayServer.Plugins
public string Description { get; set; }
public bool SystemPlugin { get; set; } = false;
public string[] Dependencies { get; } = Array.Empty<string>();
public IBTCPayServerPlugin.PluginDependency[] Dependencies { get; set; } = Array.Empty<IBTCPayServerPlugin.PluginDependency>();
public void Execute(IApplicationBuilder applicationBuilder,
IServiceProvider applicationBuilderApplicationServices)