[MM-16376] Allow server to download and install a plugin from… (#11372)

* Initial implementation of plugin remote source

* Implement API route

* Test API route

* Add i18n

* Handle different error cases in API route

* Include missing i18n translation

* Include AllowInsecureDownloadUrl in telemetry capture

* Updates from PR feedback

* Use HTTPService instead of http.Get

* Remove InstallPluginFromUrlForced from client4

* Use net/url library to inspect url scheme

* remove PluginDownloadUrl from web/params.go

* Allow plugin downloads from internal sources
Этот коммит содержится в:
Michael Kochell
2019-06-26 15:45:07 -04:00
коммит произвёл GitHub
родитель 44b9fe3110
Коммит 8cdf5ffe67
6 изменённых файлов: 141 добавлений и 8 удалений

Просмотреть файл

@@ -2183,12 +2183,13 @@ type PluginState struct {
}
type PluginSettings struct {
Enable *bool
EnableUploads *bool `restricted:"true"`
Directory *string `restricted:"true"`
ClientDirectory *string `restricted:"true"`
Plugins map[string]map[string]interface{}
PluginStates map[string]*PluginState
Enable *bool
EnableUploads *bool `restricted:"true"`
AllowInsecureDownloadUrl *bool `restricted:"true"`
Directory *string `restricted:"true"`
ClientDirectory *string `restricted:"true"`
Plugins map[string]map[string]interface{}
PluginStates map[string]*PluginState
}
func (s *PluginSettings) SetDefaults(ls LogSettings) {
@@ -2200,6 +2201,10 @@ func (s *PluginSettings) SetDefaults(ls LogSettings) {
s.EnableUploads = NewBool(false)
}
if s.AllowInsecureDownloadUrl == nil {
s.AllowInsecureDownloadUrl = NewBool(false)
}
if s.Directory == nil {
s.Directory = NewString(PLUGIN_SETTINGS_DEFAULT_DIRECTORY)
}