Граф коммитов

13070 Коммитов

Автор SHA1 Сообщение Дата
Jesús Espino
d274cf8afa Removing unnecesary SqlStore interface (#16057) 2020-11-20 10:51:58 +01:00
Jesús Espino
5b1a716e2c Removing AppError check from the retry layer (#16307) 2020-11-20 10:32:30 +01:00
Eli Yukelzon
cf4df5fcd2 MM-30048 added thread related socket messages (#16234)
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2020-11-20 11:00:52 +02:00
Deep Baldha
7b515d27f2 MM-30705: remove receiver names for empty struct- InvitePeopleProvider (#16300)
Automatic Merge
2020-11-20 00:15:17 -05:00
Jesse Hallam
2ac83ffac7 MM-30800: prepackage incident management 1.1 (#16323)
* prepackage incident management v1.1 (#16195)

Fixes: https://mattermost.atlassian.net/browse/MM-30800

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>

* update telemetry whitelist

* newer version!

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2020-11-19 16:13:53 -04:00
drraghavendra
537b5a5b67 Linkedin,Facebook links updated inReadme file of mattermost-server (#16186)
Automatic Merge
2020-11-18 22:45:17 -05:00
Maria A Nunez
2ea2293276 Remove cloud_restrictable for cloud billing settings (#16309) 2020-11-18 16:24:34 -05:00
Christopher Speller
ceb1422a5c MM-29709 Client side feature flags (#16212)
* Client side feature flags.

* Fix test.

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2020-11-18 11:11:15 -08:00
Ibrahim Serdar Acikgoz
213345fa2c add manage_remote_clusters permission (#16252) 2020-11-18 18:40:12 +03:00
Agniva De Sarker
09c7f7c445 MM-30704: Change to idiomatic receiver names for model.Session (#16298)
```release-note
NONE
```

https://mattermost.atlassian.net/browse/MM-30704
2020-11-18 20:41:05 +05:30
Ibrahim Serdar Acikgoz
b30acfdee6 [MM-29296] model/user: add lock to source (#16054)
* model/user: add lock to source

* guard rand creation with locking

* use locked random

* remove assignment

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2020-11-18 13:26:18 +03:00
Ibrahim Serdar Acikgoz
50e29cb47a app/user: fix update user error when an e-mail address already in use (#16269)
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2020-11-18 12:31:57 +03:00
Martin Kraft
1b7f47fdc6 MM-29420: Adds missing access to the global relay config settings. (#16273)
Automatic Merge
2020-11-17 21:15:17 -05:00
John Tzikas
5797d6ace3 Add logic to skip duplicate table errors when initializing db (#16270)
* Add logic to skip duplicate table errors when initializing db

* Update store/sqlstore/supplier.go

Co-authored-by: Gabe Jackson <gabe@coffeepowered.co>

* Handle mysql and pg table already exist errors

* Apply PR suggestions
* Fix typo on IsDuplicate
* Update mysql error link to point to the official one

Co-authored-by: Gabe Jackson <gabe@coffeepowered.co>
2020-11-17 17:01:20 -05:00
Nick Misasi
887ef0b5e1 [MM-29515] Don't allow slack imports in cloud installations (#16271)
* Don't allow slack imports in cloud installations

* Update api4/team.go

Co-authored-by: Maria A Nunez <maria.nunez@mattermost.com>

* Add a test case for when the import is restricted in cloud

* Update api4/team_test.go

Co-authored-by: Maria A Nunez <maria.nunez@mattermost.com>

* Check for cloud license instead of restrictsystemadmin

* fix tests

Co-authored-by: Maria A Nunez <maria.nunez@mattermost.com>
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2020-11-17 12:56:17 -05:00
Elisabeth Kulzer
a5e2275b16 DOPS-243: Fix images (#16296)
DOPS-243: Fix images (#16296)

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2020-11-17 18:48:26 +01:00
Agniva De Sarker
221f70a6cb MM-29487: Fix racy TestMuteCommandSpecificChannel (#16290)
The code was doing `go fakeApp.UpdateProductNotices()`
due to which the Store object was accessed in a racy manner
when it was reset if the localcachelayer flag was set.

We fix this by using the StoreOverride functionality
to pre-define what store to use while initializing the server
itself so that there isn't a need to reset the store _after_
the server is set.

We also apply the same fix in the app and api4 layers too
to prevent similar things from happening there.

https://mattermost.atlassian.net/browse/MM-29487

```release-note
NONE
```

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2020-11-17 21:13:35 +05:30
Ben Schumacher
4063f407a1 Use different user-agent for twitter links (#16210) 2020-11-17 14:48:51 +01:00
Agniva De Sarker
eced0cdb72 MM-29981 - optimize markdown.Inspect (#16188)
* MM-29981 - optimize markdown.Inspect

- Cache regexp.MustCompile
- Reuse slice in MergeInlineText
- Remove pointer to slice in closeBlocks
- Pre-allocate slice in ParseLines
- Some more small cleanups

```
name       old time/op    new time/op    delta
Inspect-8    10.5µs ± 3%     6.6µs ± 1%  -37.59%  (p=0.000 n=10+7)

name       old alloc/op   new alloc/op   delta
Inspect-8    6.66kB ± 0%    3.22kB ± 0%  -51.62%  (p=0.000 n=10+9)

name       old allocs/op  new allocs/op  delta
Inspect-8       117 ± 0%        76 ± 0%  -35.04%  (p=0.000 n=10+10)
```

* fix lint

* remove ignore

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2020-11-17 09:12:41 +05:30
Rodrigo Villablanca
95221d9ace GroupStore migration (#15795)
* Migration completed

* Fix tests

* Fix tests

* Fix tests

* Suggestions

* Trigger CI

* Suggestions

* Merge with master

* Migration completed

* Fix typo

* fix err check

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Co-authored-by: Agniva De Sarker <agnivade@yahoo.co.in>
2020-11-17 09:02:36 +05:30
Harrison Healey
2ebc8ec90f MM-20897 Add category muting (#16225)
* Make UpdateSidebarCategories return the original categories

* MM-20897 Add category muting

* Prevent muting the DMs category

* Fix muted state not being stored in the database

* Address feedback

* Address some feedback

* Fix unit tests

* MM-20897 Mute/unmute channels in the database in bulk

* Satisfy golangci-lint
2020-11-16 15:19:01 -05:00
Elisabeth Kulzer
7f6b43a15f DOPS-243 (#16279)
DOPS-243 (#16279)
2020-11-16 17:22:30 +01:00
Mario de Frutos Dieguez
58d362e0c8 Include cloud defaults in the EE release package (#16277)
That defaults file would be used in the cloud installations to set the
initial values for them
2020-11-16 16:52:26 +01:00
Miguel de la Cruz
6c857a4525 [MM-30436] Add support for configuration custom defaults (#16265)
* [MM-30436] Add support for configuration custom defaults

* Addressing review comments

* Addressing PR comments

* Soft fail if the configuration defaults cannot be read

* Directly print error in log message

* Fix linter

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2020-11-16 15:25:48 +01:00
Agniva De Sarker
c82c37a36e MM-28067: Optimize app server startup in tests (#16263)
* MM-28067: Optimize app server startup in tests

For every test, we would wipe out the database and then start
the server again. This would run through all the migrations
and create new rows in Systems and Roles table every time.
As a result, this was consuming a lot of setup time for every test.

We optimize this by preloading the DB with dummy data in the roles
and systems table so that the server code just skips over those migrations.
This is completely forward compatible and adding new migrations does not
need to generate the sql files again. Only in case of schema changes to the
roles or systems table, this would need to be done.

It is unlikely the Systems table schema will get changed. The Roles table
might change in future but it's a comparatively rare event. Given the reduction
in CI runtime we are seeing, it's a worthy optimization.

We also apply some more optimizations:
- Coalesce multiple UpdateConfig calls into a single one. Each UpdateConfig call
has to do a json marshal which would take precious CPU cycles. It's much more
efficient to do everything in a single call.
- Remove unnecessary debug.FreeOSMemory in reload config. This was an artifact
from old days and is no longer required.

Numbers:
Results show a full **2 minutes** shaved off the test runtime. Earlier, tests
would take around 16 minutes. Now they take 14 minutes.

```release-note
NONE
```

* fix app package
2020-11-16 13:55:32 +01:00
Dexter Chua
e162c6c787 Indicate deleteBy in post_deleted websocket event (#15332)
This lets the client know who deleted the post. This information is
stored in the database, but cannot be retrieved from an API endpoint
because the API does not return information about deleted post.

Currently, the information is only sent to system administrators.
2020-11-16 11:56:29 +01:00
Doug Lauder
277f886b3f MM-30212 Support dynamic autocomplete for built-in slash commands (#16196)
Support added for dynamic auto-completion lists for built-in slash commands.

* a moniker within the fetch url determines whether the request should be sent via HTTP(S) or routed internally to a built-in command. The moniker is of the form builtin: followed by the name of the built-in command to use. e.g. builtin:share would be become a call to the share command to fetch auto-completion items.

* command providers implement the optional DynamicListProvider interface to indicate they can provide dynamic auto-completion.
2020-11-13 21:10:07 -05:00
Ibrahim Serdar Acikgoz
46a409aef6 app/server_test: make sure sentry is ready to be setup (#16260) 2020-11-13 19:10:10 +03:00
Farhan Munshi
c9a4a475d3 [MM-28717] Refactor applyMultiRoleFilters to use sq builder (#15500)
* Refactor apply multi role filters and add role filters to get all profiles

* Add some tests

* Fix tests

* Fix lint

* Trigger CI

* Rename param to make more sense

* Tie get filtered user stats to usermanagement read users

* Dont filter out other system roles when searching for team members or team admins only filter out system admins

* add new permissions

* add migration

* fix test

* remove system roles as default permissions

* implement changes discussed with dennis

* add read only and fix i18n

* use model consts instead of strings

* turn the permissions into pseudo constants

* Update read only default permissions

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Co-authored-by: Hossein Ahmadian-Yazdi <hyazdi1997@gmail.com>
2020-11-13 10:57:57 -05:00
Nick Misasi
1d15900f84 [MM-29999] User Limit Email Notifications (Part 2) (#16220)
* Adding files commiting to do something else

* Stashing to merge master

* Adding files, commit of working code, pre-test

* Changing up logic according to new conversations, adding template and functions for 7 day and 14 day emails

* Add subscription active check

* Add a comment around subscription status

* Fix i18n

* Update jobs/cloud/worker.go

Co-authored-by: Maria A Nunez <maria.nunez@mattermost.com>

* Add a check for cloud license and exit early

* remove log

* Update jobs/cloud/worker.go

Co-authored-by: Maria A Nunez <maria.nunez@mattermost.com>

* Remove case for 91st day

* Change var name

* Fix i18n

* Change value for dates in email

* Add email template and send logic for support email on 30th day of arrears

* Fix EETests?

* add one to the day so the count starts on first day of next cycle

* use the license for the enabled check

* Moved scheduler and worker into enterprise

* Add the user count to the support email

* remove a line

* Use the date for the 14 day email

* Fix for design review

* More font changes

* Fixes for PR

* Change feature flag name

* Add cloud_interface to einterfaces/jobs

* Add back & for running job server

* Remove unused constant

Co-authored-by: Maria A Nunez <maria.nunez@mattermost.com>
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2020-11-12 09:07:31 -05:00
Agniva De Sarker
cae59d327c MM-29486: Fix racy test TestPatchChannelModeration (#16256)
* MM-29486: Fix racy test TestPatchChannelModeration

- We avoid appending to the slice in `(r *Role) IsValidWithoutId`
by just iterating the 2 slices separately.
- We pass deep copies of channels to prevent racy modification.

https://mattermost.atlassian.net/browse/MM-29486

```release-note
NONE
```

* fix lint

* simplify perm check

* improve more

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2020-11-12 15:26:35 +05:30
Agniva De Sarker
42c785218d MM-29488: Fix racy test TestScheduler (#16257)
* MM-29488: Fix racy test TestScheduler

We iterate the nextRunTimes slice only after stopping the
scheduler.

And since we are checking the slice 3 times, we split
the test into 3 sub-tests, every time starting a new scheduler
and running the same steps again.

https://mattermost.atlassian.net/browse/MM-29488

```release-note
NONE
```

* incorporate review comments

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2020-11-12 09:39:19 +05:30
cpanato
0f4c6bc074 fix git commit hash to use in the docker image 2020-11-11 19:27:45 +01:00
Agniva De Sarker
87a5510adc MM-29479: Fix racy test TestSidebarCategory (#16255)
Automatic Merge
2020-11-11 12:49:56 -05:00
cpanato
3782b3e21b fix docker push 2020-11-11 18:25:53 +01:00
cpanato
37e8fe8e33 fix build branch pipeline 2020-11-11 17:42:07 +01:00
Carlos Tadeu Panato Junior
2c08ff1299 build: push git commit hash as tags as well (#16261) 2020-11-11 17:11:48 +01:00
John Tzikas
ab50fa155b Remove unused argument on runServer (#16237) 2020-11-11 10:09:30 -04:00
Weblate (bot)
9a62395087 Translations update from Weblate (#16246)
* Translated using Weblate (Portuguese (Brazil))

Currently translated at 97.2% (2006 of 2063 strings)

Translation: mattermost-languages-shipped/mattermost-server_master
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/pt_BR/

* Translated using Weblate (Japanese)

Currently translated at 98.9% (2042 of 2063 strings)

Translation: mattermost-languages-shipped/mattermost-server_master
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/ja/

Translated using Weblate (Japanese)

Currently translated at 97.8% (2018 of 2063 strings)

Translation: mattermost-languages-shipped/mattermost-server_master
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/ja/

Co-authored-by: rodrigocorsi <rodrigocorsi@gmail.com>
Co-authored-by: kaakaa <stooner.hoe@gmail.com>
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2020-11-10 09:34:26 +01:00
Agniva De Sarker
0ca8cb36b4 MM-26425: Make URL parsing for image proxy more robust (#16197)
* MM-26425: Make URL parsing for image proxy more robust

- We don't bypass protocol relative URLs.
- We don't bypass hostnames with a similar prefix.

https: //mattermost.atlassian.net/browse/MM-26425

```release-note
NONE
```

* fix tests and incorporate review comments

* Handle opaque URLs

* Fix path tests

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2020-11-10 13:06:59 +05:30
Agniva De Sarker
39b5b601f8 MM-30026: Use DB master when getting team members from a session (#16170)
* MM-30026: Use DB master when getting team members from a session

A race condition happens when the read-replica isn't updated yet
by the time a session expiry message reaches another node in the cluster.

Here is the sequence of events that can cause it:
- Server1 gets any request which has to wipe session cache.

- The SQL query is written to DB master, and a cluster message is propagated
to clear the session cache for that user.

- Now before the read-replica is updated with the master’s update,
the cluster message reaches Server2. The session cache is wiped out for that user.

- _Any random_ request for that user hits Server2. Does NOT have to be
the update team name request. The request does not find the value
in session cache, because it’s wiped off, and picks it up from the DB.
Surprise surprise, it gets the stale value. Sticks it into the cache.

By now, the read-replica is updated. But guess what, we aren’t going to
ask the DB anymore, because we have it in the cache. And the cache has the stale value.

We use a temporary approach for now by introducing a context in the DB calls so that
the useMaster information can be easily passed. And this has the added advantage of
reusing the same context for future DB calls in case it happens. And we can also
add more context keys as needed.

A proper approach needs some architectural changes. See the issue for more details.

```release-note
Fixed a bug where a session will hold on to a cached value
in an HA setup with read-replicas configured.
```

* incorporate review comments

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2020-11-10 10:43:45 +05:30
Agniva De Sarker
6c71fbaebd MM-29478: Fix race in TestNotifyClusterEvent (#16240)
The messages slice was accessed in a race manner. We protect it
with a mutex

```release-note
NONE
```

https://mattermost.atlassian.net/browse/MM-29478
2020-11-09 19:25:51 +05:30
rishabh710
ce28d41aef Update README.md (#16224)
addition of contributing section
2020-11-09 11:49:04 +01:00
John Tzikas
ed3ad65756 Fix misspelled function name (#16236) 2020-11-09 11:32:21 +01:00
Eli Yukelzon
45e340b5be MM-29987 Implement new collapsed threads API (#16091) 2020-11-08 10:36:46 +02:00
Joram Wilander
483441cea2 Soft fail on cloud user limit warnings when creating user (#16230) 2020-11-07 11:39:32 -05:00
Scott Bishel
3b580c03e9 MM-29223-Retrieve Compliance (#15825)
* Revert EN JSON stuff

* updat en.json

* Update en.json

* add unit test, update download for filename

* update to use filepath.Join

* linter errors

Co-authored-by: Hossein Ahmadian-Yazdi <hyazdi1997@gmail.com>
Co-authored-by: Hossein Ahmadian-Yazdi <hahmadia@users.noreply.github.com>
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2020-11-06 17:56:56 -07:00
Harrison Healey
dc030bebbf MM-30090 Add telemetry for ManagedResourcePaths (#16221) 2020-11-06 08:32:37 -05:00
Jesús Espino
b08b51d52d MM-30300: Add coalesce to get null content as empty string on FileInfo store (#16216)
* MM-30300: Add coalesce to get null content as empty string on FileInfo store

* Making explicit the fields get from the FileInfo table

* Addressing PR review comments
2020-11-06 12:49:15 +01:00
Miguel de la Cruz
d2ec53f1e9 Local mode migration for webhook endpoints (#16094)
* Migrate update/list/show webhook endpoints to local mode

* Fix shadow errors

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2020-11-06 11:09:41 +01:00