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

14026 Коммитов

Автор SHA1 Сообщение Дата
Agniva De Sarker
d949bd1638 Remove app initialization from WebHub (#18687)
- Make it a Server method.
- Pass Server instead of App.
- Remove global app instance from NewServer, rather
create local instances whenever needed.
- Remove App from Websocket router, and create dynamically
on every request.
- Remove HubStart and HubStop from App methods.
- Explicitly using s.Log instead of the global logger
to indicate dependency on Server. We could have passed the logger
explicitly but it doesn't look ideal.

```release-note
NONE
```
2021-10-18 12:36:13 +05:30
Allan Guwatudde
609fea0002 [MM-39205] Check that emails match during sign-up (#18635) 2021-10-18 09:34:10 +03:00
Agniva De Sarker
e6f36f0649 Pre-fill CreateAt to let link previews work. (#18698)
* Pre-fill CreateAt to let link previews work.

Because of the fact that getEmbedsAndImages has been now
refactored to work _before_ a post is saved. So the CreateAt
field of a post was absent.

This led to link previews being failed to save in the DB
because the timestamp wasn't there. So we just pre-fill
the field for it to work.

At the store layer, if the timestamp is present, it will just
reuse that.

https://community-daily.mattermost.com/boards/workspace/zyoahc9uapdn3xdptac6jb69ic/285b80a3-257d-41f6-8cf4-ed80ca9d92e5/495cdb4d-c13a-4992-8eb9-80cfee2819a4?c=305651ab-a96f-40d3-8bcf-8391c0d3e306

```release-note
NONE
```

* Do not override existing time

```release-note
NONE
```
2021-10-16 09:09:22 +05:30
Jesús Espino
63ece5a29b Adding the feature flag to enable/disable calls in the mobile app (#18689) 2021-10-15 19:13:28 +02:00
Kyriakos Z
0f16c59b0a MM-36862: should remove user from participants (#18451)
* MM-36862: should remove user from participants

When deleting a reply in a thread we should also delete the participant
from the participants array. This should happen if they have no other
replies in that thread.

This commit fixes that.

* Adds warning logs

* Delete Post: fetches participants only when needed

* Minor refactor

* Remove participant should check for error in count

* Fixes error when binary_parameters=true

* Fixes: removes ArrayToJSON so we can handle the error

* Satisfies the linter

* Better error handling

* Satisfy govet

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-10-15 19:40:09 +03:00
Penthaa Patel
c02cdd842a [MM-38996] - Migrate from gorp to sqlx in store/sqlstore/compliance_store.go (#18633)
* migrate from gorp to sqlx in store/sqlstore/compliance_store.go

Signed-off-by: Penthaa Patel <penthaapatel@gmail.com>

* fix SQL syntax

Signed-off-by: Penthaa Patel <penthaapatel@gmail.com>

* fix SQL syntax

Signed-off-by: Penthaa Patel <penthaapatel@gmail.com>

* fix SQL syntax

Signed-off-by: Penthaa Patel <penthaapatel@gmail.com>

* fix SQL syntax error

Signed-off-by: Penthaa Patel <penthaapatel@gmail.com>

* Fixes

```release-note
NONE
```

Co-authored-by: Agniva De Sarker <agnivade@yahoo.co.in>
2021-10-15 20:06:57 +05:30
Agniva De Sarker
c27814393d Improve API4 initialization (#18680)
* Improve API4 initialization

- Refactored openGraphDataCache to be inside app layer.
- Moved the cache instance from global variable to be inside server.
- Moved out the app instantiation from the global commands package
to be instantiated on every call. Only the server instance is passed.
- Moved InitLocal to be called from inside Init.

```release-note
NONE
```

* Remove commented line

```release-note
NONE
```
2021-10-15 19:57:05 +05:30
Agniva De Sarker
43a99a5783 Move cloud init back to initEnterprise (#18668)
* Move cloud init back to initEnterprise

```release-note
NONE
```

* Remove debug lines

```release-note
NONE
```

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-10-15 19:29:06 +05:30
Ibrahim Serdar Acikgoz
ba3a911c99 [MM-39299] Remove outdated translations and update go-i18n library (#18674)
* Remove outdated translations

* update go-i18n dependency

* reflect review comments

* add message count for languages which has two translations for plurals
2021-10-15 16:26:25 +03:00
Agniva De Sarker
99e6039472 Add functionality to cleanup old jobs (#18646)
* Add functionality to cleanup old jobs

Historically, we never cleaned up old jobs from the DB
leading to them being accumulated forever.

This PR introduces functionality to cleanup old jobs
older than a defined threshold.

The functionality is set to false by default and has
to be enabled for it to work.

```release-note
2 new config settings were added.

JobSettings.CleanupOldJobs: This indicates whether to clean up old jobs
from the DB or not. Default is false.

JobSettings.CleanupJobsThresholdHours: This defines the time gap in hours beyond
which older jobs will be removed. This has no effect if the above config
setting is set to false. Default is -1
```

* fix copy pasta

```release-note
NONE
```

* address review comments

```release-note
NONE
```

* Fix lint

```release-note
NONE
```

* Use single config option for everything

```release-note
NONE
```

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-10-15 11:03:54 +05:30
Scott Bishel
60b20dbd92 update focalboard to 0.9.3 (#18688)
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-10-14 14:57:03 -06:00
darkLord19
98284a79eb remove timedDND feature flag (#18346) 2021-10-14 11:54:09 -04:00
Claudio Costa
9d8214c72a Drop existing default on Users.Timezone prior to column type change (#18669) 2021-10-14 17:18:18 +02:00
Agniva De Sarker
850fef1ad1 Move ImageProxy inside Channels (#18656)
* Move ImageProxy inside Channels

```release-note
NONE
```

* Move back httpService

```release-note
NONE
```

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-10-14 13:57:04 +05:30
Kyriakos Z
4b85f9ee6a MM-36743: adds last_root_post_at in channels table (#18366)
* MM-36743: adds last_root_post_at in channels table

Channel recency for CRT users should not count replies,
this commit solves that issue by adding a new column to the channels
table: LastRootPostAt.
With that new info CRT users can have recent channels to work as
expected.

* Adds the 'LastRootPostAt' to the SQL scripts

* Fixes tests

* Adds LastRootPostAt migration to v6.1

* Fixes index

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-10-13 15:20:44 -04:00
Agniva De Sarker
ff10bf1068 Fix small typo (#18675)
Automatic Merge
2021-10-13 19:33:56 +02:00
Ben Lloyd Pearson
6caff14cbe New intro, images, and links (#18610)
* Update content and links in Readme

* Add explainer to dev machine setup

* Update README.md

* Update README.md

* Update README.md
2021-10-13 22:35:08 +05:30
Agniva De Sarker
e2c87ef950 Display tableName and columnName for jsonb schema failures (#18672)
These are incredibly helpful during failures and should be there.

```release-note
NONE
```
2021-10-13 20:30:35 +05:30
Hossein
6521b0dfe3 Unfurl Focalboard Server PR (#18271)
* Allow Embeds editing without editing

* Add focalboard to embed after it being in props

* Fix tests

* change to boards

* remove extra gunk

* Fix tests

* Add Feature Flag

* update boardsunfurl

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-10-13 10:51:27 -04:00
Ibrahim Serdar Acikgoz
be203d9bf3 Initial team service implementation (#18279)
* initial service implementation

* reflect review comments
2021-10-13 15:20:40 +03:00
Carlos Tadeu Panato Junior
d074c3d20d fix package name typo (#18665) 2021-10-13 16:01:32 +08:00
Agniva De Sarker
40776854f0 Remove erroneous gosaml submodule (#18660)
```release-note
NONE
```
2021-10-12 21:13:24 +05:30
Ibrahim Serdar Acikgoz
dc749170df restore reset command as db reset (#18449) 2021-10-12 16:18:07 +03:00
Carlos Tadeu Panato Junior
88563a3de3 jobserver: enable prometheus metrics when running standalone jobserver (#18636)
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-10-12 14:32:23 +02:00
Carlos Tadeu Panato Junior
e95e0e95a8 build: add targets for linux/darwin arm64 and include those in the package (#18491)
* build: add targets for linux/darwin arm64 and include those in the package

* update based on feedback

* store arm64 targets
2021-10-12 11:12:32 +02:00
Carlos Tadeu Panato Junior
3b81d9f83e db: add db upgrade for 5.39 and upgrade to 6 (#18645) 2021-10-12 09:37:56 +02:00
Weblate (bot)
d278f983be Translations update from Weblate (#18639)
* Translated using Weblate (Polish)

Currently translated at 100.0% (2310 of 2310 strings)

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

Translated using Weblate (Polish)

Currently translated at 91.3% (2110 of 2310 strings)

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

Translated using Weblate (Polish)

Currently translated at 87.1% (2014 of 2310 strings)

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

Translated using Weblate (Polish)

Currently translated at 87.0% (2011 of 2310 strings)

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

* Translated using Weblate (German)

Currently translated at 100.0% (2310 of 2310 strings)

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

* Translated using Weblate (Dutch)

Currently translated at 99.7% (2305 of 2310 strings)

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

* Translated using Weblate (Hungarian)

Currently translated at 100.0% (2310 of 2310 strings)

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

* Translated using Weblate (English (Australia))

Currently translated at 100.0% (2310 of 2310 strings)

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

* Translated using Weblate (Japanese)

Currently translated at 100.0% (2310 of 2310 strings)

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

* Translated using Weblate (Spanish)

Currently translated at 100.0% (2310 of 2310 strings)

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

* Translated using Weblate (Swedish)

Currently translated at 100.0% (2310 of 2310 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% (2310 of 2310 strings)

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

* Translated using Weblate (French)

Currently translated at 95.1% (2197 of 2310 strings)

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

* Translated using Weblate (German)

Currently translated at 100.0% (2310 of 2310 strings)

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

* Translated using Weblate (German)

Currently translated at 100.0% (2310 of 2310 strings)

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

Co-authored-by: master7 <marcin.karkosz@rajska.info>
Co-authored-by: JtheBAB <srast@bioc.uzh.ch>
Co-authored-by: Tom De Moor <tom@controlaltdieliet.be>
Co-authored-by: Tóth Csaba // Online ERP Hungary Kft <csaba.toth@online-erp.hu>
Co-authored-by: Matthew Williams <Matthew.Williams@outlook.com.au>
Co-authored-by: kaakaa <stooner.hoe@gmail.com>
Co-authored-by: Elias  Nahum <elias@mattermost.com>
Co-authored-by: MArtin Johnson <martinjohnson@bahnhof.se>
Co-authored-by: Kaya Zeren <kayazeren@gmail.com>
Co-authored-by: Anne-Laure Gaillard <alaure.gaillard@gmail.com>
Co-authored-by: jprusch <rs@schaeferbarthold.de>
Co-authored-by: Mark E Fuller <fuller@stossrohr.net>
2021-10-12 09:00:50 +02:00
Agniva De Sarker
f0ecdcc5f5 Move Channels into App (#18623)
* Move Channels into App

In this PR, we make Channels as part of App
instead of Server. This is part of the transition period
of moving fields from Server to Channels.

For now, Channels contains Server. So the hierarchy is

App -> Channels -> Server.

And as a first step, we also move httpService to Channels.

```release-note
NONE
```

* Fixing another test

```release-note
NONE
```

* new method

```release-note
NONE
```
2021-10-12 11:39:49 +05:30
Agniva De Sarker
561bc968c8 Creating empty Channels shell (#18611)
* Creating empty Channels shell

This is the first step in moving to a product-based
isolated architecture.

For now, Channels is empty and does not contain anything.

Next step is to change App to contain Channels instead
of Server. Some of the initialization code in NewServer
would need to be moved inside NewChannels.

This would complete the full pass-through mode of accessing
everything.

The last step would be to gradually move Channels related
fields from Server into Channels, keeping Server to be
just the global level struct.

```release-note
NONE
```

* fix vet failure

```release-note
NONE
```
2021-10-11 19:24:50 +05:30
Martin Kraft
55ea07677d Removed PostPreview from MessageHasBeenPosted payload. (#18613)
Automatic Merge
2021-10-08 18:50:03 +02:00
Scott Bishel
4a7cf864be update boards to 0.9.2 (#18616)
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-10-08 10:25:44 -06:00
Nathaniel Allred
fbe4f75953 Allow webapp to request legacy cloud products. (#18528)
* Change internal getProducts to filter on a set of families instead of a single family.
* Extend /products endpoint to be able to return any of the current four sets of product families.
* Use include_legacy query param to decide which cloud products to request.
2021-10-07 11:48:56 -05:00
Archit Mathur
d13b3604ea Cluster Discovery store sqlx migration (#18605)
Automatic Merge
2021-10-07 16:50:03 +02:00
Agniva De Sarker
9bbac354d8 Add new CI step for checking email templates (#18570)
* Add new CI step for checking email templates

https://community-daily.mattermost.com/boards/workspace/zyoahc9uapdn3xdptac6jb69ic/285b80a3-257d-41f6-8cf4-ed80ca9d92e5/495cdb4d-c13a-4992-8eb9-80cfee2819a4?c=2c1d9628-675f-4eb6-80bb-db9e4d09b8bf

```release-note
NONE
```

* Pre-install

```release-note
NONE
```

* pinning down to 4.9.0

```release-note
NONE
```

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-10-07 13:07:38 +05:30
Agniva De Sarker
76d492f9ab MM-37186: Update dependencies (#18604)
* MM-37186: Update dependencies

The split client libraries were excluded from being upgraded.

See: https://github.com/splitio/go-split-commons/issues/56

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

```release-note
NONE
```

* Ignore staticcheck deprecation warnings

```release-note
NONE
```
2021-10-07 12:57:51 +05:30
Agniva De Sarker
2898f988fc Move admin advisor to separate file (#18606)
```release-note
NONE
```
2021-10-07 12:20:40 +05:30
Agniva De Sarker
d9dda9f7c6 Add index on Jobs table (#18244)
From Grafana charts, GetCountbyStatusandType and
GetNewestJobByStatusesAndType were the two top queries.

Overall, a through look into all job methods leads to
the conclusion of 2 indexes - one on CreateAt, another
a compound index of Status+Type. I have just gone ahead
with the compound index for now. Once the job cleaner
is implemented, I want to take a second look to decide
whether to add the second index or not.

Here is the before-after of the queries:

Query 1:
```
explain analyze select count(*) from jobs where status='error' and type='migrations';
                                                         QUERY PLAN
-----------------------------------------------------------------------------------------------------------------------------
 Aggregate  (cost=103.42..103.43 rows=1 width=8) (actual time=0.032..0.034 rows=1 loops=1)
   ->  Bitmap Heap Scan on jobs  (cost=4.54..103.42 rows=1 width=0) (actual time=0.027..0.028 rows=0 loops=1)
         Recheck Cond: ((type)::text = 'migrations'::text)
         Filter: ((status)::text = 'error'::text)
         ->  Bitmap Index Scan on idx_jobs_type  (cost=0.00..4.54 rows=34 width=0) (actual time=0.018..0.019 rows=0 loops=1)
               Index Cond: ((type)::text = 'migrations'::text)

explain analyze select count(*) from jobs where status='error' and type='migrations';
                                                         QUERY PLAN
----------------------------------------------------------------------------------------------------------------------------
Aggregate  (cost=8.31..8.32 rows=1 width=8) (actual time=0.079..0.080 rows=1 loops=1)
   ->  Index Only Scan using jobs_multi on jobs  (cost=0.29..8.30 rows=1 width=0) (actual time=0.072..0.073 rows=0 loops=1)
         Index Cond: ((status = 'error'::text) AND (type = 'migrations'::text))
         Heap Fetches: 0

explain analyze select * from jobs where status='error' and type='migrations' order by createat desc limit 1;
```

Query 2:
```
                                                            QUERY PLAN
----------------------------------------------------------------------------------------------------------------------------------
 Limit  (cost=8.31..8.32 rows=1 width=187) (actual time=0.037..0.039 rows=0 loops=1)
   ->  Sort  (cost=8.31..8.32 rows=1 width=187) (actual time=0.035..0.036 rows=0 loops=1)
         Sort Key: createat DESC
         Sort Method: quicksort  Memory: 25kB
         ->  Index Scan using idx_jobs_type on jobs  (cost=0.29..8.30 rows=1 width=187) (actual time=0.027..0.027 rows=0 loops=1)
               Index Cond: ((type)::text = 'migrations'::text)
               Filter: ((status)::text = 'error'::text)

explain analyze select * from jobs where status='error' and type='migrations' order by createat desc limit 1;
                                                          QUERY PLAN
-------------------------------------------------------------------------------------------------------------------------------
 Limit  (cost=8.31..8.32 rows=1 width=187) (actual time=0.065..0.067 rows=0 loops=1)
   ->  Sort  (cost=8.31..8.32 rows=1 width=187) (actual time=0.063..0.064 rows=0 loops=1)
         Sort Key: createat DESC
         Sort Method: quicksort  Memory: 25kB
         ->  Index Scan using jobs_multi on jobs  (cost=0.29..8.30 rows=1 width=187) (actual time=0.021..0.022 rows=0 loops=1)
               Index Cond: (((status)::text = 'error'::text) AND ((type)::text = 'migrations'::text))

```

```release-note
NONE
```
2021-10-07 11:55:59 +05:30
Scott Bishel
6679abfca4 Turn focalboard plugin on by default (#18132)
* turn focalboard plugin on by default

* cleanup

* update config diff tests to add new default

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-10-06 13:28:37 -06:00
Scott Bishel
0d961b00d9 Prepackaged boards to 0.9.1 (#18405)
* update prepackaged boards to 0.9.0

* update to 0.9.1

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-10-06 13:28:10 -06:00
Pijus Kamandulis
d639a08064 MM-38624 Migrate ChannelMemberHistoryStore to sqlx (#18496)
Automatic Merge
2021-10-06 19:50:02 +02:00
Allan Guwatudde
ffe9d3adea [MM-38437] - Trial ending soon email refers to Cloud Professional (#18546)
* [MM-38437] - Trial ending soon email refers to Cloud Professional

* feedback impl

* add coma
2021-10-06 15:46:56 +03:00
Agniva De Sarker
208920b5e1 MM-38497: Fix Sentry crash in PostAction.Equals (#18571)
* MM-38497: Fix Sentry crash in PostAction.Equals

We check for nil pointer before moving ahead.

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

```release-note
NONE
```

* Fix lint errors

```release-note
NONE
```

* Update model/integration_action.go

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

Co-authored-by: Claudio Costa <cstcld91@gmail.com>
2021-10-06 13:41:18 +05:30
Allan Guwatudde
2a40a7d649 [MM-39072] - Run make build-templates on latest master (#18541)
* [MM-39072] - Run make build-templates on latest master

* fix guest template failure
2021-10-06 09:50:51 +03:00
Jesse Hallam
4fbcc85c3e Pre-package Playbooks v1.20.1 (#18542) 2021-10-05 15:22:33 -03:00
Saul Pinales
7b9aeca7ff Migrate from gorp to sqlx in store/sqlstore/command_webhook_store.go (#18517)
* Migrate from gorp to sqlx in store/sqlstore/command_webhook_store.go

* fixing small things

change `CreatedAt` to `CreateAt` and change GetReplicaX().Select to GetReplicaX().Get

Co-authored-by: Saul Pinales <saul021002@gmai.com>
2021-10-05 21:22:50 +05:30
Alejandro García Montoro
5045152acc Pre-package Channel Export plugin v1.0.0 (#18544) 2021-10-05 17:48:19 +02:00
Pablo Andrés Vélez Vidal
4af6598f63 MM-38805 - fix contact sales link (#18539)
Co-authored-by: Pablo Velez Vidal <pablo.velez@mattermost.com>
2021-10-05 17:42:03 +02:00
Weblate (bot)
9b4c71e4a7 Translations update from Weblate (#18545)
* Translated using Weblate (Polish)

Currently translated at 83.7% (1935 of 2310 strings)

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

* Translated using Weblate (Swedish)

Currently translated at 99.8% (2306 of 2310 strings)

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

Co-authored-by: master7 <marcin.karkosz@rajska.info>
Co-authored-by: MArtin Johnson <martinjohnson@bahnhof.se>
2021-10-05 10:07:23 -05:00
Dmitrijs Zubriks
d0fad86246 [GH-15744] Remove direct token store access in api4/user module (#18411)
Automatic Merge
2021-10-05 09:50:02 +02:00
Agniva De Sarker
b6f0afb919 Remove searchEngine from App (#18540)
https://community-daily.mattermost.com/boards/workspace/zyoahc9uapdn3xdptac6jb69ic/285b80a3-257d-41f6-8cf4-ed80ca9d92e5/495cdb4d-c13a-4992-8eb9-80cfee2819a4?c=c6753a1c-dbbf-4316-8e4e-c58ebb65d6e0

```release-note
NONE
```
2021-10-05 12:41:00 +05:30