- Fix panic due to not checking for JSON marshal error
- Reorder the FileExists check which would fail if we were to pass
the -short flag to bypass the slow URL test. In which case, the plugin
would have been removed from the filesystem.
So we move the check before we remove the plugin.
https://mattermost.atlassian.net/browse/MM-22666
* Make WebSocketEvent type immutable
* Update code to use updated immutable WebSocketEvent type
* Export WebSocketEvent fields and mark them as deprecated
* MM-21103: change plugin signature path
Save as `<plugin_id>.tar.gz.sig` instead of `<plugin_id>.sig`. The latter was a relic of the previous design to support multiple plugin signatures, but now creates an inconsistency with how the original source files were supplied as `<some_name>.tar.gz` and `<some_name>.tar.gz.sig`.
Fixes: https://mattermost.atlassian.net/browse/MM-21103
* relax signature matches to avoid assuming signatures always exist
* Consistent license message for all the go files
* Fixing the last set of unconsistencies with the license headers
* Addressing PR review comments
* Fixing busy.go and busy_test.go license header
* MM-17549: use StatusNotFound when deleting plugin (#12983)
Trying to delete a plugin that does not exist should fail with a 404, not a 400.
Relates-to: https://mattermost.atlassian.net/browse/MM-17549
* MM-19630: marketplace: model ReleaseNotesURL (#13083)
Automatic Merge
* MM-20065: allow prepackaged plugin upgrade (#13076)
* MM-20065: allow prepackaged plugin upgrade
When locally installing prepackaged plugins, skip if a plugin exists with the same id and is the same or a newer version.
This is effectively a "poor man's" rework of prepackaged plugins to allow upgrade of prepackaged plugins via the marketplace. The larger plan to rework prepackaged plugins was deferred from v5.18.
Fixes: https://mattermost.atlassian.net/browse/MM-20065
* eliminate unnecessary installPlugin
* fix TestPluginSync defaults to match minio
* cleanExistingBundles
* close prepackaged filereader
* simplify
* MM-17149 - Extend config.json for marketplace settings (#11933)
* MM-17149 - Extend config.json for marketplace settings
* Renamed MarketplaceUrl, tracking default marketplace url
* Added EnableMarketplace to the client config
* Revert "Added EnableMarketplace to the client config"
This reverts commit 0f982c4c66.
* MM-17149 - Added EnableMarketplace to the client config (#11958)
* Added EnableMarketplace to the client config
* Moved EnableMarketplace setting out of limited client configuration
* MM-17150, MM-17545, MM-18100 - Implement GET /api/v4/plugins/m… (#11977)
* MM-17150 - Implement GET /api/v4/plugins/marketplace proxying upstream
MM-17545 - Merge locally installed plugins into GET /api/v4/plugins/marketplace
* Replaced MarketplacePluginState with Installed
* Setting InstalledVersion instead of Installed
* marketplace client setting per_page if non zero
* Creating insecure client for marketplace url
* Fixed trailing slash for default marketplace url
* Adding filtering
* Fixed function names
* Renamed Manifest() to GetManifest(), added godoc for BaseMarketplacePlugin
* Handling plugin.ErrNotFound correctly
* Checking err == nil instead when a plugin is installed
* MM-18450 - Local-only plugin search (#12152)
* MM-17846: plugin icons (#12157)
* MM-17846: add support for plugin icons
Extend the model definitions to support plugin icons from the marketplace.
* s/IconURL/IconData
* MM-18475 - Converge on snake_case responses from the marketplace (#12179)
* MM-18520 - MM-Server should forward server version to marketplace server (#12181)
* Renamed request to filter client4.GetMarketplacePlugins
* Renamed request to filter
* Guarding against bad marketplace server response
* MM-17087 - Disable plugin on removal
* Updated documentation
* Got reid of notifyPluginEvents
* Updated documentation
* Added plugin installation/activatoin flow as a toplevel go doc in plugin_install.go
* Generating webapp bundle on plugin installation
* Fixed shadowing issue
* Updated doc to include unguarded race condition
* Renamed GenerateWebappBundle
* Added a debug log when peers are not ready to notify
* Updated docs
* Removed extra line
* Bumped http request timeout for plugin install from URL
* Added unit test for timeout higher than 30 seconds. Other minor PR feedback
* Fixed spacing
* MM-16272 - Synchronize plugins across cluster (#11611)
* MM-16272 - Synchronize plugins across cluster
* Adding a test
* MM-16272 - Fixed tests
* MM-16272 - PR feedback
* MM-16270 - Plugin Sync (#11615)
* Initial implementation for plugin synch with file store. WIP
* Removed ListAll implementation. Used ListDirectory and change localstore to be consistent and return all items (files and folders) from directory
* Refactored plugin filestore operations out of main install/remove plugin
* Fixing error handling details
* Changes to use structured logging
* More logging fixes
* Wording and comments improvements
* Error handling and control flow improvements
* Changed managed flag check to use os.stat
* Added file store plugin dir and filename consts
* Replaced FileRead to use a the FileReader in PluginSync
* Minor styling and PR feedback changes
* Minor error handling improvements
* Added unit test for SyncPlugins. Changed SyncPlugins to use plugins environment to list available plugins
* PR Feedback improvements
* Minor err handling fix
* Removing FileStorePath from PluginEventData (#11644)
* Fix plugin path (#11654)
* tweak path, logging
Fix an issue not finding the plugins folder in S3. Tweak logging messages to add additional clarity.
* Removing FileExists check when Syncing plugins. Updated localstore to not return an error when directory does not exist
* PR Feedback
* Install prepackaged plugins locally only (#11656)
* s/uninstall/remove
* Updated ClusterMessage comment
* Updated PluginSync to test against s3 + local storage
* Implemneted saving the plugin bundle on the file store upon plugin upload
* Fixed compilation error
* Fixed compilation issue
* Added deletion from file store upon plugin uninstall
* Added condition to delete from store only when exists. Added case of saving the bundle to the store when uploading from url. Added checks in plugin tests
* Fixed compilation error
* Moved storage of plugin bundle within app/installPlugin
* Moved storing to filestore before enabling the plugin
* Fixed error handling
* Code styling improvements
* Minor styling fix
* 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
* refactor utils/config* to config/
* pull validateLdapFilter into app
* clean up Config/GetConfig/GetSanitizedConfig usage
Eliminate app.GetConfig() in favour of just using app.Config() directly,
but expose app.GetSanitizedConfig() for when the old behaviour was
required.
* web: isolate config setup
* TestInvitePeopleProvider: make config explicit
* regenerateClientConfig: avoid racey map access
* integrate watch flag into app.ConfigFile option
* make app.Option return an error
* release.mk: only cp static files from config/
* release.mk: fix cp static files from config/
* api4: TestPlugin cleanup
* s/c/cfg/ for clarity
* fix merge conflict
* testlib: allow customization of testlib driver name
* api4: fix TestGetUsersNotInTeam assertions
This test was relying on data from a previous test run. With the data cleared before each test, the assertions much match reality.
* *testlib: always InitSystemAdmin
Some tests implicitly relied on the basic user having system
administrator privileges because it was the first user created as such.
Eliminate `InitSystemAdmin` and explicitly create the system admin user
instead to avoid this ambiguity going forward.
* *testlib: drop all tables before each test
* api4: split up TestChannelDelete to avoid duplicate InitBasic
* api4: teardown in TestResetPassword, for when this test comes back
* invalidate cache on DropAllTables
This is necessary since the test store persists across tests.
* disable parallel tests
While tests within a package must be explicitly parallelized using `t.Parallel()`, tests across packages are run in parallel by default. This causes problems given that the tests all currently share the same database instance.
Unfortunately, this also means that running the tests is much slower, but we can return to this later.
* failing to find i18n shouldn't segfault
The server was trying to handle the fact that it couldn't find the i18n
directory, by emitting a translated log message...
* fix utils.FindDir
The attempts to find the directory in the parent or grandparent directory
don't work if the current working directory was inside `enterprise`, with
`enterprise` itself being a symlink as per the usual developer setup.
Recurse to the root of the filesystem, cleaning the path along the way
to work around this limitation (and allow tests to be run from an
arbitrarily deep nesting level.)
Fix corresponding usages to employ filepath.Join.
* failing to find html templates shouldn't segfault
* fail fast if the test user cannot be created
* rework utils.FindDir to retain backwards compatibility
* don't use global app for api / api4 tests
* put sleep back. we're gonna have to do some goroutine wrangling
* fix oauth test config assumptions
* jobs package, i'm comin' for you next
* app test fix
* try increasing sleep a little
* tie back-end plugins together
* fix comment typo
* add tests and a bit of polish
* tests and polish
* add test, don't let backend executable paths escape the plugin directory
* Implement experimental REST API endpoints for plugins
* Updates per feedback and rebase
* Update tests
* Further updates
* Update extraction of plugins
* Use OS temp dir for plugins instead of search path
* Fail extraction on paths that attempt to traverse upward
* Update pluginenv ActivePlugins()