Commit Graph

1959 Commits

Author SHA1 Message Date
Allan Guwatudde
fd546cdff2 [MM-35039] - Send trial ended email (#17478)
* [MM-35039] - Send trial ended email

* Generations

* Use First name with fallback to username

* Use First name with fallback to username for trial ending email
2021-04-23 21:45:47 +03:00
Carlos Tadeu Panato Junior
246e4f9508 upgrade DB for 5.35 (#17488) 2021-04-23 15:28:01 +02:00
Max Erenberg
9cd50a4e22 [MM-33853] remove CSV row limit in compliance monitoring (#17185) 2021-04-23 09:19:13 -04:00
Doug Lauder
ff657bfdef sync profile images (#17375)
support for synchronizing user's profile image for shared channels.
2021-04-22 17:48:09 -04:00
Allan Guwatudde
0b2c0832f1 [MM-33662] - Mock out CWS in enterprise code (#17305)
* [MM-33662] - Mock out CWS in enterprise code

* Feedback impl

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-04-22 15:25:56 +03:00
Hossein
a1a8f00957 [MM-34838] Remove Ancillary Permissions That Are Purposefully Being Removed (#17466)
* remove ancillary permissions

* Start writing tests

* Move Ancillary Permissions to FrontEnd

* remove function

* remove test

* clean up

* fix comment

* Update api4/permission.go

Co-authored-by: Martin Kraft <martinkraft@gmail.com>

* Update api4/permission.go

* Update api4/permission.go

* license info

* Add Tests

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Co-authored-by: Martin Kraft <martinkraft@gmail.com>
2021-04-21 11:35:47 -04:00
Agniva De Sarker
321645696d MM-31717: Remove HTTP clustering (#17409)
* MM-31717: Remove HTTP clustering

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

```release-note
Gossip clustering mode is now GA and is no longer
available as a choice now. All cluster traffic will always
use the gossip protocol.

The config setting UseExperimentalGossip has no effect
and has only been kept for compatibility purposes.

The setting to use gossip has been removed from admin console.

Upgrade note:
If an existing system is not using gossip, then one cannot
upgrade one node in a cluster and keep the other one to the older
version, if an HA upgrade is intended. All nodes
in the cluster must use a single protocol.

Either the customer must use gossip if they want to do an HA
upgrade. Or, shut down all nodes and bring up all of them
after doing an upgrade.
```

* Trigger CI

* update translations
2021-04-21 10:33:31 +05:30
Max Erenberg
f36f5c74b1 Mm 30807 granular data retention scaffold (#17464) 2021-04-20 13:16:40 -04:00
Agniva De Sarker
4295a1f556 MM-34125: Remove WebSocketDelay feature flag (#17441)
It has been soaked for enough time in community-daily
and also in community. Enabling it for all.

```release-note
TCP_NO_DELAY is disabled for websocket connections
to allow for higher throughput
```

https://mattermost.atlassian.net/browse/MM-34125
2021-04-20 10:10:22 +05:30
Agniva De Sarker
0e0f3f8c2e MM-34983: Remove check for number of data sources (#17431)
In case of Aurora databases, a single endpoint
might load balance between multiple replicas.
In that case, this check is incorrect. Therefore,
we remove it

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

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-04-19 20:30:17 +05:30
Agniva De Sarker
e0efdd708b Revert "Mm 30807 granular data retention scaffold (#16891)" (#17437)
This reverts commit 3ea75332e7.
2021-04-18 22:41:50 +05:30
Max Erenberg
3ea75332e7 Mm 30807 granular data retention scaffold (#16891)
create the necessary tables, models and APIs for the granular data retention policy feature
2021-04-16 11:32:09 -04:00
Doug Lauder
9799fe9be6 MM-34549 shared channels; add users to channel that were already sync'd (#17361)
Fixes a bug and adds a feature for shared channels:
- The Bug: when creating new shared channels, users that had already been sync'd via another channel were not added to the new channel's member list, since the users were not sync'd again. This PR sync's users per channel.
- The Feature: support custom statuses
2021-04-14 14:59:26 -04:00
Maria A Nunez
81c40174e6 Feature: Support Cloud 14-day Trial (#17397)
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Co-authored-by: Nick Misasi <nick.misasi@mattermost.com>
Co-authored-by: Allan Guwatudde <guwats10@gmail.com>
2021-04-14 11:36:36 -04:00
Agniva De Sarker
fa16ecf98a MM-34787: Add colored output for non JSON console logs (#17388)
* MM-34787: Add colored output for non JSON console logs

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

```release-note
A new field EnableColor is added to LogSettings and NotificationLogSettings.
Non-JSON console logs will now be colored if that field is set to true.
```

* Trigger CI
2021-04-13 23:45:56 +05:30
Doug Lauder
f69cb38249 MM-32133 shared channel username collisions (#17347)
Support for handling username collisions between remote clusters. Users belonging to remote clusters have their username changed to include the remote name e.g. wiggin becomes wiggin:mattermost.

@mentions are also modified so the munged username is replaced with the original username when the post is sync'd with the remote the user belongs to.

When adding remote users:
- append the remote name to the username with colon separator
- append the remote name to the email address with colon separator
- store the original username and email address in user props
- when resolving @mentions replace with the stored original username
2021-04-13 10:40:12 -04:00
Max Erenberg
869da7a78b [MM-32044] Reset SAML auth data (#17161)
Automatic Merge
2021-04-13 00:46:30 +02:00
Jesús Espino
35d00b4644 Enable the errorAssertions govet check for mattermost-server code (#17346)
* Enable the errorAssertions govet check for mattermost-server code

* Removing unnecesary change

* Fixing some tests

* Fixing tests

* Fixing more after merge

* Fixing new offending entries

* Fixing small vet checks

* Fixing new cases detected by govet

* Fixing remote_cluster_test errors

* Fixing assertion

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-04-12 12:51:31 +02:00
Max Erenberg
3ad80a2d0f log invalid username (#17345)
Automatic Merge
2021-04-07 20:46:30 +02:00
Ben Cooke
1c3712b344 adding new feature flag (#17308)
Co-authored-by: Benjamin Cooke <benjamincooke@Benjamins-MacBook-Pro.local>
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-04-07 12:12:53 -04:00
Jesús Espino
819e4c0c64 Improve document extraction and including a document extraction command (#17183)
* Add extract documents content command

* Adding the extraction command and making the pure go pdf library as secondary option

* Improving the memory usage and docextractor interface

* Enable content extraction by default in all the instances

* Tiny improvement on archive indexing

* Adding App interface generation and the opentracing layer

* Fixing linter errors

* Addressing PR review comments

* Addressing PR review comments
2021-04-07 13:27:20 +02:00
Hossein
daec0b3201 All Sections to SubSections (#16917)
* initial

* Revert "initial"

This reverts commit 3d631aeecd.

* [MM-32352] Add Experimental Subsections BACKEND (#16887)

Automatic Merge

* update appiface

* Fix app layers

* Ancillary Permissions on backend (#17061)

Automatic Merge

* [MM-32799] Add About Section (#17015)

* Add About Section

* add mock key

* Update role.go

* Update role.go

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

* [MM-33437] Fix config access tags for experimental settings (#17111)

Automatic Merge

* [MM-32794] Reporting Sub Section (#17035)

* test

* revert

* add permissions

* add new permission stuff

* add store mock

* fix bad merge

* gofmt fix

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

* [MM-32343] Environment SubSection (#17054)

* pre-checkout commit

* fix permission for testSiteURL

* pre-merge commit

* increase size of Permissions column in Roles table

* add entry for ENVIRONMENT to testlib/store.go

* use TEXT for Permissions column in Roles table

* use environment subsection permissions for API endpoints

* use subsections permissions for /config/environment

* add suggestions from hahmadia

* update tests to use subsection permissions

* add permissions column back in

* comment out code in upgradeDatabaseToVersion534

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Co-authored-by: Scott Bishel <scott.bishel@mattermost.com>

* MM-32351: Add Compliance Subsections (#17023)

* add subsections for compliance sectin

* add to mock functions

* updates for read job

* fixes

* fix test

* update tests

* update tests

* another test fix

* some cleanup

* update mlog

* fix linting

* Fix bad merges

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Co-authored-by: Hossein <hahmadia@users.noreply.github.com>
Co-authored-by: Hossein Ahmadian-Yazdi <hyazdi1997@gmail.com>

* MM-32347 Site Subsections (#17095)

* Init

* Added migration key in testlib store

* Fix syntax error

* fix bad merge

* fix lint

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Co-authored-by: Scott Bishel <scott.bishel@mattermost.com>

* MM-32350 Integrations (#17097)

* implement server subsections

* fix tests

* update test

* go fmt

Co-authored-by: Hossein Ahmadian-Yazdi <hyazdi1997@gmail.com>

* patch forgotten endpoints

* Adding subsection permissions for Authentication (#17087)

* adding new permissions, migrations to do

* permission migrations and ancilary permissions

* running make app-layers

* fixing tests and lint

* adding permissions to saml

* ldap write permissions

* running make app-layers

* fixing conflict

* making app layers

* clean up and fix tests

* change job type

* fix js error, if site url not returned

Co-authored-by: Benjamin Cooke <benjamincooke@Benjamins-MacBook-Pro.local>
Co-authored-by: Hossein Ahmadian-Yazdi <hyazdi1997@gmail.com>
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Co-authored-by: Scott Bishel <scott.bishel@mattermost.com>

* Update permissions_migrations.go

* gofmt

* upgrade to 535

* gofmt

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Co-authored-by: Max Erenberg <max.erenberg@mattermost.com>
Co-authored-by: Scott Bishel <scott.bishel@mattermost.com>
Co-authored-by: Anurag Shivarathri <anurag6713@gmail.com>
Co-authored-by: Ben Cooke <benkcooke@gmail.com>
Co-authored-by: Benjamin Cooke <benjamincooke@Benjamins-MacBook-Pro.local>
2021-04-06 10:39:48 -04:00
Scott Bishel
2cb82965b0 MM-33905 -always add FeatureFlags to config (#17163)
* always add FeatureFlags to config

* update const to TitleCase

* gofmt

* update method to use 'access:all'

* update method to use 'access:all'

* fix lint

* gofmt

* added comments

* update name of access tag for any

* fix bad save

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-04-06 10:39:36 -04:00
Doug Lauder
02196e04fa MM-27493 Shared channels (MVP) (#17301)
Remote Cluster Service
- provides ability for multiple Mattermost cluster instances to create a trusted connection with each other and exchange messages
- trusted connections are managed via slash commands (for now)
- facilitates features requiring inter-cluster communication, such as Shared Channels
Shared Channels Service
- provides ability to shared channels between one or more Mattermost cluster instances (using trusted connection)
- sharing/unsharing of channels is managed via slash commands (for now)
2021-04-01 13:44:56 -04:00
Eli Yukelzon
480796a1df MM-33708 - Add MentionCountRoot column to ChannelMembers (#17099)
* added new column for root-only mentions

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-04-01 14:43:09 +03:00
Allan Guwatudde
489eaa4605 [MM-32639] - Resend user invite emails (#17113)
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-03-31 13:20:53 -04:00
Eli Yukelzon
ab5925c4de MM-33746 Add TotalMsgCountRoot and MsgCountRoot columns (#17150) 2021-03-31 16:51:02 +03:00
Agniva De Sarker
4ba0c09fc7 MM-34389: Reliable websockets: First commit (#17297)
* MM-34389: Reliable websockets: First commit

This is the first commit which makes some basic changes
to get it ready for the actual implementation.

Changes include:
- A config field to conditionally enable it.
- Refactoring the WriteMessage along with setting the deadline
to a separate method.

The basic idea is that the client sends the connection_id
and sequence_number either during the handshake (via query params),
or during challenge_auth (via added parameters in the map).

If the conn_id is empty, then we create a new one and set it.
Otherwise, we get the queues from a connection manager (TBD)
and attach them to WebConn.

```release-note
NONE
```

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

* Incorporate review comments

* Trigger CI

* removing telemetry

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-03-31 10:05:32 +05:30
catalintomai
ca9f4c9ed8 MM-32882: Add an unread badge/marker to the Main Menu icon and the ‘Plugin Marketplace’ Menu Item (#16992) 2021-03-29 22:55:44 -07:00
Agniva De Sarker
7b1dee4936 MM-33818: Add replica lag metric (#17148)
* MM-33818: Add replica lag metric

We add two new metrics for monitoring replica lag:
- Monitor absolute lag based on binlog distance/transaction queue length.
- Monitor time taken for the replica to catch up.

To achieve this, we add a config setting to run a user defined SQL query
on the database.

We need to specify a separate datasource field as part of the config because
in some databases, querying the replica lag value requires elevated credentials
which are not needed for usual running of the application, and can even be a security risk.

Arguably, a peculiar part of the design is the requirement of the query output to be in a (node, value)
format. But since from the application, the SQL query is a black box and the user can set any query
they want, we cannot, in any way templatize this.

And as an extra note, freno also does it in a similar way.

The last bit is because we need to have a separate datasources, now we consume one extra connection
rather than sharing it with the pool. This is an unfortunate result of the design, and while one extra
connection doesn't make much of a difference in a single-tenant scenario. It does make so, in a multi-tenant scenario.
But in a multi-tenant scenario, the expectation would already be to use a connection pool. So this
is not a big concern.

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

```release-note
Two new gauge metrics were added:
mattermost_db_replica_lag_abs and mattermost_db_replica_lag_time, both
containing a label of "node", signifying which db host is the metric from.

These metrics signify the replica lag in absolute terms and in the time dimension
capturing the whole picture of replica lag.

To use these metrics, a separate config section ReplicaLagSettings was added
under SqlSettings. This is an array of maps which contain three keys: DataSource,
QueryAbsoluteLag, and QueryTimeLag. Each map entry is for a single replica instance.

DataSource contains the DB credentials to connect to the replica instance.

QueryAbsoluteLag is a plain SQL query that must return a single row of which the first column
must be the node value of the Prometheus metric, and the second column must be the value of the lag.

QueryTimeLag is the same as above, but used to measure the time lag.

As an example, for AWS Aurora instances, the QueryAbsoluteLag can be:

select server_id, highest_lsn_rcvd-durable_lsn as bindiff from aurora_global_db_instance_status() where server_id=<>

and QueryTimeLag can be:

select server_id, visibility_lag_in_msec from aurora_global_db_instance_status() where server_id=<>

For MySQL Group Replication, the absolute lag can be measured from the number of pending transactions
in the applier queue:

select member_id, count_transaction_remote_in_applier_queue FROM performance_schema.replication_group_member_stats where member_id=<>

Overall, what query to choose is left to the administrator, and depending on the database and need, an appropriate
query can be chosen.
```

* Trigger CI

* Fix tests

* address review comments

* Remove t.Parallel

It was spawning too many connections,
and overloading the docker container.

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-03-29 21:35:24 +05:30
Daniel Espino García
9d997dbbde Add feature flag for apps (#16851)
* Add feature flag for apps

* Update default to false

* Add plugin version Feature Flag

* Fix typo

* Only force shutdown, and leave the enable status dependant on the user (defaulting to enable)

* Remove unneeded tracking of status

* Handle plugin init on startup for locally installed plugin
2021-03-29 15:53:31 +02:00
Harrison Healey
b3e0db012b MM-27380 Move collapsed categories to server (#17194) 2021-03-26 17:46:56 -04:00
Jesse Hallam
e3ac469ec6 pre-package Incident Collaboration v1.7.0 (#17234) 2021-03-26 10:53:50 -03:00
Elisabeth Kulzer
5329eac020 Upgrade db and version (#17230) 2021-03-25 15:42:27 +01:00
Claudio Costa
28df047d92 Prevent User.Timezone field to overflow DB column capacity (#17220) 2021-03-25 11:38:43 +01:00
Agniva De Sarker
f60b7437da MM-33893: Disable TCP_NO_DELAY for websocket connections (#17129)
* MM-33893: Disable TCP_NO_DELAY for websocket connections

In very large installations, websocket messages cause too much
traffic congestion by sending too small packets and thereby cause
a drop in throughput.

To counter this, we disable the TCP_NO_DELAY flag for websocket
connections. This has shown to give noticeable improvements in
load tests.

We wrap this in a feature flag for now to let it soak in Community
first.

```release-note
NONE
```

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

* fix gorilla specific conn
2021-03-24 21:04:18 +05:30
Claudio Costa
6a65b6ceca [MM-33794] Improve password generation during bulk import (#17147)
Automatic Merge
2021-03-24 10:32:16 +01:00
Mario de Frutos Dieguez
3d845feb7e Split CWS url in two: public and API (#17100)
Signed-off-by: Mario de Frutos <mario@defrutos.org>

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-03-23 15:27:40 +01:00
Eli Yukelzon
0cc72342de MM-33544 is_following prop in getPosts API methods (#17093)
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-03-23 13:31:54 +02:00
Max Erenberg
6a77e24adc MM-28090 User settings api when ldap sync (#16822)
Automatic Merge
2021-03-22 19:02:16 +01:00
Claudio Costa
d3a003dcb2 Address outstanding merging issues with cloud branch (#17160) 2021-03-17 10:39:46 +01:00
Jesús Espino
7208952010 Improve file search results with postgres (#17112)
* Improve file search results with postgres

* Adding channel id to search results

* Fixing file info saves
2021-03-16 11:19:13 +01:00
Jesús Espino
2417fb265d Moving markdown to corelibs (#16916)
* Moving markdown to corelibs

* Fix golangci-lint problem

* Renaming corelibs to pkg

* Fixing golangci-lint

* Renaming from pkg to shared

* Fixing gofmt

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-03-16 11:18:41 +01:00
Alejandro García Montoro
c40f898bd0 Bump Incident Collaboration plugin to v1.6.0 (#17143)
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-03-16 09:55:06 +01:00
Ibrahim Serdar Acikgoz
157f9b5cae update translation string id to be more descriptive (#17002)
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-03-15 18:22:25 +01:00
Max Erenberg
5cb5f0a60a Mm 31258 compliance monitoring csv headers (#16806)
move UserType header into the right column
2021-03-11 13:02:41 -05:00
Allan Guwatudde
05720f627b [MM-33198] - Portal: Send admin welcome email after the installation is complete (#17043)
* [MM-33198] - Portal: Send admin welcome email after the installation is complete

* Send cloud welcome email

* Feedback impl-2

* Fix template

* Temp undo

* Update

* make i18n-extract

* Translations

* Feedback impl-3

* More template fixes

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-03-10 20:39:21 +03:00
Berke Kalkan
f5590d4e5f MM-29726 Allow disabling link previews from certain domains (#16869)
* Add field to config model

Config option for disabling link previews for given domains.

* Refactor functions and corresponding tests

* Expand logic for link preview

Newly added isLinkAllowedForPreview function determines whether a link
should display a preview. It gets corresponding config values consisting
of comma separated domain values, normalizes them and checks for
matches.

* Create tests for link preview restriction

* Fix formatting issue

* Add test cases where images are expected

* Apply suggestions from code review

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

* Apply remaining code suggestions

* Add RestrictLinkPreviews value to telemetries

Co-authored-by: Ibrahim Serdar Acikgoz <serdaracikgoz86@gmail.com>
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Co-authored-by: Harrison Healey <harrisonmhealey@gmail.com>
2021-03-09 12:54:54 -05:00
Jesús Espino
633d82f0ac Remove Custom statuses feature flag (#17075) 2021-03-05 10:21:58 +02:00
Jesús Espino
9cc5089af8 Moving mlog to corelibs (#16915)
* Moving mlog to corelibs

* Regenerating app layers

* Fix golangci-lint problem

* Fixing golangci-lint errors

* Renaming from corelibs to shared

* Renaming from corelibs to shared

* Fixing import

* Fixing merge problems

* Fixing build
2021-03-05 09:18:37 +01:00