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

14640 Коммитов

Автор SHA1 Сообщение Дата
Agniva De Sarker
ec91ca46ff MM-42813: Fallback to default config if nil is passed (#19920)
https://mattermost.atlassian.net/browse/MM-42813

```release-note
NONE
```

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-04-06 08:30:16 +05:30
Agniva De Sarker
bc69069a83 MM-42570: Update dependencies (#19901)
https://mattermost.atlassian.net/browse/MM-42570

```release-note
NONE
```
2022-04-06 06:44:42 +08:00
Cass C
49e68bb230 pre-package Playbooks v1.26.2 (#19921) 2022-04-05 14:29:19 -04:00
Michel Engelen
2813a1caac fix for adjusting post editing time limit to not need a server license anymore (#19890) 2022-04-04 13:07:42 -04:00
Nick Misasi
650ad3b3ae [MM-42822] Check for and return HTTP 451 for all trial requests (#19873)
* Check for and return HTTP 451 for all trial requests

* Use constant in another spot too

* add a test

* Update test name
2022-04-04 09:48:14 -04:00
Jesse Hallam
7b5ac343f0 adopt forked squirrel supporting from UPDATE FROM (#19896)
Fork https://github.com/Masterminds/squirrel as https://github.com/lieut-data/squirrel with the following changes:
* https://github.com/Masterminds/squirrel/pull/256 supporting FROM clause to update builder (Postgres)
* Extension of above to support multiple FROM in UPDATE (Postgres)
* Support for multiple tables in UPDATE (MySQL)

This PR then leverages those changes to simplify a query that previously had to be coded by hand and duplicate for each of MySQL and Postgres.
2022-04-04 09:30:59 -03:00
Fareck Allony
3f5eb5f6f7 Adding is_pinned attribute to post and direct_post objects when doing bulk import (#19487)
* refactor: added is_pinned attribute to post and direct_post objects when doing bulk import

* fix: handling IsPinned nil value in post and direct_post objects import

* refactor: added pinned post tests for post and direct_post objects import

* refactor: TestImportimportMultiplePostLines code enhancements + added pinned post tests in TestImportImportDirectPost

* fix: test message text

* fix: typo Post => DirectPost

* fix: typo Post => DirectPost

* refactor: remove redundant test

* refactor: test enhancements

* refactor: remove print statements.

* refactor: using require instead of assert

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-04-04 15:29:42 +03:00
Ashish Bhate
9521797b15 MM-40148: threadsOnly query param for user threads (#19833)
* MM-40148: threadsOnly query param for user threads

Currently we always calculate counts when fetching user threads.
Those counts include total, unread replies, and unread mentions,
and are potentially expensive to calculate.

This commit adds a new query param 'threadsOnly' which won't calculate
any counts and just return threads.

Co-authored-by: koox00 <3829551+koox00@users.noreply.github.com>
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-04-04 17:50:13 +05:30
Ibrahim Serdar Acikgoz
27bd16e5f5 store/channel_store_categories: check if the category has a valid type (#19880)
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-04-04 15:05:31 +03:00
Ibrahim Serdar Acikgoz
7b8a2e89d4 api4/system: add check if model.FileSettings is empty (#19876)
* api4/system: add config validation for model.FileSettings

* reflect review comments

* add unmarshal
2022-04-04 15:03:31 +03:00
Ibrahim Serdar Acikgoz
7ab6ea2bad api4/post_test: skip TestDeletePostEvent (#19892) 2022-04-04 14:54:51 +03:00
Ibrahim Serdar Acikgoz
97d3368a98 update morph dependency (#19891) 2022-04-04 14:03:39 +03:00
Ibrahim Serdar Acikgoz
b1b9774efa app/post_metadata: add a type cast check for OpenGraph images (#19877)
* app/post_metadata: add a type cast check for OpenGraph images

* change log level

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-04-04 13:27:18 +03:00
Agniva De Sarker
1cc50ff90c api4/license: Return 400 instead of 501 if format is not passed (#19856)
```release-note
NONE
```


Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-04-04 10:27:29 +05:30
Cass C
326daf1334 Pre-package Playbooks v1.26.1 (#19893) 2022-04-01 11:04:40 -04:00
Allan Guwatudde
c17e210dd0 [MM-40962-2] - Fix unnecessary logging in license expiration check (#19826)
* [MM-40962-2] - Fix unnecessary logging in license expiration check

* skip check for TE

* document

* feedback impl-1

* fix logic

* remove saving of renewal token

* fix lint

* remove commented code

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-03-31 18:25:46 +03:00
Allan Guwatudde
fa56ee9d9a [MM-42713] - Remove cloud user limit restrictions (#19835)
* [MM-42713] - Remove cloud user limit restrictions

* remove unused code

* fix translations

* feedback impl-1

* enterprise code clean up

* feedback impl-2

* fix mocks

* fix translations

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-03-31 18:24:38 +03:00
Ossi Väänänen
67d57fc400 Pin the FROM in dockerfiles (#19526)
This prevents supply chain attacks where the latest image is replaced with a malicious version.

Pinning done by using https://github.com/Jille/dockpin
2022-03-31 15:22:20 +03:00
Ossi Väänänen
361e260798 Update Scorecards action (#19879) 2022-03-31 13:40:12 +03:00
Agniva De Sarker
f8a3119426 MM-41260: Revamp ES/Bleve batching logic (#19841)
The older method used to reply completely on timestamps
to take batches of items in a timestamp range and then
just incrementing the timestamp. This led to handling
edge-cases such as more items than the batch count, all
having the same timestamp.

Additionally, relying on timestamp as the page cursor
meant that indexing was not very efficient if you had
several items spread out across large spans of time.

To get away from all of that we use a proper cursor-based
approach consisting of createAt+Id. With this, we move
completely to a constant page size where we can fetch
a given number of objects irrespective of when they
were created. This makes indexing much more faster and
efficient.

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

```release-note
Elasticsearch and Bleve indexing have been revamped to be much
more efficient and faster. The config parameter BulkIndexingTimeWindowSeconds
for both elasticsearch and bleve have been removed.
A new config parameter called BatchSize has been introduced instead.
This parameter controls the number of objects that
can be indexed in a single batch. This makes things
more efficient and maintains a constant workload.
```
2022-03-31 10:46:01 +05:30
Agniva De Sarker
9adf06e122 MM-42092: Add better debugging for TestDeleteChannel (#19872)
When the test fails, it is not clear whether the method
returned an error or it returned a channel with DeleteAt
set to 0. The if condition was also incorrect because
if the error was not-nil the condition would evaluate
to true and the test would pass.

We split the condition into 2 separate cases which will
let us know exactly what is failing.

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

```release-note
NONE
```
2022-03-31 10:43:41 +05:30
Julian Mondragón
baf9f69c27 MM-41407_Remove FF for MM-39053 Default Notifications (#19851) 2022-03-30 12:07:03 -05:00
Ibrahim Serdar Acikgoz
3cab0f1d8d [MM-42339] api4/license: add a nil check to not panic if server is not EE dist (#19770)
* api4/license: add a nil check to not panic if server is not EE dist

* add a test case
2022-03-30 19:09:57 +03:00
Allan Guwatudde
82c8bd33ed [MM-42703] - Add configuration setting to disable Inactive Server email notification (#19831)
* [MM-42703] - Add configuration setting to disable Inactive Server email notification

* remove log

* add config to telemetry

* fix lint
2022-03-30 11:31:46 +03:00
Ibrahim Serdar Acikgoz
0efb7bf07d app/teams: add getMember method (#19862) 2022-03-30 09:54:46 +03:00
Rohitesh Gupta
00d445d533 Fixed CodeQL failures on master push (#19866)
* Running CodeQL everyday twice

* Updated scorecard-check to run everyday

* Running Scorecard job once a day

* Disabling Scorecard Job on every PR

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-03-30 10:52:22 +05:30
Cass C
27b5a703ee MM-42571: Pre-package Playbooks v1.26.0 (#19871)
* prepackage Playbooks 1.26.0

* undo lint issue
2022-03-29 20:03:15 -04:00
Mmbot
2aa06529c5 Update minor version to 6.6.0 2022-03-29 17:59:47 +03:00
Agniva De Sarker
5db226b2f0 MM-42652: Skip Flaky test in CreateCategoryForTeamForUser (#19857)
https://mattermost.atlassian.net/browse/MM-42652

```release-note
NONE
```
2022-03-29 19:36:50 +05:30
Ibrahim Serdar Acikgoz
a4a6fe0a94 app: add posts wrapper (#19816) 2022-03-29 12:44:52 +03:00
Agniva De Sarker
773ec991a8 MM-35344: Trust Requester for webhook endpoints (#19855)
Without this, the endpoint throws CSRF warnings
if a token is passed.

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

```release-note
NONE
```
2022-03-29 14:42:29 +05:30
Ibrahim Serdar Acikgoz
d33ef8d79c app/products: add dependency resolver (#19847)
* app/products: add dependency resolver

* reflect review comments
2022-03-29 11:58:29 +03:00
Ben Cooke
aa696ba36d [MM-42627] Feature flag for insights (#19839)
* tools updates

* Revert "tools updates"

This reverts commit 6293297b55803c5a263e200ebd80192899666ae9.

* feature flag for insights

Co-authored-by: Benjamin Cooke <benjamincooke@Benjamins-MacBook-Pro.local>
Co-authored-by: Benjamin Cooke <benjamincooke@Benjamins-MBP.ht.home>
2022-03-28 18:30:05 -04:00
Weblate (bot)
685b543789 Translations update from Mattermost Weblate (#19848)
* Translated using Weblate (Japanese)

Currently translated at 99.7% (2343 of 2348 strings)

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

* Translated using Weblate (English (Australia))

Currently translated at 99.5% (2338 of 2348 strings)

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

* 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 (German)

Currently translated at 100.0% (2347 of 2347 strings)

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

* Translated using Weblate (Japanese)

Currently translated at 100.0% (2347 of 2347 strings)

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

* Translated using Weblate (Russian)

Currently translated at 100.0% (2348 of 2348 strings)

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

* Translated using Weblate (Russian)

Currently translated at 100.0% (2348 of 2348 strings)

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

Translated using Weblate (Russian)

Currently translated at 100.0% (2348 of 2348 strings)

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

* Translated using Weblate (Russian)

Currently translated at 100.0% (2348 of 2348 strings)

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

* Translated using Weblate (Turkish)

Currently translated at 100.0% (2348 of 2348 strings)

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

* Translated using Weblate (English (Australia))

Currently translated at 99.5% (2338 of 2348 strings)

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

* Translated using Weblate (Swedish)

Currently translated at 98.1% (2305 of 2348 strings)

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

Co-authored-by: Iwasa Kazmi <kzmizzz@gmail.com>
Co-authored-by: Matthew Williams <Matthew.Williams@outlook.com.au>
Co-authored-by: jprusch <rs@schaeferbarthold.de>
Co-authored-by: kaakaa <stooner.hoe@gmail.com>
Co-authored-by: Maksim Matveev <m.matveev@hotmail.com>
Co-authored-by: Alexey Napalkov <flynbit@gmail.com>
Co-authored-by: Dar Konovkina <dar@redcollar.ru>
Co-authored-by: Kaya Zeren <kayazeren@gmail.com>
Co-authored-by: MArtin Johnson <martinjohnson@bahnhof.se>
2022-03-28 20:43:20 +03:00
Agniva De Sarker
dbcb5f2ffb Add debug logs to initialize CodeQL (#19844) 2022-03-28 15:30:18 +05:30
Julien Tant
0babc01749 [MM-41998] Channel Info RHS: display number of files for a channel (#19822)
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-03-25 13:28:14 -07:00
Ibrahim Serdar Acikgoz
1c49366f00 app/user: ensure that user gets sanitized while calling plugin hooks (#19808) 2022-03-25 12:39:11 +03:00
Ibrahim Serdar Acikgoz
3e8b81c0c7 graphql: Add channel stats under channel (#19804)
* graphql: Add channel stats under channel

* add permission check
2022-03-25 11:59:57 +03:00
mkraft
a9e21fcaf1 MM-41866: Adds index to UserGroups.DisplayName. (#19799) 2022-03-24 11:38:09 -04:00
Agniva De Sarker
c1f3827801 MM-38164: Paginate the GetPostThread API (#19485)
We implement a cursor based pagination model
to page through the posts in a given thread.

The cursor is a combination of the post.CreateAt+
post.Id to differentiate multiple posts in a given
timestamp.

Some additional parameters like direction, fromPost,
fromCreateAt and perPage were introduced to implement
this.

```release-note
NONE
```
2022-03-24 12:51:41 +05:30
Ibrahim Serdar Acikgoz
ad5f57b161 api4/system: adjust permissions for applied schema migrations (#19814)
* api4/system: adjust permissions for applied schema migrations

* add a test case
2022-03-23 19:34:03 +03:00
Ashish Bhate
2385bbdd50 MM-42535: Set ThreadAutoFollow to true by default (#19797)
Summary
A number of performance improvements shipped in v6.5 to support CRT with the ThreadAutoFollow bookkeeping enabled but the frontend features disabled. To prepare for a later enabling of the frontend features by default, we want to encourage customers to re-enable ThreadAutoFollow, and plan to enable this by default in v6.6.

Ticket Link
https://mattermost.atlassian.net/browse/MM-42535
2022-03-23 21:00:53 +05:30
Agniva De Sarker
68382c5fb7 MM-40272: Ability to resume elasticsearch indexing job (#19812)
Due to the way our community deployment is done. The job server
is restarted every day. This means that whenever there is a job
that takes more than 24 hours, it will always get cancelled
when the server restarts and therefore will never finish.

This PR adds ability to resume any stopped jobs, by storing
intermediate progress in the job metadata and setting
the job to pending instead of cancelled when everything is
shut down.

The user can still cancel a job explicitly by clicking on
the cross button in the system console. That functionality
hasn't changed. Only server stop or stopping/starting
job server via config will pause/resume jobs.

```release-note
The elasticsearch indexing job is resumable now. Stopping a
server while the job is running will put the job in pending status
and will resume the job when the server starts.

The job can still be explicitly cancelled via the system console UI.
```
2022-03-23 13:46:10 +05:30
Pablo Andrés Vélez Vidal
f6d9f2c184 MM-42412 - guard watcher stop/stopped channels with mutex to prevent race condition (#19759)
* MM-42412 - Guard watcher stop/stopped channels with mutex to prevent race condition

* reinitialize channels on Stop fn call

Co-authored-by: Pablo Velez Vidal <pablo.velez@mattermost.com>
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-03-22 14:12:37 -05:00
Harrison Healey
9d8c030b8b MM-42675 Update URLs in non-English i18n files (#19817) 2022-03-22 09:55:03 -04:00
Allan Guwatudde
80ec0a5c21 Fix MM-42643 (#19811)
* Fix MM-42643

* use handler authentication

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-03-22 11:41:31 +03:00
Ibrahim Serdar Acikgoz
42125bff4a app: add plugin-api/cluster interface provider (#19720) 2022-03-21 21:38:48 +03:00
Ibrahim Serdar Acikgoz
dae769221d [MM-42183] Add a check for mysql collation (#19700)
* add a check for mysql collation

* reflect review comments

* update collation check logic

* save indent
2022-03-21 21:15:12 +03:00
Nick Misasi
d89e42881a Add way to invalidate cloud cache (#19800)
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-03-21 10:42:09 -04:00
Agniva De Sarker
29b78f84d7 MM-40272: Fix job server graceful stop (#19760)
This fixes a classic concurrency bug where the stop channel
was being listened in 2 places. In the Run method and DoJob
method.

The problem with that is that one of them will consume
the signal, and if the DoJob method does, then the parent
for-select loop never exits, because the return statement
only runs when the stop signal is consumed.

This would lead to server hanging on shutdown.

To fix this, we close the channel rather than sending a
message. This exits all listeners listening on the channel
and lets the job exit gracefully.

This is a sample stack dump of a stuck goroutine

```
goroutine 1 [chan receive]:
runtime.gopark(0x235be40?, 0xc000faa530?, 0xa8?, 0xf3?, 0x27a1170?)
        /home/agniva/gosource/go/src/runtime/proc.go:366 +0xd6 fp=0xc002e77510 sp=0xc002e774f0 pc=0x43c856
runtime.chanrecv(0xc000faa7e0, 0x0, 0x1)
        /home/agniva/gosource/go/src/runtime/chan.go:577 +0x56c fp=0xc002e775a0 sp=0xc002e77510 pc=0x40868c
runtime.chanrecv1(0x27cab4c?, 0xf?)
        /home/agniva/gosource/go/src/runtime/chan.go:440 +0x18 fp=0xc002e775c8 sp=0xc002e775a0 pc=0x4080b8
github.com/mattermost/mattermost-server/v6/jobs/migrations.(*Worker).Stop(0xc001954280)
        /home/agniva/mattermost/mattermost-server/jobs/migrations/worker.go:66 +0x171 fp=0xc002e77698 sp=0xc002e775c8 pc=0x187f8d1
github.com/mattermost/mattermost-server/v6/jobs.(*Workers).Stop(0xc0019df2c0)
        /home/agniva/mattermost/mattermost-server/jobs/workers.go:84 +0x12c fp=0xc002e77748 sp=0xc002e77698 pc=0x17b04ec
github.com/mattermost/mattermost-server/v6/jobs.(*JobServer).StopWorkers(0xc00021f180?)
        /home/agniva/mattermost/mattermost-server/jobs/server.go:104 +0x9c fp=0xc002e777a0 sp=0xc002e77748 pc=0x17af8bc
github.com/mattermost/mattermost-server/v6/app.(*Server).Shutdown(0xc00021f180)
        /home/agniva/mattermost/mattermost-server/app/server.go:1019 +0x965 fp=0xc002e77c48 sp=0xc002e777a0 pc=0x1dd6865
github.com/mattermost/mattermost-server/v6/cmd/mattermost/commands.runServer.func3()
        /home/agniva/mattermost/mattermost-server/cmd/mattermost/commands/server.go:79 +0x26 fp=0xc002e77c60 sp=0xc002e77c48 pc=0x214bbe6
github.com/mattermost/mattermost-server/v6/cmd/mattermost/commands.runServer(0xc000e1e000, 0xb?)
        /home/agniva/mattermost/mattermost-server/cmd/mattermost/commands/server.go:122 +0x239 fp=0xc002e77d50 sp=0xc002e77c60 pc=0x214ba39
github.com/mattermost/mattermost-server/v6/cmd/mattermost/commands.serverCmdF(0x4207ac0?, {0x279d9d6?, 0x0?, 0x0?})
        /home/agniva/mattermost/mattermost-server/cmd/mattermost/commands/server.go:58 +0x11d fp=0xc002e77dd0 sp=0xc002e77d50 pc=0x214b37d
github.com/spf13/cobra.(*Command).execute(0x4207ac0, {0xc00003c200, 0x0, 0x0})
        /home/agniva/mattermost/mattermost-server/vendor/github.com/spf13/cobra/command.go:856 +0x67c fp=0xc002e77ea8 sp=0xc002e77dd0 pc=0x211a21c
github.com/spf13/cobra.(*Command).ExecuteC(0x4207ac0)
        /home/agniva/mattermost/mattermost-server/vendor/github.com/spf13/cobra/command.go:974 +0x3b4 fp=0xc002e77f60 sp=0xc002e77ea8 pc=0x211a894
github.com/spf13/cobra.(*Command).Execute(...)
        /home/agniva/mattermost/mattermost-server/vendor/github.com/spf13/cobra/command.go:902
github.com/mattermost/mattermost-server/v6/cmd/mattermost/commands.Run(...)
        /home/agniva/mattermost/mattermost-server/cmd/mattermost/commands/root.go:14
main.main()
        /home/agniva/mattermost/mattermost-server/cmd/mattermost/main.go:31 +0x86 fp=0xc002e77f80 sp=0xc002e77f60 pc=0x21f9ee6
runtime.main()
        /home/agniva/gosource/go/src/runtime/proc.go:255 +0x227 fp=0xc002e77fe0 sp=0xc002e77f80 pc=0x43c487
runtime.goexit()
        /home/agniva/gosource/go/src/runtime/asm_amd64.s:1571 +0x1 fp=0xc002e77fe8 sp=0xc002e77fe0 pc=0x46d361
```

This is not strictly related to the JIRA ticket but
a general refactor

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

```release-note
NONE
```
2022-03-21 09:04:06 +05:30