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

1813 Коммитов

Автор SHA1 Сообщение Дата
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
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
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
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
Eli Yukelzon
45e340b5be MM-29987 Implement new collapsed threads API (#16091) 2020-11-08 10:36:46 +02:00
Harrison Healey
059672ba73 MM-30090 Add ManagedResourcePaths setting (#16213) 2020-11-05 11:07:03 -05:00
Agniva De Sarker
66731e2740 MM-29980: Optimize profilesInChannels cache to fast path (#16116)
* MM-29980: Optimize profilesInChannels cache to fast path

We add one more message type to the fast path- profiles in channels. There
are 2 primary reasons for this:

- This is not really a new model type, but just a map of users. And users already use
the fast path. So we can get some more gains without really investing much more code.
- A more important reason is that with the upcoming striped mutex changes, we will get
a higher throughput at the cost of a bit more CPU utilization. The reason being that
since less amount of time will be spent in lock-contention, the CPU is free to do more
stuff. So this change is to counter that increase.

As usual, this gives much better performance than the original decoder.

Micro-benchmark results
```
name               old time/op    new time/op    delta
LRU/UserMap=new-8    16.6µs ± 3%     3.9µs ± 4%  -76.15%  (p=0.000 n=10+10)

name               old alloc/op   new alloc/op   delta
LRU/UserMap=new-8    4.78kB ± 0%    2.74kB ± 0%  -42.65%  (p=0.000 n=10+10)

name               old allocs/op  new allocs/op  delta
LRU/UserMap=new-8      38.0 ± 0%      30.0 ± 0%  -21.05%  (p=0.000 n=10+10)
```

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

Here are some results from a load test. The comparison is done with a 2 node cluster; one running master
and one running with this patch so that it's easier to compare. The total users are 2000.

<See PR>

```release-note
NONE
```

* Fix gofmt

* Trigger CI
2020-11-04 10:08:10 +05:30
Agniva De Sarker
4758408699 MM-29979: make websocket writes zero-alloc (#16115)
This reverts commit 31dac80e66.
2020-11-04 10:05:10 +05:30
Ikko Ashimine
bec4e361a9 Fix typo in comment (#16198)
occuring -> occurring
2020-11-03 13:14:21 +01:00
Jesús Espino
24621a22ed Add the content field to FileInfo (#15749)
* Add the content field to FileInfo

* Fixing the upgrade code

* Trying to fix the text-scheme

* Fixing test-schema

* Fixing test-schema

* Moving the migration to the next version
2020-11-02 15:43:48 +01:00
Eli Yukelzon
fe352ab57f MM-29703 Mark threads as read when channels are marked (#15994)
Co-authored-by: Jesús Espino <jespinog@gmail.com>
2020-10-30 17:00:21 +02:00
Christopher Speller
1aadd36644 MM-28859 Add feature flag managment system using split.io and remove viper. (#15954)
* Add feature flag managment system using split.io and remove viper.

* Fixing tests.

* Attempt to fix postgres tests.

* Fix watch filepath for advanced logging.

* Review fixes.

* Some error wrapping.

* Remove unessisary store interface.

* Desanitize SplitKey

* Simplify.

* Review feedback.

* Rename split mlog adatper to split logger.

* fsInner

* Style.

* Restore oldcfg test.

* Downgrading non-actionable feature flag errors to warnings.

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2020-10-29 15:54:39 -07:00
Harrison Healey
8bb772638c MM-29067 Add deterministic IDs for default sidebar categories (#16030)
Automatic Merge
2020-10-29 10:24:01 -04:00
Maria A Nunez
5b8b792c4c Added Subscription missing field for LastInvoice (#16111) 2020-10-28 16:46:28 -04:00
Mario de Frutos Dieguez
f5531a5a43 [MM-29523] EmailVerified flag can be user as parameter (#16031)
* EmailVerified flag can be used as a parameter

But only when if the user creator is an admin
2020-10-27 10:41:20 +01:00
Ben Schumacher
76f1bfb941 [MM-29361] Send cloud flag with Marketplace requests (#15913) 2020-10-26 21:57:19 +01:00
Mario de Frutos Dieguez
b68f171162 [MM-29157] Cloud invoices logic (#16056)
* Cloud invoices logic

This commit includes all the code needed to get and print invoices
from CWS
2020-10-26 18:17:55 +01:00
Miguel de la Cruz
8f895908fc [MM-29220] Adds a client function that retrieves the full status report (#15727)
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2020-10-26 15:45:58 +01:00
Agniva De Sarker
72432ab3ff MM-27909: Add manage_shared_channels permission (#15601)
* MM-27909: Add manage_shared_channels permission

We add a new permission to manage shared channels.

It's a channel scoped permission and only the system admin
has that by default.

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

* change to system scoped

* Trigger CI

* Trigger CI

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2020-10-26 15:54:50 +05:30
Devin Binnie
79b5350576 [MM-29937] Don't allow email and contact name to be updated from the MM app (#16058)
* [MM-29937] Don't allow email and contact name to be updated from the MM app

* Switched to use omitempty
2020-10-23 15:39:36 -04:00
Scott Bishel
f46661d7a9 MM-28882:ignore guest ldap sync (#15936)
* add ignoreGuestsLdapSync to config, update interface

* update interface

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2020-10-21 20:12:12 -06:00
Scott Bishel
efc3304fe1 MM-29522:fix typo in constant name (#15933)
* fix type in constant name

* fix lint

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2020-10-21 16:59:54 -06:00
Devin Binnie
73a1c95137 [MM-28218] API hookup for updating company info and address in MM app (#15974) 2020-10-20 11:46:58 +02:00
Ibrahim Serdar Acikgoz
c05ee81c9f [MM-28125] einterface/oauthprovide: return parsing errors (#15426)
* einterface/oauthprovide: return parsing errors

* Update app/oauth.go

* reflect review comments

* fix var name error

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2020-10-19 18:07:20 +03:00
Nick Misasi
90738de75f Add webhook event for when user status changes from activated to deactivated and vice versa (#15990)
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2020-10-19 10:29:43 -04:00
Devin Binnie
9b1dee7087 [MM-29723] Added websocket event constant for updating the payment status for cloud (#15988) 2020-10-16 13:23:49 -04:00
Eli Yukelzon
b5047e51fe on prem/cloud validation fixed (#15972) 2020-10-15 18:01:31 +03:00
Eli Yukelzon
8844141df3 MM-28249 Auto follow threads (#15878)
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2020-10-15 18:01:16 +03:00
Scott Bishel
8e78526c84 remove ability to update SAML admin filter settings (#15932) 2020-10-13 09:55:18 -06:00
Farhan Munshi
6766853f8a [MM-28533] [MM-28532] [MM-28531] Fixes several bugs with sysconsole_write_usermanagement (#15559)
* MM-28533 Fix incorrect permission check for reset password

* Allow write users to edit other users, promote and demote guests

* Update ancillary perms for PERMISSION_SYSCONSOLE_WRITE_USERMANAGEMENT_USER

* MM-28532

* Dont allow non sysadmin to update passwords / reset passwords / patch user on sysadmins

* MM-28532: Updates test.

* MM-28533: Merge fix.

* MM-28533: Adds ability for new roles to activate/deactivate non-system-admin users.

Co-authored-by: Martin Kraft <martin@upspin.org>
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2020-10-07 17:41:46 -06:00
Nick Misasi
25fd59a435 Add IsPaidTier to cloud Subscription type (#15857) 2020-10-07 09:58:07 -04:00
Michael Kochell
42f539fa57 [MM-27942] Request arch-specific plugin (#15436)
* request arch-specific plugin

* rename arch/architecture to platform

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2020-10-05 13:01:33 -04:00
Devin Binnie
ebd3e6aa49 [MM-28217] Server API to serve up cloud customer information (#15656)
* [MM-28217] Server API to serve up cloud customer information

* Added missing client4 method

* merge'd

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2020-10-05 08:46:52 -04:00
Eli Yukelzon
b8ceb610e6 MM-27353 Mini image previews (#15376) 2020-10-02 11:14:57 +03:00
Ben Schumacher
6d7c5c5bf3 Bump app version to 5.30 (#15612)
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2020-10-02 00:28:56 +02:00
Maria A Nunez
54fa796f0a Removed cloud_restrictable from PluginSettings.Enabled (#15725) 2020-10-01 15:53:36 -04:00
Devin Binnie
2403aae0c4 [MM-28211] API pass-thru to the CWS for getting subscription (#15666)
* API pass-thru to the CWS for getting subscription

* Remove use of parameter in favour of env var

* Remove unnecessary param

* Removed unnecessary fields and added client4 method

* Some cleanup

* Translation fix

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2020-10-01 13:14:48 -04:00
Eli Yukelzon
595248b10e MM-28247 Threads metadata table (#15571) 2020-10-01 18:48:38 +03:00
Agniva De Sarker
0e90606547 MM-29011: Add feature flag for shared channels (#15585)
* MM-29011: Add feature flag for shared channels

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

* gofmt

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2020-10-01 10:37:15 +05:30
Mario de Frutos Dieguez
ab816b18ce [MM-28841] Filter settings sent to the client based on tag (#15578)
* Filter settings sent to the client based on tag

Right now we're filtering in client the sections based on the
RestrictSystemAdmin setting but we're still sending those
settings through the API call.

In this PR we include a new tag cloud_restrictable and some
method to remove those settings/fields from the final JSON
sent to the client
2020-09-30 21:09:56 +02:00
Agniva De Sarker
886c4898d8 MM-28548: Change default data source to postgres (#15553)
* MM-28548: Change default data source to postgres

We now move to start using postgres as our default database.

* Add connect_timeout

* Trigger CI

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2020-09-30 19:03:41 +05:30
Christopher Speller
e974b7b9be MM28858 Basic framework for use of feature flags. Enviroment variable overrides. (#15544)
* Basic framework for use of feature flags. Enviroment variable overrides.

* Use Apperr instead of error number increments.

* Undo random viper change.

* Update model/config_test.go

Co-authored-by: Jesse Hallam <jesse.hallam@gmail.com>

Co-authored-by: Jesse Hallam <jesse.hallam@gmail.com>
2020-09-29 21:41:22 -07:00
Eli Yukelzon
c298678663 MM-28835 Configure/update notices setting for TeamAdmin (#15632) 2020-09-29 15:17:38 +03:00
catalintomai
1c0d590c81 Add AWS Metering service support (#15290) 2020-09-28 11:43:08 -07:00
Maria A Nunez
50e37068b5 MM-27147 - /cloud api endpoints (#15626) 2020-09-28 12:18:47 -04:00
Shota Gvinepadze
f73157dd8f Fix command url validation (#15239)
* Fix command url validation

* Add Host and Scheme check in IsValidHttpUrl func

* Add unit tests

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2020-09-28 17:59:04 +04:00