Commit Graph

2399 Commits

Author SHA1 Message Date
Ayan Banerjee
55f5932ed5 [MM-31555] Print golang version on server startup (#16610)
* Added log to print golang version before running Server

* Minor fix

* Review Fixes

* Review Fixes - 2

* Update app/server.go

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

Co-authored-by: Claudio Costa <cstcld91@gmail.com>
2021-01-02 23:35:22 +05:30
Ibrahim Serdar Acikgoz
40e16ba07f [MM-31359] remove duplicated error logs (#16583)
* remove duplicated error logs

* reflect review comments

* add context

* add error details
2020-12-29 09:48:36 +03:00
Agniva De Sarker
c54b262351 MM-31356: Add a minimum required version check for Postgres (#16597)
* MM-31356: Add a minimum required version check for Postgres

To keep conformance with our failing fast and obvious philosophy,
we add a check to prevent Mattermost server from starting
if the postgres version is below 10.0.

This gives customers a chance to upgrade their database before upgrading
their Mattermost version, than to run into weird compatibility issues
after they have finished the upgrade.

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

```release-note
NONE
```

* fix lint errors

* Use a function to pretty-print version string

* rectify comment
2020-12-23 22:06:13 +05:30
Ibrahim Serdar Acikgoz
8036ba86e7 [MM-31398] upgrade error level to critical in case of panic or os.Exit (#16584)
* upgrade error level to critical in case of panic or os.Exit

* reflect revivew comments

* fix error capitalization
2020-12-23 13:11:35 +03:00
Agniva De Sarker
6487d0ca91 MM-31062: Rewrite empty string checks to be more idiomatic (#16587)
https://mattermost.atlassian.net/browse/MM-31062

```release-note
NONE
```
2020-12-22 19:20:59 +05:30
Agniva De Sarker
1a131b54af MM-31064: Simplify indentation (#16565)
* MM-31064: Simplify indentation

Reduce indentation where possible.

```release-note
NONE
```

Command ran to verify:
golangci-lint run --disable-all --enable golint --max-issues-per-linter=10000 --max-same-issues=100000 ./... | grep "block ends with a return state"

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

* incorporate review comments

* enable golint for outdent rule

* fix remaining issues

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2020-12-21 18:50:47 +03:00
Jesús Espino
7419898449 Remove usages of AppError on filesstore service (#15841)
* Remove usages of AppError on filesstore service

* Fixing a golint error

* Fixing shadowed variable

* Adding err.Error() to the NewAppError calls

* Fixing tests

* Adding missed translations

* Fix error handling and updating the translation that affects it

* Fixing two typos
2020-12-20 12:53:07 +01:00
Mario de Frutos Dieguez
94fe01dc1d [MM-30539] New renewal link logic (#16539)
* New renewal link logic

Endpoint and logic that returns the renewal link to be used to start the
license renewal process.

* Limit access for restricted sysadmins

* Include active users in the renewal token
2020-12-18 16:40:46 +01:00
Nick Misasi
2447ce9bca [MM-30984] Change default footer for copyright in 2 emails (#16508)
* Change default footer for copyright in 2 emails

* Change copyright date to 2020

* Add something back

* Put back to 2020

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2020-12-16 13:51:40 -05:00
Agniva De Sarker
0cf37d0f3c MM-3124: Fix racy test TestPluginPanicLogs (#16541)
We shutdown all plugins prior to checking the log buffer
so that there are no active plugins writing to the buffer
when we read the contents.

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

```release-note
NONE
```
2020-12-15 19:19:53 +05:30
Jason Blais
8e221c1895 [MM-31018] Update email address for admin advisor contact requests to support-advisor@mattermost.com (#16443)
Automatic Merge
2020-12-15 05:15:17 +01:00
Agniva De Sarker
fa1f2a8504 MM-31323: Fix racy test TestHandleCommandResponsePost (#16542)
In https://github.com/mattermost/mattermost-server/pull/16089,
we added logic to modify the notification text in the presence
of fallback text.

Unfortunately, that created a race condition during publishing
the post via websockets. To fix this, we create a clone of the post
before sending it off for push notifications.

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

```release-note
NONE
```
2020-12-14 14:24:12 +05:30
Haardik Dharma
609c8166f2 [MM-30911]: Change receiver name for (me *TestHelper) in app/slashcommands/helper_test.go to be more idiomatic. (#16387)
Automatic Merge
2020-12-12 15:45:17 +01:00
Haardik Dharma
0dee08fa31 Update command_me.go (#16522)
Automatic Merge
2020-12-12 07:15:17 +01:00
Haardik Dharma
caaa5690b6 Update command_echo.go (#16521)
Automatic Merge
2020-12-12 06:15:17 +01:00
Haardik Dharma
625185cb5b Update command_online.go (#16493)
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2020-12-11 22:51:06 +05:30
Haardik Dharma
93a4c7bc7e Update command_groupmsg.go (#16487)
Automatic Merge
2020-12-11 17:45:18 +01:00
Haardik Dharma
b8e9bac921 Update command_code.go (#16486)
Automatic Merge
2020-12-11 16:45:18 +01:00
Claudio Costa
6c976c3b06 Generate preview regardless of HasPreviewImage value (#16535)
Automatic Merge
2020-12-11 00:15:17 +01:00
Haardik Dharma
7fb5476c64 Update command_channel_header.go (#16485)
Automatic Merge
2020-12-10 17:15:17 +01:00
Haardik Dharma
f2aafac0c9 Update cluster_discovery.go (#16484)
Automatic Merge
2020-12-10 16:15:18 +01:00
Agniva De Sarker
44eb3e3f97 MM-31326: Fix Striped LRU to have minimum of 1 bucket (#16531)
* MM-31326: Fix Striped LRU to have minimum of 1 bucket

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

```release-note
NONE
```

* Using a maxInt function
2020-12-10 19:51:52 +05:30
Haardik Dharma
5f0f5a7a7f Update command_shortcuts.go (#16494)
Automatic Merge
2020-12-09 15:45:18 +01:00
Florent Peterschmitt
349b83f23a implement and use striped LRU cache to lower mutex contention (#15764)
* Implement Striped LRU cache

* ci

* fix

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2020-12-09 19:25:14 +05:30
Scott Bishel
f548ecbee1 MM-27688-OpenId Connect (#16222)
* implement openid connect

* update error strings

* handle OpenIdSetting.Secret as FAKE SETTING

* add openid to telemetry

* update config defaults, add telemetry

* fix bug with Office365

* Retrieve Office365 AuthData from IdToken

* fix linter

* add feature flag, reset defaults for config

* fix build error

* fix unit tests

* add authentication permission to Feature
Flags

* turn off feature flag

* set default button color

* set default button color only on openid

* fix for merging FeatureFlags in config

* remove feature flag

* revert config changes

* remove debug statements

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2020-12-08 19:58:37 -07:00
Hossein
d666bb8b3d Add Billing Permissions (#16364)
* add billing permissions

* update store.go

* Update permission.go

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2020-12-08 12:41:28 -05:00
Haardik Dharma
977ad99af6 Update command_shrug.go (#16481)
Automatic Merge
2020-12-08 18:15:18 +01:00
Haardik Dharma
81854aea5c Update command_mute.go (#16479)
Automatic Merge
2020-12-08 11:15:17 +01:00
Doug Lauder
46fc0c640c MM-30986 Move global logger init until after server logger fully configured (#16426)
- move the initGlobalLogger call to the end of initLogging so a copy of a fully configured logger is made for global logging.
2020-12-07 09:50:45 -05:00
Eli Yukelzon
86e228b6c6 MM-30558 - Add unreadReplies and unreadMentions to thread membership (#16304) 2020-12-06 10:02:53 +02:00
Ibrahim Serdar Acikgoz
cc5a12bad0 app/import_functions: fix a bug while improting for two teams (#16455)
Automatic Merge
2020-12-04 18:45:17 +01:00
Haardik Dharma
4e2a33386b [MM-30913]: Change receiver name for (me *CollapseProvider) in app/slashcommands/command_expand_collapse.go to be more idiomatic. (#16389)
Automatic Merge
2020-12-04 07:15:17 +01:00
Nick Misasi
fa5a033f66 [MM-30984] Missing payment email on billing day if no CC is present (#16442)
* Adding email and scaffolding for payment failure in case where customer has not added payment method

* Adding email template

* Remove unused boolean

* Fix error

* Add Email Us verbiage

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2020-12-03 16:02:43 -05:00
Claudio Costa
df906cad9d [MM-28422] Enable processing of import files through API (#16062)
* Implement unzip function

* Implement FileSize method

* Implement path rewriting for bulk import

* Small improvements

* Add ImportSettings to config

* Implement ListImports API endpoint

* Enable uploading import files

* Implement import process job

* Add missing license headers

* Address reviews

* Make path sanitization a bit smarter

* Clean path before calculating Dir

* [MM-30008] Add mmctl support for file imports (#16301)

* Add mmctl support for import files

* Improve test

* Remove unnecessary handlers

* Use th.TestForSystemAdminAndLocal

* Make nouser id a constant
2020-12-03 11:38:00 +01:00
Jesús Espino
a74fe05695 Removing supplier concept from the sql store (#16355)
* Removing supplier concept from the sql store

* Removing other metions to supplier

* Fixing gofmt

* Fixing gofmt

* Renaming NewSqlStore to New

* Fixing tests

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2020-12-02 12:06:23 +01:00
Agniva De Sarker
fc60a1e8dd MM-30988 - Fix racy test ServerSystemdNotification (#16431)
* MM-30988 - Fix racy test ServerSystemdNotification

The translateFunc is a global variable which was unguarded.
So we convert that into an atomic variable to prevent against races.

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

```release-note
NONE
```

* fix tests

* move call upwards

* use race

* after translations init

* guard with a sync.Once

* missed import

* revert race

* update timeout
2020-12-02 14:22:41 +05:30
Haardik Dharma
e22669c403 [MM-30915]: Change receiver name for (me *JoinProvider) in app/slashcommands/command_join.go to be more idiomatic. (#16391)
Automatic Merge
2020-12-02 07:15:18 +01:00
Haardik Dharma
06543656ea [MM-30914]: Change receiver name for (me *InviteProvider) in app/slashcommands/command_invite.go to be more idiomatic. (#16390)
Automatic Merge
2020-12-02 06:15:18 +01:00
Agniva De Sarker
6ed90bf1db MM-30987- Fix race in setting clearNotify in Busy (#16430)
A time.AfterFunc runs the function in its own goroutine. So we need
to guard that with a mutex too.

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

```release-note
NONE
```
2020-12-02 08:49:40 +05:30
John Tzikas
3fdc6cb531 Fix misspellings and enable misspell on ci (#16285)
Co-authored-by: Ben Schumacher <ben.schumacher@mattermost.com>
2020-12-01 16:27:05 +01:00
Eli Yukelzon
c2036f614e MM-30970 Add Basic unreadMentions support for collapsed threads (#16407)
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2020-12-01 17:20:23 +02:00
Haardik Dharma
64499ca767 [MM-30912]: Change receiver name for (me *RenameProvider) in app/slashcommands/command_channel_rename.go to be more idiomatic. (#16388)
Automatic Merge
2020-12-01 15:45:18 +01:00
Haardik Dharma
a01927331a [MM-30909]: Change receiver name for (me *KickProvider) and (me *RemoveProvider)in app/slashcommands/command_remove.go to be more idiomatic. (#16385)
Automatic Merge
2020-12-01 06:15:17 +01:00
Haardik Dharma
e5df69df27 [MM-30908]: Change receiver name for (me *DndProvider) in app/slashcommands/command_dnd.go to be more idiomatic. (#16384)
Automatic Merge
2020-12-01 05:45:17 +01:00
Haardik Dharma
cbc66c9a37 [MM-30916]: Change receiver name for (me *LogoutProvider) in app/slashcommands/command_logout.go to be more idiomatic. (#16392)
Automatic Merge
2020-11-30 05:15:17 +01:00
Nick Misasi
9b6ee63a1e [MM-29845] Add CWS Webhook endpoint and payment failed email (#16351)
* Add a new handler to allow authentication via CWS API Key

* Make error better

* Add tests and cases for new handler functions

* Move some code around

* Add test for GetCloudSession function

* unset the env after test completion

* Remove white space

* Add CWS Webhook endpoint and email code

* handle returned errors from email sending function

* Change FailureCode to FailureMessage

* Remove unnecessary translations

* Fix translations

* Forgot to add template

* Update api4/cloud.go

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

* Update api4/cloud.go

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

* Update api4/cloud.go

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

* PR changes

* Update app/email.go

Co-authored-by: Mario de Frutos Dieguez <mario@defrutos.org>

* Close body in proper spot

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Co-authored-by: Maria A Nunez <maria.nunez@mattermost.com>
Co-authored-by: Mario de Frutos Dieguez <mario@defrutos.org>
2020-11-25 15:45:15 -05:00
Scott Bishel
e014de0a65 MM-30802: Enable GoSAML2 library support (#16361)
* update saml to always use new library

* remove unused variable

* Update tests

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2020-11-25 08:14:56 -05:00
Eli Yukelzon
bcb861717e MM-30918 Fix product notice check when user setting is missing (#16396) 2020-11-25 09:30:44 +02:00
Haardik Dharma
5642d3106e [MM-30907]: Change receiver name for (me *AwayProvider) in app/slashcommands/command_away.go to be more idiomatic. (#16383)
Automatic Merge
2020-11-25 07:15:17 +01:00
Agniva De Sarker
64e98d535d MM-30862: Fix racy test RunComplianceReports (#16377)
We pass a copy of the compliance object to the goroutine

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

```release-note
NONE
```

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2020-11-24 21:36:34 +05:30