Commit Graph

355 Commits

Author SHA1 Message Date
Andy Librian
3865bc501e golint fix (#13613) 2020-01-20 12:32:20 +01:00
Christopher Speller
45565cb81f Fix CLI nil pointer panic (#13359) 2020-01-06 11:17:19 -08:00
Rajat Varyani
e27969adbc [MM-12374] Add CLI command for moving outgoing webhook (#12538) 2020-01-06 10:58:56 +01:00
Miguel de la Cruz
f41c90657e Remove bad update user email example (#13356) 2019-12-20 04:37:45 -08:00
Scott Bishel
3bccc03df3 MM-19872: Update dependencies for enterprise implementation of new SAML2 golib. (#13298)
* Update dependencies for enterprise implementation of new SAML2 golib.

* add indirect
2019-12-19 08:27:34 -07:00
Martin Kraft
75ffd0b69e MM-14675: Eliminates implicit GroupChannel/GroupTeam associations. (#13199)
* MM-14675: Upserts GroupTeam when GroupChannel is linked.
MM-14675: Delete all associated GroupChannels when deleting a GroupTeam.
MM-14675: Using replica DB where possible.
MM-14675: Updates create method used in tests.

* MM-14675: Removes unnecessary DB retrieval of GroupSyncable record.
2019-12-18 08:54:09 -05:00
Claudio Costa
72f3bb10c7 [MM-20761] Fix and improve integrity check tool (#13246)
* Fix query and add tests

* Support NULL values and improve output
2019-12-04 16:56:08 +01:00
Jesús Espino
a63684fcb5 Consistent license message for all the go files (#13235)
* 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
2019-11-29 12:59:40 +01:00
Miguel de la Cruz
2259b7f2a8 [MM-19948] Set version on module file and internal paths (#13186)
* [MM-19948] Set version on module file and internal paths

* Fixes after merge

* Fix i18n checker error
2019-11-28 14:39:38 +01:00
Martin Kraft
14bcd1f0a1 MM-18357: Adds pagination to team search. (#12910)
* MM-18357: Adds pagination to team search.

* MM-18357: Adds new client method for paginated requests.

* MM-18357: Adds feedback about non-supported pagination-permissions combo.

* MM-18357: Removes unnecessary conversion.

* MM-18357: Removes paginate parameter and uses nil on page and perpage instead.
2019-11-28 08:11:02 -05:00
Christopher Speller
3cb3d874b8 MM-19980 Allowing user delete command to delete bot accounts. (#13155)
Automatic Merge
2019-11-27 15:36:51 -05:00
Ben Schumacher
c68f021809 Fix naming for CLI plugin list command (#13065) 2019-11-26 09:41:44 +01:00
Miguel de la Cruz
f7e93db512 [MM-16768] Add support for Elasticsearch v7 (#12537)
* [MM-16768] Add support for Elasticsearch v7

* Fix i18n

* Adds external services tracking to the telemetry

* Rebuild elasticsearch interface mock

* Rename diagnostics keys

* Fix merge change
2019-11-21 13:04:21 +01:00
Ali Farooq
a6e992ae74 MM-16368 - Plugin Signing (#13017)
* [MM-18757] POST handler for `/plugins/marketplace` (#12372)

* Implement installMarketplacePlugin

* Add InstallMarketplacePlugin endpoint

* Fix go.mod

* merge with master

* Fix go.mod

* Fix plugin tests

* Move get plugin to marketplace client

* Fix stylistic concerns

* Add trailing newline to the go.mod

* [MM-16586] Add plugin signature settings (#12390)

* 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

* Add public key settings to the config.json

* Rename PublicKeys to SignaturePublicKeyFiles

* Change filepath.Split to Base

* Remove additional prints

* Force extention of a public key file

* Remove config validation

* Remove error on delete

* Remove config cloning

* Add error messages

* Add plugin public key tests

* Rename extension to PluginSignaturePublicKeyFileExtention

* Remove EnforceVerification

* Change []*PublicKeyDescription to []string

* Change .asc extension to .plugin.asc

* Change ordering of public methods

* Change plugin key commands

* Update examples in the plugin key commands

* Remove forcing extention

* Add verify signature in settings

* Fix tabbing

* Fix naming

* Remove unused text

* Remove unused text

* Update command examples

* Fix unit tests

* Change errors.New to errors.Wrap

* Fix verbose flag

* Change .asc to .gpg

* Fix }

* Change AddPublicKey signature

* Change public.key extension

* Add plugin public key command tests

* Update en.json

* Bootstrap the public keys

* Update en.json

* Fix en.json

* Fix en.json

* Bootstrap hard-coded public key

* Remove unused texts in en.json

* Change file to name

* Add license header

* Update development public key

* Remove writeFile method

* Remove .plugin.asc extension

* Rename publiKey to mattermostPublicKey

* Remove init_public_keys string

* GolangCI

* Closing file handlers

* Fixed test that was installing nps plugin

* [MM-19798] Implement plugin signature verification (#12768)

* 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

* Add public key settings to the config.json

* Rename PublicKeys to SignaturePublicKeyFiles

* Change filepath.Split to Base

* Remove additional prints

* Force extention of a public key file

* Remove config validation

* Remove error on delete

* Remove config cloning

* Add error messages

* Add plugin public key tests

* Rename extension to PluginSignaturePublicKeyFileExtention

* Remove EnforceVerification

* Change []*PublicKeyDescription to []string

* Change .asc extension to .plugin.asc

* Change ordering of public methods

* Change plugin key commands

* Update examples in the plugin key commands

* Remove forcing extention

* Add verify signature in settings

* Fix tabbing

* Fix naming

* Remove unused text

* Remove unused text

* Update command examples

* Fix unit tests

* Change errors.New to errors.Wrap

* Fix verbose flag

* Change .asc to .gpg

* Fix }

* Change AddPublicKey signature

* Change public.key extension

* Add plugin public key command tests

* Update en.json

* Bootstrap the public keys

* Update en.json

* Fix en.json

* Fix en.json

* Bootstrap hard-coded public key

* Remove unused texts in en.json

* Change file to name

* Add license header

* Implement plugin signature verification

* Remove benburker openpgp

* Update en.json

* Update development public key

* Add support of multiple signatures in filestore

* Update en.json

* Run go mod vendor

* Fix style

* Remove writeFile method

* Remove .plugin.asc extension

* Rename publiKey to mattermostPublicKey

* Verify plugin with mattermost public key

* Remove init_public_keys string

* Add InstallPluginWithSignature method and  Refactor

* Add signature verification on claster notification

* Remove armored signature headers

* Add error strings

* Fix en.json

* Change signatureStorePath

* Implement minor fixes

* Refactor plugin install methods

* Add installPlugin method to uploadPlugin

* Update en.json

* Refactor installPlugin

* Limit number of signatures

* Close signatures

* Fix helper function

* Fix fromReadCloseSeekerToReadSeeker

* Cleaned up ReadCloseSeeker for signatures

* Remove signature truncation on FS

* GolangCI

* Add tests for armored signatures and plugin uploads

* Fix nil slice issue

* Fix TestPluginSync

* Fixed tests

* Return io.ReadSeeker from downloadFromUrl

* Add log for the found plugins in the file store

* Remove logging plugin detection info

* [MM-20134] Consume and store single-signature for each plugin (#13081)

* Consume and store single-signature for each plugin

* Fix en.json

* Remove saveSignature method

* Remove public key hash

* PR Feedback

* refactored config

* PR feedback
2019-11-18 19:02:41 -05:00
Claudio Costa
c0c47df3f0 Fix data race on server startup (#13006) 2019-11-08 20:37:15 +01:00
Rajat Varyani
ac8e3a853c Add gorilla/handlers dependency as it is used in enterprise version (#12991)
* Add gorilla/handlers dependency as it is used in enterprise version

* Remove unused dependencies
2019-11-04 09:48:25 -08:00
Joshua Bezaleel Abednego
63a28700f5 [MM-12623] Create CLI command "config reset" (#10296) 2019-11-01 19:29:02 +01:00
Ben Schumacher
7a665aacdd Run gosimple against codebase (#12928) 2019-10-29 07:45:09 +01:00
Ben Schumacher
71d5f7dc64 Remove unused struct fields (#12924) 2019-10-28 18:04:50 +01:00
Ben Schumacher
e61340c54e Run gofmt -s against codebase (#12943) 2019-10-28 06:08:08 -07:00
Ben Schumacher
8a72ed2833 Fix unnecessary type conversions (#12927) 2019-10-28 10:57:21 +01:00
chahat arora
cf6496bb8f Migrate tests from app/command_test.go to use testify (#12659)
* Migrate tests from app/command_test.go to use testify

* minor fix

* minor fix

* minor fix
2019-10-27 11:42:21 +01:00
Saturnino Abril
65dc760f01 add option to generate deactivated users via sampledata (#12772) 2019-10-15 21:25:31 +08:00
Raghubendra Singh
f167a39abe Update command_test.go (#12654) 2019-10-11 15:08:18 +02:00
Phillip Ahereza
d290534297 Migrate tests from "cmd/mattermost/commands/roles_test.go" to… (#12421)
* migrated tests in roles_test.go to use testify

* format file

* format file and edit some test statements

* change some require statements to assert

* remove extra t.Fatal

* test error on response

* use require.NotEmpty
2019-10-08 09:39:44 -05:00
Ogundele Olumide
f21b7618a4 MM-19015 Migrate tests from "cmd/mattermost/commands/config_te… (#12627)
- change t.fatal to require package of the testify toolkit
2019-10-08 00:09:39 -06:00
Ogundele Olumide
fa166f13bf chore: migrate test to testify (#12507)
- replace calls to t.fatal with require assertion of testify toolkit
2019-10-04 07:43:29 -07:00
Agniva De Sarker
20ff7032a6 Fixed some ineffective assignments (#12543) 2019-10-03 15:45:27 +03:00
Aliaksandr Kantsevoi
f010346945 Migrate tests from "cmd/mattermost/commands/team_test.go" to use test… (#12509)
* Migrate tests from "cmd/mattermost/commands/team_test.go" to use testify #12410

* #12410: Simplify if checks

Migrate tests from "cmd/mattermost/commands/team_test.go" to use testify #12410
2019-10-03 16:38:41 +08:00
Ogundele Olumide
714a5c3c29 chore: convert calls to t.fatal to testify (#12506)
- use require testfify assertions to replace calls to t.fatal
2019-10-03 10:09:29 +02:00
Aliaksandr Kantsevoi
80633ef475 Migrate tests from "cmd/mattermost/commands/webhook_test.go" to use t… (#12510) 2019-10-02 11:03:37 +02:00
Jesse Hallam
beef13ae46 MM-18721: disable SIGPIPE handling (#12394)
We recently added support for handling SIGPIPE cleanly, in order to safely shutdown plugins in the event that the STDOUT/STDERR had been closed unexpectedly. Unfortunately, this signal is also emitted when writing to a closed socket connection: an event that occurs frequently for a webserver. Normally, if no signal handler is registered for same, the Go subsystem distinguishes the file descriptor and ignores those from the network. But once a handler is registered, all SIGPIPEs are passed through: and sadly there is no way to distinguish the original file descriptor.

We don't strictly need the SIGPIPE handling for development any longer since `make stop-server` no longer shuts down the logrus process which explained the majority of hanging plugin processes. It remains suboptimal that a signal can terminate the server and leave plugin processes hanging, but the current symptoms are worse.
2019-09-30 15:44:56 -03:00
Jesse Hallam
993947c70a MM-18741: clarify error message (#12357)
Clarify the error message that is emitted by the server when failing to parse the configuration.

Fixes: MM-18741
2019-09-26 23:47:13 -03:00
Shota Gvinepadze
32bc585446 [MM-18121] Fix config set panic (#12083)
* Fix config set panic

* Change error message

* Add a test case

* Update error string
2019-09-20 17:48:19 +04:00
Nikhil Ranjan
3a3676eb12 Converting to structured logging the file cmd/mattermost/commands/utils.go (#12091) 2019-09-17 12:54:43 -07:00
Paulo Bittencourt
5b79fc4110 [MM-17889] Implement validation of plugin API version comments (#11941) 2019-09-17 08:03:28 +02:00
Jesús Espino
5cf578f486 Migrating to our ldap fork (#12149) 2019-09-12 21:11:05 +02:00
scott lee davis
98f7bdcb43 MM-14827 don't kill STDOUT for the server process (#10828) 2019-09-06 19:08:39 +02:00
Claudio Costa
e1eb839636 Add integrity check command to CLI (#11599)
* Add integrity command

* Add structures and implementation for basic referential integrity check

* Use a channel to receive integrity check reports as they generates

* Setup unit testing

* Add confirm prompt to integrity command and make verbose output optional

* Add more integrity checks

* Use wrapper functions to simplify behaviour and tests

* Improve extensibility of IntegrityCheckResult

* Improve CheckIntegrity tests performance

* Use a config structure for relational integrity checks

* Add more relational integrity checks

* Add more checks and do some cleanup

* Add more relational integrity checks with proper tests

* Fix tests to use sync functions

* Add more info to integrity command help

* Add more relational integrity checks

* Add more relational integrity checks

* Add missing checks

* Show more information about missing records

* Fix to use new sync function

* Change integrity check functions to accept a SqlSupplier

* Fix code duplication

* Use squirrel for query building
2019-08-30 09:44:55 -03:00
Carlos Tadeu Panato Junior
f02f83a7df update sampledata users passwords (#11769)
* update sampledata users passwords

* update makefile
2019-08-02 19:42:25 +02:00
scott lee davis
2fa63b10ec MM 7971 dockerhost -> localhost && docker -> docker-compose (#10872)
* replace dockerhost with localhost

* remove uneeded setup-max build step (no more dockerhost)

* changes as recommended by @cpanato

* make clean-docker with docker-compose

* added ports to docker-compose.yml (needed for osx).   ignore error for ldapadd (when already exists)

* add clean-old-docker to legacy.mk

* docker-compose stop instead of down for `make stop-docker`
2019-08-02 11:53:00 -03:00
Jesús Espino
e4582905ea Time Layer for measure the Store methods calls time (#11609)
* Time Layer for measure the Store methods calls time

* Fixing build

* Fixing a formating problem

* Fixing tests

* generating store mocks

* Fixing build

* Updating generated timer layer

* Updating timer layer to the last store interface

* Updating timer layer

* Generating time layer
2019-08-01 22:10:58 +02:00
Gabe Jackson
b73b6b4c36 Improve bulk export of posts (#11702)
This change modifies some of the logic for processing posts during
bulk export in order to improve performance.
2019-07-25 12:20:49 -04:00
Joshua Bezaleel Abednego
c49f755a14 Create CLI command "team modify" to modify team's privacy setting. (#10898) 2019-07-17 11:49:12 +02:00
Rajat Varyani
c1f3c83d38 Config migrate SAML keys and certificates (#11596) 2019-07-14 09:19:51 +02:00
Claudio Costa
70fd0e0d6f Fix mixup between stdout and stderr in CLI (#11529) 2019-07-10 14:36:49 +02:00
Taufiq Rahman
9ce5b28c63 [MM-16667] Migrate User.GetByUsername to Sync by default #11453 (#11520)
* Migrate User.GetByUsername to Sync by default #11453

* fix app errors #11453

* fix app errors #11453

* fix cmd error #11453

* fix shadow var #11453

* fix shadow user var #11453

* fix test error

* fix test error #11453
2019-07-10 10:46:03 +02:00
Mounica Paladugu
ff89b2c8e1 [MM-16170] Migrate Team.GetTeamsByUserId to Sync by default (#11100)
* [MM-16170] Migrate Team.GetTeamsByUserId to Sync by default

* Fixing comments
2019-07-09 12:21:18 -04:00
Marc Argent
e209a7acb4 GH-11466 Migrate User.UpdatePassword to Sync by default (#11495)
* GH-11466 Migrate User.UpdatePassword to Sync by default

* GH-11466 format fix
2019-07-09 04:50:01 -07:00
Jesús Espino
da6cb83f9b Allow to export global relay to zip (#11492)
* Allow to export global relay to zip

* Addressing review comments
2019-07-08 11:06:59 +02:00