Commit Graph

13300 Commits

Author SHA1 Message Date
Atanas Alexandrov
cda69d4dd7 [NO-TICKET] Remove unused function attributes (#16878) 2021-02-08 14:41:07 +05:30
John Tzikas
4a60cdaf4f Avoid possible false possitives when generating team names (#16856) 2021-02-08 11:06:40 +02:00
Claudio Costa
3beb09d62c Fix flaky test (#16874) 2021-02-05 16:31:53 +01:00
SimonSimonB
ffebfbf56f Fix initialisms/app (#16818)
Automatic Merge
2021-02-05 11:22:27 +01:00
Jesse Hallam
4a8496ef7c MM-32569: prepackage Incident Collaboration 1.3.1 (#16866) 2021-02-04 17:18:32 -04:00
Mahmudul Haque
a63dea6c55 unparam lint (#16771)
* fixed: `identifier` is unused lint error

* make saveMultipleMembersT method saveMultipleMembers

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-02-04 11:08:05 +05:30
Chetanya Kandhari
78ccf8a775 Send user updated websocket event on plugin.UpdateUser (#16604)
* Send user updated websocket event on plugin.UpdateUser

* Changes from review
2021-02-04 10:19:32 +05:30
Claudio Costa
e77a3923c9 [MM-32389] Fix FeatureFlags section erroneously getting written to config (#16836)
* Fix FeatureFlags section erroneously getting written to config

* Avoid invoking config listeners if config has not changed

* Avoid resetting feature flags on store creation
2021-02-03 21:03:09 +01:00
Allan Guwatudde
ddd9439706 [MM-31497] - Prevent end users from inviting people and exceeding the free tier limits (#16786)
* [MM-31497] - Prevent end users from inviting people and exceeding the free tier limits

* Update error

* Commit forgotten code

* Chnage impl-1

* Change impl-2

* Remove test

* Include tier status

* Renable permissions check

* Change endpoint name

* Update endpoint

* Update api4/cloud.go

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

* Add test for new endpoint

* Format code

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Co-authored-by: Maria A Nunez <maria.nunez@mattermost.com>
2021-02-03 18:56:40 +03:00
Devin Binnie
d489868f28 Add 'files' as a reserved team (#16823)
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-02-02 16:07:28 -05:00
Weblate (bot)
0ea3b0f17d Translations update from Weblate (#16841)
* Translated using Weblate (Chinese (Simplified))

Currently translated at 98.9% (2101 of 2124 strings)

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

* Translated using Weblate (Swedish)

Currently translated at 100.0% (2127 of 2127 strings)

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

Translated using Weblate (Swedish)

Currently translated at 100.0% (2126 of 2126 strings)

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

Translated using Weblate (Swedish)

Currently translated at 99.9% (2125 of 2126 strings)

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

Translated using Weblate (Swedish)

Currently translated at 100.0% (2124 of 2124 strings)

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

* Translated using Weblate (Turkish)

Currently translated at 100.0% (2126 of 2126 strings)

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

Translated using Weblate (Turkish)

Currently translated at 100.0% (2125 of 2125 strings)

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

* Translated using Weblate (Japanese)

Currently translated at 100.0% (2127 of 2127 strings)

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

Translated using Weblate (Japanese)

Currently translated at 100.0% (2126 of 2126 strings)

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

* Translated using Weblate (Dutch)

Currently translated at 100.0% (2127 of 2127 strings)

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

Translated using Weblate (Dutch)

Currently translated at 100.0% (2126 of 2126 strings)

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

* Translated using Weblate (Bulgarian)

Currently translated at 100.0% (2127 of 2127 strings)

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

Translated using Weblate (Bulgarian)

Currently translated at 100.0% (2126 of 2126 strings)

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

Co-authored-by: aeomin <lin@aeomin.net>
Co-authored-by: majo <martinjohnson@bahnhof.se>
Co-authored-by: Kaya Zeren <kayazeren@gmail.com>
Co-authored-by: kaakaa <stooner.hoe@gmail.com>
Co-authored-by: Tom De Moor <tom@controlaltdieliet.be>
Co-authored-by: Nikolai Zahariev <nikolaiz@yahoo.com>
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-02-02 17:48:38 +01:00
Atanas Alexandrov
a31f666019 [NO-TICKET] Cleanup - remove unused code (#16828) 2021-02-02 11:28:31 +01:00
Agniva De Sarker
57f2e7dcd4 MM-5639: Write panic to log on the way out (#16808)
* MM-5639: Write panic to log on the way out

We introduce a panic pass-through layer which logs
the panic at a critical level before crashing.
This helps customers to easily get the panic output
in their logging infrastructure, rather than having to
go through journaltctl logs.

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

```release-note
Server crashes due to runtime panics are now captured
as a log line.
```

* re-arrange panic order

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-02-02 10:03:07 +05:30
Hossein
01f264cd62 [MM-31790] Support Packet Generation BACKEND (#16667)
* init commit

* clean up the code

* make mocks

* fix translations

* mocks and lint fixes

* add tests

* little fixes

* Update i18n/en.json

Co-authored-by: Scott Bishel <scott.bishel@mattermost.com>

* Update i18n/en.json

Co-authored-by: Scott Bishel <scott.bishel@mattermost.com>

* Update i18n/en.json

Co-authored-by: Scott Bishel <scott.bishel@mattermost.com>

* Update i18n/en.json

Co-authored-by: Scott Bishel <scott.bishel@mattermost.com>

* Update i18n/en.json

Co-authored-by: Scott Bishel <scott.bishel@mattermost.com>

* Address Comments

* fix i18n

* update api endpoint

* add enable file and file level for conditional show of banner

* Address Comments

* Make it more clear about returns

* Create zip file utility function

* update en.json

* address comments

* write tests

* check for data in test

* remove warning string

* Correct expected and actual

* set database through environment variables

* reset environment variable at end of test

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Co-authored-by: Scott Bishel <scott.bishel@mattermost.com>
2021-02-01 15:18:52 -05:00
Daniel Espino García
745d61f388 Fix cleanup threads to properly handle not found errors (#16797)
Automatic Merge
2021-02-01 15:52:27 +01:00
Daniel Espino García
ff970e080b [MM-32253] Fix "Cannot mark unread a DM message in a thread" (#16794)
Automatic Merge
2021-02-01 14:52:27 +01:00
Eli Yukelzon
13616cac0f MM-31711 - Implement cursor paging for threads (#16748)
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-01-31 12:28:14 +02:00
Eli Yukelzon
bb7e5b6e9d MM-31712 Server/API: Unreads-only filter for GetUserThreads (#16660)
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-01-31 11:54:35 +02:00
Ben Schumacher
c38dd22261 [MM-30292] Don't include prepackaged plugin into Marketplace response for cloud (#16543) 2021-01-31 09:17:46 +01:00
Agniva De Sarker
9572293c57 Bump up minimum required Go version (#16825)
The Makefile has a command to validate Go version.
We bump it up to require 1.15.
2021-01-29 14:01:13 +05:30
Claudio Costa
9c9fbe6dd9 [MM-32234] Fix config.json getting reset (#16805)
* Add support for read-only config stores

* Allow read/write config store for plugin commands that require it
2021-01-28 20:04:17 +01:00
Eli Yukelzon
77da23e84b MM-31713 Server/API: GetUserThread method (#16659)
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-01-28 18:07:39 +02:00
Mattermost Build
c14194d78b Bump version (#16813)
Automatic Merge
2021-01-28 13:15:17 +01:00
Agniva De Sarker
5b45b0762e MM-31993: Add flag to disable gossip compression (#16701)
* MM-31993: Add flag to disable gossip compression

Load tests have shown that our workload is not very suitable
to LZW compression. And in fact, compressing leads to more
network bandwidth than less. So we are spending more CPU cycles,
and creating more traffic, leading to a lose-lose situation.

We add a flag to control this behavior. Ideally, this should not
be a flag in the first place, since there is never a need to enable this
because clearly there is no benefit.

But to keep our community servers working, we need to be able
to configure this.

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

```release-notes
Add a flag to disable compression in the Gossip protocol.

By default the value of the flag is false, which is not the existing
default. Therefore, this will cause incompatibility issues during upgrade
where servers of different versions are part of the same cluster.
It is recommended to completely shutdown a cluster, and then do an upgrade.
```

* flip flag to true

* Trigger CI

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-01-28 11:41:03 +05:30
Agniva De Sarker
2846ad9f93 MM-31391: Add max connection idle timeout to config (#16792)
* Update config.go

* Update telemetry.go

* Update store and store test

* Update settings.go

* use new error code

* Trigger CI

Co-authored-by: Haardik Dharma <dharmahaardik08@gmail.com>
2021-01-28 09:37:15 +05:30
Arjuna Marambe
5f16fc644a 15249 sync.pool (#16103)
* use sync.pool for session

* added back to sync pool

* reverted change

* added a new line

* added back session object

* added back session object

* added back session object

* revert

* refactored into function

* added the session object back into the pool

* work in progress

* work in progress

* work in progress

* code review comments

Co-authored-by: Arjuna Marambe <arjunam@buildxact.com>
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-01-27 19:58:24 +01:00
maxerenberg
7f8850398c MM-32018 update URL endpoint for DownloadComplianceReport function (#16700) 2021-01-27 09:06:35 -05:00
Amy Blais
920f1418ef Update version.go (#16779) 2021-01-27 12:14:40 +01:00
Ben Schumacher
d9a890e73f Update Bundled plugin packages for v5.32 (#16302) 2021-01-26 19:43:51 +01:00
camgraff
02523cb186 [MM15037] Stop sending notifications to user whose Oauth bot posted (#15953)
Co-authored-by: Cam Graff <cameron@woodridgesoftware.com>
2021-01-26 16:33:44 +01:00
Dmitry Pichugin
4b4fc58e7f [MM-0] - fix return wrapped error when net.Listen returns error (#16652) 2021-01-26 12:57:21 +01:00
Ibrahim Serdar Acikgoz
3652bc838f storetest/channel_store: update a stop word (#16784) 2021-01-26 09:16:38 +03:00
Eli Yukelzon
dc6a8711b9 ignore server version for cloud instances (#16782) 2021-01-25 17:47:04 -07:00
Weblate (bot)
899d60ad41 Translations update from Weblate (#16788)
* Translated using Weblate (Swedish)

Currently translated at 100.0% (2123 of 2123 strings)

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

Translated using Weblate (Swedish)

Currently translated at 100.0% (2123 of 2123 strings)

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

Translated using Weblate (Swedish)

Currently translated at 100.0% (2122 of 2122 strings)

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

Translated using Weblate (Swedish)

Currently translated at 100.0% (2121 of 2121 strings)

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

* Translated using Weblate (Dutch)

Currently translated at 100.0% (2124 of 2124 strings)

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

Translated using Weblate (Dutch)

Currently translated at 100.0% (2123 of 2123 strings)

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

Translated using Weblate (Dutch)

Currently translated at 100.0% (2123 of 2123 strings)

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

* Translated using Weblate (Turkish)

Currently translated at 100.0% (2123 of 2123 strings)

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

Translated using Weblate (Turkish)

Currently translated at 100.0% (2123 of 2123 strings)

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

* Translated using Weblate (Bulgarian)

Currently translated at 100.0% (2123 of 2123 strings)

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

Translated using Weblate (Bulgarian)

Currently translated at 100.0% (2123 of 2123 strings)

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

* Translated using Weblate (Japanese)

Currently translated at 100.0% (2123 of 2123 strings)

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

* Update translation files

Updated by "Cleanup translation files" hook in Weblate.

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

* Translated using Weblate (Romanian)

Currently translated at 100.0% (2124 of 2124 strings)

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

Translated using Weblate (Romanian)

Currently translated at 100.0% (2123 of 2123 strings)

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

* Translated using Weblate (Spanish)

Currently translated at 96.7% (2054 of 2124 strings)

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

* Translated using Weblate (Turkish)

Currently translated at 99.9% (2123 of 2124 strings)

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

Translated using Weblate (Dutch)

Currently translated at 100.0% (2124 of 2124 strings)

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

Translated using Weblate (Spanish)

Currently translated at 96.7% (2054 of 2124 strings)

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

Co-authored-by: majo <martinjohnson@bahnhof.se>
Co-authored-by: Tom De Moor <tom@controlaltdieliet.be>
Co-authored-by: Kaya Zeren <kayazeren@gmail.com>
Co-authored-by: Nikolai Zahariev <nikolaiz@yahoo.com>
Co-authored-by: kaakaa <stooner.hoe@gmail.com>
Co-authored-by: Viorel-Cosmin Miron <cosmin@uhlhost.net>
Co-authored-by: Elias  Nahum <elias@mattermost.com>
Co-authored-by: Elisabeth Kulzer <elisabeth.kulzer@mattermost.com>
2021-01-25 23:29:59 +01:00
Agniva De Sarker
f4255ed52e Enable govet check for empty strings (#16785)
Adds the check for https://github.com/mattermost/mattermost-server/issues/16674
in the Makefile

```release-note
NONE
```
2021-01-25 21:45:57 +05:30
Madhav Hugar
94c24eea20 Fix empty string comparison issues in the codebase (#16686)
Automatic Merge
2021-01-25 11:15:17 +01:00
Claudio Costa
200a56fa5a [MM-28423] Implement ImportDelete job (#16588)
* Implement ImportDelete job

* Add missing translation

* Improve logging

* Avoid deleting the file in case of errors
2021-01-25 10:40:30 +01:00
Doug Lauder
b932e0fb25 MM-32248 streamline serialization auto-generation (#16780)
* streamline serialization auto-gen
2021-01-24 23:58:26 -05:00
Eli Yukelzon
c2316c15f3 MM-32027 - Marking a thread as unread not possible or marks all threads as unread. (#16757)
* mark thread as read query fix

* test fix

* lint
2021-01-24 11:37:09 +02:00
Agniva De Sarker
28c3809036 MM-31353: Fix incorrect time truncation logic (#16776)
As mentioned in the documentation:

> Truncate operates on the time as an absolute duration since the zero time;
    it does not operate on the presentation form of the time. Thus,
    Truncate(Hour) may return a time with a non-zero minute, depending on the
    time's Location.

As a result, truncating for anything more than an hour is buggy and should
not be done. The correct way is to construct the date object using the
day, month and year.

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

```release-notes
Fixed a bug in product notices where a date constraint might
fail to match, and would lead to the notice not being fetched
```
2021-01-23 20:18:10 +05:30
Amy Blais
c838d6698b Update README.md (#16767) 2021-01-22 19:40:37 +01:00
Agniva De Sarker
1aae3444c0 MM-32013: Do not allow password change in /auth endpoint (#16770)
We were allowing new password to be reset without asking
for the old password. This was not advertised but was possible nevertheless
through the API.

Since there is already a separate API to change password, we choose to remove
this functionality.

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

```release-note
The /api/v4/users/me/auth API endpoint cannot be used to change password anymore.
This was a hidden feature that was not documented, but was nevertheless possible.
We are just removing the hidden feature.
```

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-01-22 09:58:08 +05:30
Agniva De Sarker
1cb019c0d8 MM-32048: Upgrade dependencies (#16765)
```release-note
Updated Go dependencies to their latest minor version
```

https://mattermost.atlassian.net/browse/MM-32048
2021-01-21 22:17:05 +05:30
Agniva De Sarker
dccdc9f6cf MM-31721: Fix Cache-Control directives (#16763)
We were incorrectly setting the cache control to public
when it should be rather private.

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

```release-notes
Fix Cache-Control headers to instruct that responses may only be cached
on browsers.
```
2021-01-21 12:38:49 +01:00
Jesse Hallam
f8caa6c841 Job metrics & dynamic Grafana annotations (#16650)
* docker: prometheus and grafana for development

Add prometheus and grafana docker configuration when developing with access to the enterprise repository. This simplifies the setup for developers adding new metrics or even examining events from their development server. The services are disabled by default when no enterprise source is detected.

Grafana is provisioned automatically with the Prometheus datasource, as well as the canonical dashboards used with Mattermost. Furthermore, no authentication is required to access Grafana to simplify access from a development environment. The default home dashboard is customized to automatically show links to the provisioned dashboards. Dashboards can be saved, and login remains available via the default `admin/admin` credentials (which initiates a password reset), but no dashboard or system configuration is (currently) persisted if the container is destroyed.

Linux requires slightly special handling (well, really it's Docker for MacOS/Windows), in that `host.docker.internal` is the canonical way to resolve the host on MacOS/Windows, but on Linux it's usually sufficient to just use `localhost`. Until https://github.com/docker/for-linux/issues/264 is resolved, this PR includes code to customize the Prometheus configuration to point at the required address for the running platform.

* metrics: track active jobs by type

* metrics: active jobs chart

* metrics: server start and job annotations

* Update build/docker-compose.common.yml

Co-authored-by: Claudio Costa <cstcld91@gmail.com>

* prometheus: resolve docker host via 172.17.0.1 instead

* skip enabling prometheus and grafana by default

* handle JOB_STATUS_ERROR and JOB_STATUS_CANCELED end states

* handle nil srv.metrics

* lookup job to determine type for metrics

* mocked unit tests for jobs

* goimports lint fixes

* missing license

* add instance to server start tag

* filter annotations by selected instance

Co-authored-by: Claudio Costa <cstcld91@gmail.com>
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-01-20 15:43:02 -04:00
Allan Guwatudde
a7e212566d [MM-31112] - Update license renewal email (#16747)
* [MM-31112] - Update license renewal email

* Feedback impl-1

* Update app/license.go

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

* Feedback impl-2

Co-authored-by: Maria A Nunez <maria.nunez@mattermost.com>
2021-01-20 19:57:29 +03:00
Agniva De Sarker
c31b5f2375 Remove local imports from golangci (#16760)
This will be implemented via a mattermod check
to make PR review suggestions.

```release-note
NONE
```
2021-01-20 20:43:52 +05:30
Doug Lauder
dbbf985e61 MM-31875 soft delete reactions (#16654)
- soft delete reaction by setting new field Reactions.DeleteAt to non-zero.
- include new field Reactions.UpdateAt
2021-01-20 10:09:23 -05:00
Ibrahim Serdar Acikgoz
11c6d07d6a [MM-31404] api4/config: return error when patching PluginSettings.EnableUploads (#16611)
* api4/config: return error when patching PluginSettings.EnableUploads

* reflect review comments

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-01-20 14:45:21 +03:00
Allan Guwatudde
81b06b5b72 Switch creation of users to use app method vs client method (#16673)
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-01-20 12:25:18 +03:00