Commit Graph

12497 Commits

Author SHA1 Message Date
Elisabeth Kulzer
be44de22cf Docker compose network (#14783)
Automatic Merge
2020-06-09 11:17:18 +02:00
George Goldberg
921cff0e60 MM-24483: Add telemetry for new config settings. (#14773) 2020-06-09 09:04:52 +01:00
Elisabeth Kulzer
7d1aad9822 Revert "Docker compose network (#14771)" (#14782)
This reverts commit 91f1c47ba3.
master is broken because of this. Skip tests.
2020-06-09 09:56:47 +02:00
Elisabeth Kulzer
91f1c47ba3 Docker compose network (#14771)
* Updating to use a different network cidr for the mm-test network

* Update docker-compose.yaml

Remove gateway as its not needed and caused problems before

Co-authored-by: Jason Deland <jaydeland@gmail.com>
Co-authored-by: mattermod <mattermod@users.noreply.github.com>
Co-authored-by: Jason Paul Deland <9366595+jaydeland@users.noreply.github.com>
2020-06-09 09:00:09 +02:00
Miguel de la Cruz
457903a12c [MM-25713] Adds props check to post import validator (#14728)
* [MM-25713] Adds props check to post import validator

* Fix linter

* Address review comments

Co-authored-by: mattermod <mattermod@users.noreply.github.com>
2020-06-08 21:20:40 +02:00
Miguel de la Cruz
6cd898fab7 [MM-25714] Keeps track of the import lines of the posts while importing to report the right line on error (#14752)
* [MM-25714] Keeps track of the import lines of the posts while importing to report the right line on error

* Adding review comments

* Reverse the order of the error and error line params
2020-06-08 12:12:07 +02:00
Flavia Bastos
ea06c291df Document sqlTeamStore search methods (#14702)
Co-authored-by: mattermod <mattermod@users.noreply.github.com>
2020-06-06 11:53:28 +02:00
Rodrigo Villablanca
6f28f3526d Migrate PermanentDelete method from ChannelStore to return error inte… (#14706)
Automatic Merge
2020-06-06 11:47:18 +02:00
Abdulkadir Poyraz
88e8f56f03 refactor cluster discovery store to use squirrel (#14560)
Co-authored-by: mattermod <mattermod@users.noreply.github.com>
2020-06-05 17:58:29 +02:00
Carlos Tadeu Panato Junior
c2f171af07 dockerfile: bump base MM package to 5.23.1 (#14757)
Automatic Merge
2020-06-05 05:02:16 -07:00
Rodrigo Villablanca
ac32b2da41 Migrate Delete/Restore/SetDeleteAt methods from ChannelStore to return error interface (#14700)
Automatic Merge
2020-06-05 04:32:16 -07:00
Martin Kraft
18ddae2c1b MM-25737: Fix for groups list not returning results. (#14746)
Co-authored-by: mattermod <mattermod@users.noreply.github.com>
2020-06-04 11:31:07 -04:00
Carlos Tadeu Panato Junior
ca8a67c7cb database: upgrade db to 5.24 (#14749) 2020-06-04 16:14:22 +02:00
Ashish Bhate
4df8927c60 MM-24867: local mode for inviteUsersToTeam (#14558)
local mode support for inviteUsersToTeam

https://mattermost.atlassian.net/browse/MM-24867
2020-06-04 16:41:52 +05:30
Ibrahim Serdar Acikgoz
8890f41491 api4/post_test: fix a flaky test (#14741) 2020-06-04 12:52:40 +03:00
Agniva De Sarker
21b753b38d [MM-25314] Migrate AppError from channel_member_history_store.go (#14693)
* Migrate AppError from channel_member_history_store

* Migrate AppError from channel_member_history_store

* Migrate AppError from channel_member_history_store

* Migrate AppError from channel_member_history_store

* Migrating error keys

* Review fixes.

* Regenerating i18n

* Add some i18n strings

Co-authored-by: Dante Pippi <6619666+dantepippi@users.noreply.github.com>
Co-authored-by: Jesús Espino <jespinog@gmail.com>
Co-authored-by: mattermod <mattermod@users.noreply.github.com>
2020-06-04 13:08:51 +05:30
Rodrigo Villablanca
3649d04dfa SqlLinkMetadataStore migrates to plain errors (#14674)
Automatic Merge
2020-06-03 13:32:16 -07:00
Miguel de la Cruz
2ba119d7f6 [MM-25712] Fix silent errors on post import failures (#14729)
Co-authored-by: mattermod <mattermod@users.noreply.github.com>
2020-06-03 16:40:24 +02:00
Christopher Poile
7bba8db65f MM-25595 - Edits to bot username and display name fail to save (#14699)
* invalidate the user profile cache bc we know it's now outdated

* invalidate cache when updating user roles; test

* tests fix -- experimental

* fixing linter errors

* revert to original solution

Co-authored-by: mattermod <mattermod@users.noreply.github.com>
2020-06-03 09:27:00 -04:00
Ibrahim Serdar Acikgoz
19e5afd607 [MM-24863] Migrate update/patch/search/delete team endpoints for local mode (#14581)
* [MM-24146] Add unix socket listener for mmctl local mode (#14296)

* add unix socket listener for mmctl local mode

* add a constant for local-mode socket path

* reflect review comments

* [MM-24401] Base approach for Local Mode (#14333)

* add unix socket listener for mmctl local mode

* First working PoC

* Adds the channel list endpoint

* Add team list endpoint

* Add a LocalClient to the api test helper and start local mode

* Add helper to test with both SystemAdmin and Local clients

* Add some docs

* Adds TestForAllClients test helper

* Incorporating @ashishbhate's proposal for adding test names to the helpers

* Fix init errors after merge

* Adds create channel tests

* Always init local mode to allow for enabling-disabling it via config

* Check the RemoteAddr of the request before marking session as local

* Mark the request as errored if it's local and the origin is remote

* Set the socket permissions to read/write when initialising

* Fix linter

* Replace RemoteAddr check to ditch connections with the IP:PORT shape

Co-authored-by: Ibrahim Serdar Acikgoz <serdaracikgoz86@gmail.com>

* Fix translations order

* [MM-24832] Migrate plugin endpoints to local mode (#14543)

* [MM-24832] Migrate plugin endpoints to local mode

* Fix client reference in helper

* api4/team: add local endpoints

* [MM-24776] Migrate config endpoints to local mode (#14544)

* [MM-24776] Migrate get config endpoint to local mode

* [MM-24777] Migrate update config endpoint to local mode

* Fix update config to bypass RestrictSystemAdmin flag

* Add patchConfig endpoint

* MM-24774/MM-24755: local mode for addLicense and removeLicense (#14491)

Automatic Merge

* api4/team: reflect review comments

* api4/team: add to permissions

* fix post conflict issues

* fix formatting

Co-authored-by: Miguel de la Cruz <miguel@mcrx.me>
Co-authored-by: Ashish Bhate <bhate.ashish@gmail.com>
2020-06-03 14:14:21 +03:00
Ibrahim Serdar Acikgoz
0965e8485a [MM-24594] api4/channel: add/remove member & get public/deleted chs for local-mode (#14590)
* [MM-24146] Add unix socket listener for mmctl local mode (#14296)

* add unix socket listener for mmctl local mode

* add a constant for local-mode socket path

* reflect review comments

* [MM-24401] Base approach for Local Mode (#14333)

* add unix socket listener for mmctl local mode

* First working PoC

* Adds the channel list endpoint

* Add team list endpoint

* Add a LocalClient to the api test helper and start local mode

* Add helper to test with both SystemAdmin and Local clients

* Add some docs

* Adds TestForAllClients test helper

* Incorporating @ashishbhate's proposal for adding test names to the helpers

* Fix init errors after merge

* Adds create channel tests

* Always init local mode to allow for enabling-disabling it via config

* Check the RemoteAddr of the request before marking session as local

* Mark the request as errored if it's local and the origin is remote

* Set the socket permissions to read/write when initialising

* Fix linter

* Replace RemoteAddr check to ditch connections with the IP:PORT shape

Co-authored-by: Ibrahim Serdar Acikgoz <serdaracikgoz86@gmail.com>

* Fix translations order

* [MM-24832] Migrate plugin endpoints to local mode (#14543)

* [MM-24832] Migrate plugin endpoints to local mode

* Fix client reference in helper

* [MM-24776] Migrate config endpoints to local mode (#14544)

* [MM-24776] Migrate get config endpoint to local mode

* [MM-24777] Migrate update config endpoint to local mode

* Fix update config to bypass RestrictSystemAdmin flag

* Add patchConfig endpoint

* MM-24774/MM-24755: local mode for addLicense and removeLicense (#14491)

Automatic Merge

* api4/channel: add/remove member & get public/deleted chs for local-mode

* api4/channel_local: reflect review comments

Co-authored-by: Miguel de la Cruz <miguel@mcrx.me>
Co-authored-by: Ashish Bhate <bhate.ashish@gmail.com>
Co-authored-by: mattermod <mattermod@users.noreply.github.com>
2020-06-03 12:20:52 +03:00
Sudheer
1b95b82b18 MM-25723 Add an experimental setting for data prefetching (#14731)
* MM-25723 Add an experimental setting for data prefetching

* Fix formatting

* Fix bool error

* Fix lint error

* Change default to true
2020-06-03 14:43:59 +05:30
Agniva De Sarker
e3255879ba Enable gossip encryption (#14640)
* Enable gossip encryption

* Fix order

* Auto-generate key

* Update gorp fork to include BeginTx

* Add a test for InsertIfExists

And point gorp to a custom branch for now

Co-authored-by: mattermod <mattermod@users.noreply.github.com>
2020-06-03 14:16:15 +05:30
Agniva De Sarker
fc028e703a MM-25641: Check if member was deleted in HasPermissionToTeam (#14737)
This PR adds a check to verify if a team member got deleted in HasPermissionToTeam,
and accordingly returns false.
2020-06-03 13:30:32 +05:30
Jesús Espino
e0edd2bebb Add trial license api (#14603)
* Initial request trial api creation

* Adding test license public certificate

* Adding go client method

* Applying changes to use production environment

* Removing accidentally added strings

Co-authored-by: mattermod <mattermod@users.noreply.github.com>
2020-06-02 21:34:15 +02:00
Rodrigo Villablanca
1c9891c65e Migrate all methods of SqlEmojiStore to return plain error intead of *model.AppError (#14618)
Automatic Merge
2020-06-02 11:31:30 -07:00
Rodrigo Villablanca
52cf817c8e SqlTermsOfService migrates to plain errors (#14675)
* Advances migragint TermsOfService

* Advances...

* Replaced message key

* Replaced message key

* Replaced message key

* Replaced message key

* Refactor name of errors

* Fix mixed type of error

* Fix-imports

* i18n-extract

* Rollback changes

* Rollback changes

* Rollback changes

Co-authored-by: mattermod <mattermod@users.noreply.github.com>
2020-06-02 22:47:52 +05:30
Rodrigo Villablanca
85a69d6112 Migrate Get/GetFromMaster methods from ChannelStore to return error interface (#14688)
* Advances

* Migration finished

* Rename err to normalized error

* fix imports

* Renamed key

* Renamed key

* Suggestions

* Fix i18n

* Fix tests

Co-authored-by: Jesús Espino <jespinog@gmail.com>
Co-authored-by: Agniva De Sarker <agnivade@yahoo.co.in>
2020-06-02 21:58:29 +05:30
Rodrigo Villablanca
60cc775cf6 Migrate Update method from ChannelStore to return idiomatic plain error (#14687)
* Partial advances

* Update migrated

* Fix imports

* Suggestions

* Suggestions

* Updating i18n

Co-authored-by: Jesús Espino <jespinog@gmail.com>
Co-authored-by: mattermod <mattermod@users.noreply.github.com>
2020-06-02 20:50:34 +05:30
Siyuan Liu
6a5dd550c8 migrate direct usage of lru to cache2 (#14508)
Automatic Merge
2020-06-02 06:01:30 -07:00
Jesús Espino
18cd3a1d07 Fixing reply count on new posts (#14312)
* Fixing reply count on new posts

* Fixing tests

* Fixing post reply count on getPostsAround

Co-authored-by: mattermod <mattermod@users.noreply.github.com>
2020-06-02 14:16:46 +02:00
Elisabeth Kulzer
9e9c47bdf5 Fix webapp checkout (#14730) 2020-06-02 13:52:14 +02:00
dantepippi
c5af40988c [MM-24945] Refactor job store to use squirrel (#14559)
* Refactor job store to use squirrel

* Using multiple Set calls instead of SetMap

* Commiting suggestions.

Co-authored-by: Miguel de la Cruz <mgdelacroix@gmail.com>

* Commiting suggestions.

Co-authored-by: Miguel de la Cruz <mgdelacroix@gmail.com>

Co-authored-by: Dante Pippi <dantepippi@gmai.com>
Co-authored-by: mattermod <mattermod@users.noreply.github.com>
Co-authored-by: Miguel de la Cruz <mgdelacroix@gmail.com>
2020-06-02 11:42:31 +02:00
Siyuan Liu
c183a5d380 MM-25115- migrate post, session and status cache to cache2 (#14667)
* use cache2.Provider cache

* use cache2.Provider cache

* clean up imports

* reset test runner

* add close() call

* Fixing i18n

* address review comments

Co-authored-by: Jesús Espino <jespinog@gmail.com>
Co-authored-by: mattermod <mattermod@users.noreply.github.com>
2020-06-02 14:47:00 +05:30
Mario de Frutos Dieguez
beadeaf8b5 [MM-25677] Content-Type is optional (#14705)
* Content-Type is optional

mime.ParseMimeType returns and "no media type" error if the passed
string is empty.

Given that the Content-Type header is optional we shouldn't return an error
in that case, so we're fixing that allowing the users to call the webhook
without passing that header

* Include webhook id in the error message

Given that the number of webhooks could be big the user could
need the id to check which one of the multiple webhooks are failing
so include the id aids in that part
2020-06-01 21:07:02 +02:00
Miguel de la Cruz
6643a7c610 [MM-25538] Adds the termOperator and takes it into account for terms and hashtag queries (#14664)
Automatic Merge
2020-06-01 11:31:30 -07:00
Ashish Bhate
8d4da8b968 MM-25073/MM-25074: local mode for getGroupsByChannel and getGroupsByTeam (#14668)
* local mode for getGroupsByChannel

* local mode for getGroupsByTeam
2020-06-01 12:01:05 +02:00
Eli Yukelzon
2af00f73c0 MM-24847 MM-24484 MM-24850 MM-24849 - local mode for commands (#14571)
* add unix socket listener for mmctl local mode

* First working PoC

* Adds the channel list endpoint

* Add team list endpoint

* Add a LocalClient to the api test helper and start local mode

* Add helper to test with both SystemAdmin and Local clients

* Add some docs

* Adds TestForAllClients test helper

* Incorporating @ashishbhate's proposal for adding test names to the helpers

* [MM-24146] Add unix socket listener for mmctl local mode (#14296)

* add unix socket listener for mmctl local mode

* add a constant for local-mode socket path

* reflect review comments

* Fix init errors after merge

* Adds create channel tests

* Always init local mode to allow for enabling-disabling it via config

* Check the RemoteAddr of the request before marking session as local

* Mark the request as errored if it's local and the origin is remote

* Set the socket permissions to read/write when initialising

* Fix linter

* Replace RemoteAddr check to ditch connections with the IP:PORT shape

* added update/move/get/delete command in local mode

* merge fix

* .

Co-authored-by: Ibrahim Serdar Acikgoz <serdaracikgoz86@gmail.com>
Co-authored-by: Miguel de la Cruz <miguel@mcrx.me>
2020-05-31 16:57:04 +02:00
Jason Blais
d1788cab85 Add Jitsi plugin to diagnostics (#14684)
Automatic Merge
2020-05-30 14:31:30 -07:00
Flavia Bastos
54a4c10ed4 Document sqlTeamStore get methods (#14567)
Co-authored-by: mattermod <mattermod@users.noreply.github.com>
2020-05-30 12:02:10 +02:00
Martin Kraft
c529d5190a MM-25040: Restrict associated groups to channels when team is group-constrained. (#14619)
* MM-25040: Only return team-associated groups if the team is group-constrained.
MM-25040: Prevents associating a group to a channel if the team doesn't have the group first.

* MM-25040: Fix lints.

* MM-25040: Still add the groupteam if the team is not group-constrained.

* MM-25040: Wraps groupteam upsert in else branch for efficiency.

* MM-25040: Removes unnecessary page iteration.

* MM-25040: Fix typo.

* MM-25040: Moves filtering to SQL.

* MM-25040: Updates tests, check pagination.

* MM-25040: Fix lint error.

* MM-25040: Adds some more group store tests.

* MM-25040: Fix for wrong test parameter.
2020-05-29 10:46:52 -04:00
Mario de Frutos Dieguez
c9cdeba1a7 Move StatusStore.GetByIds away from gorp (#14685)
We're removing the usage of gorp in some of the most used
queries in our system. This is one of them
2020-05-29 11:36:41 +02:00
Martin Kraft
e83cc7357c MM-24517: Add newly created channel admin role to all clients' redux state. (#14635)
* MM-24517: Add newly created channel admin role to redux state.

* MM-24517: Adds comment; fixes lint errors.
2020-05-28 14:38:27 -04:00
Nassim Bounouas
41ddbeb642 MM-21307 Get/Update/Delete user preferences Plugin API (#13962)
* MM-21307 Get/Update/Delete user preferences Plugin API

* MM-21307 additional test case on TestPluginAPIDeleteUserPreferences

* MM-21307 remove useless loop

* Update plugin/api.go

* Update plugin/api.go

* Update plugin/api.go

* Update plugin/api.go

* Update plugin/api.go

* Update plugin/api.go

* gofmt -s

Co-authored-by: mattermod <mattermod@users.noreply.github.com>
Co-authored-by: Jesse Hallam <jesse.hallam@gmail.com>
2020-05-28 14:15:47 -03:00
Agniva De Sarker
79a46dd1d3 MM-24481: Use atomics for load/store of client configs (#14648)
There are 3 client config related variables which are set in regenerateClientConfig
but can be read from public methods in the App struct.

We use the same approach as the license fields in the App struct and use atomic.Value
for modifying them.

Co-authored-by: mattermod <mattermod@users.noreply.github.com>
2020-05-27 22:50:20 +05:30
shred86
c35a18d15c Add ShowFullName property (#14189) 2020-05-27 18:23:51 +02:00
Seweryn Zeman
853e955b62 Change Dockerfile HEALTHCHECK intervals (#14317)
We should not use such a long `HEALTHCHECK` `--interval` as first task check if happening after given time, and before healthcheck returns `0` – **task won't be available** to the Docker networks – meaning that Mattermost won't work until then even if it deployed correctly!

And in Docker envs it happens often – that DB is available all the time, and just MM app is being updated. In this case even if we are healthy since 1s – we need to wait 5min until it goes online.
2020-05-27 17:19:43 +02:00
Farhan Munshi
198fdc8221 [MM-25388] Add telemetry for default picture attribute (#14661)
* MM-25388 Add telemetry for default picture attribute

* Rename to isempty

* rename to isnotempty
2020-05-27 10:24:58 -04:00
Jesús Espino
ae328153d5 Fixing behavior of Replicas and SearchReplicas in canary environments (#14576)
* Fixing behavior of Replicas and SearchReplicas in canary environments

* Trying to fix tests

* Revert "Trying to fix tests"

This reverts commit 3531da9618.

* Revert "Fixing behavior of Replicas and SearchReplicas in canary environments"

This reverts commit 0c05901c84.

* Revert "Disable read/search db replicas in TE/E0 (#14400)"

This reverts commit ef5ac519d9.

* Making the store aware of the license

* Readding the unit tests

* Fixing sqlstor supplier tests

* Adding mutex to ensure license write consistency and fixing tests

* Fixing tests

* Fixing tests

* Shuting down server properly during tests

* Trying to fix tests

* Trying to fix the tests

* Skipping flaky tests

Co-authored-by: mattermod <mattermod@users.noreply.github.com>
2020-05-27 15:42:48 +02:00
Eli Yukelzon
553af3a694 MM-24597 Migrate API handler deleteChannel to be compatible with local mode (#14532)
Co-authored-by: Ibrahim Serdar Acikgoz <serdaracikgoz86@gmail.com>
Co-authored-by: Miguel de la Cruz <miguel@mcrx.me>
Co-authored-by: mattermod <mattermod@users.noreply.github.com>
2020-05-27 16:24:44 +03:00