Commit Graph

9793 Commits

Author SHA1 Message Date
Harrison Healey
0a6b96cb40 MM-9849 Added tracking of which settings are set through environment variables (#8586)
* MM-9849 Added tracking of which settings are set through environment variables

* Removed old version of viper

* Added forked version of viper

* Fixed unit tests

* Fixed more unit tests

* Removed copy from App.GetEnvironmentConfig
2018-04-09 18:16:11 +02:00
Harrison Healey
57ee6f505e Added additional unit tests for IE11 and compatibility mode (#8573) 2018-04-09 11:14:36 +01:00
Jesse Hallam
116849842b MM-8678: add CUD support for channel members via plugins (#8565)
* add CUD support for channel members via plugins

This effectively exposes AddChannelMember, UpdateChannelMemberRoles,
UpdateChannelMemberNotifyProps and LeaveChannel via the plugin API.

It also modifies the semantics of AddChannelMember to explicitly allow
for an empty user requestor, left as such for now via the plugin API.

* change the signature of AddChannelMember to accept a channel id instead of a channel
2018-04-06 17:08:57 -04:00
Harrison Healey
ff077c6761 MM-8400 Provide default config values to viper so that it reads all environment variables (#8581)
* MM-8400 Provide default config values to viper so that it reads all environment variables

* Added unit tests
2018-04-06 12:17:43 -04:00
Derrick Anderson
f9015a37f3 uncomment 4.9 upgrade code (#8582)
* set db to 4.9

* add prepatory code for 4.10

* bug from old example
2018-04-05 11:45:55 -04:00
Joram Wilander
715a7f893d Remove problematic mute test (#8580) v4.9.0-rc1 2018-04-05 08:53:01 -04:00
Joram Wilander
fb45087545 Comment out problematic mail test (#8579) 2018-04-04 22:24:26 -04:00
Jason Blais
e377baca00 Minor text changes to /open, /join and /mute slash commands (#8569)
* Update en.json

* Update en.json

* Update en.json

* Fix bad rebasing

* ping jenkins
2018-04-04 19:45:40 -04:00
Jesús Espino
846ccac6e5 MM-9934: More robust slack imports parsing (#8576) 2018-04-04 08:21:31 -07:00
Jesús Espino
654042a245 Migrate Advanced Permissions Roles when needed on cli commands (#8535) 2018-04-04 09:15:52 -04:00
Jason Blais
7986eeea26 Add missing timezone setting to app/diagnostics.go (#8572)
* Add missing timezone setting to app/diagnostics.go

* Update diagnostics.go

* Added TimezoneSettings.SupportedTimezonesPath to diagnostics
2018-04-04 08:14:23 -04:00
Christopher Speller
80925f7cfd Fixing unit tests for Go 1.10 (#8568) 2018-04-03 15:41:02 -04:00
Saturnino Abril
1476ca5b2d revert default ephemeral post message for out of channel mention (#8571) 2018-04-04 02:22:06 +08:00
Elias Nahum
0ab47cf145 translations PR 20180402 (#8570) 2018-04-03 05:27:59 +03:00
Harrison Healey
088f76ad6e MM-9868 Fixed mentioning users when followed by multiple periods (#8548)
* MM-9868 Fixed mentioning users when followed by multiple periods

* Added additional unit test

* Added comment to clarify test purpose
2018-04-02 12:40:28 -04:00
Elias Nahum
cffb891854 Make channel mute command respond with and without ~ prefix (#8549)
* Make channel mute command respond with and without ~ prefix

* Re-use splitMessage
2018-04-02 08:58:39 -07:00
Christopher Speller
cf1688f94a Fixing DB load causing user logout. (#8559) 2018-04-02 08:22:25 -07:00
Chris Duarte
80b3d14b56 Initialize timezone to a default state (#8560) 2018-03-29 23:50:24 -04:00
Christopher Speller
59606791a7 MM-9999 Fix unwanted team invite_id in email invites. (#8550)
* Fix unwanted team invite_id in email invites.

* Removing unused translation.
2018-03-29 14:20:36 -07:00
Christopher Speller
6fcdf4abc6 Fix sanitization on websocket user edit events. (#8551) 2018-03-29 17:03:27 -04:00
Joram Wilander
42c9170444 Update zoom plugin (#8542) 2018-03-29 14:58:33 -04:00
Jesse Hallam
0affad9c24 fix user timezone initialization (#8547)
On PreSave, need to ensure TimeZone isn't left as NULL.
2018-03-29 14:58:18 -04:00
Jesús Espino
014a3b6a60 Fixing misspell errors (#8544) 2018-03-29 10:04:54 -04:00
Chris Duarte
eb48292a3a Add ExperimentalTimezone flag (#8539) 2018-03-29 10:04:17 -04:00
Jesse Hallam
d4c0494360 MM-9661: tweak post message size log (#8517)
Call out the number of supported characters explicitly, moving the byte
limit to parentheses.
2018-03-29 10:02:58 -04:00
Christopher Speller
26b523e4a1 Revert "add individual platform packaging targets (#8366)" (#8537)
This reverts commit f0f4f68def.
2018-03-28 14:54:58 -07:00
Jesse Hallam
9c9a9ade12 Remove the index on Channels.DisplayName. (#8530)
As outlined in [this
discussion](https://pre-release.mattermost.com/core/pl/uw5bwmkb6irkbkn6pk9rkzpytr),
this index causes issues with MySQL's query planner, leading to full
table scans in a case where it would have made more sense to leverage a
filesort.
2018-03-28 09:22:55 -07:00
Jesse Hallam
1ccad749f1 Add unit test coverage for SqlStatusStore.GetAllFromTeam (#8520)
I added this as part of a separate PR that was deferred for now, but
figured the unit test coverage would still be useful.
2018-03-28 09:20:39 -07:00
Joram Wilander
3394a51dc6 Add defaults for SAML settings (#8536) 2018-03-28 11:24:13 -04:00
Jason Blais
5151a92f91 Add SAML scoping IDP settings to diagnostics.go (#8531) 2018-03-28 12:54:44 +01:00
George Goldberg
a28f6e7748 Fix roles table ID max length so MySQL 5.6 doesn't fail. (#8532) 2018-03-28 09:58:00 +01:00
Elias Nahum
ad8bf48c4e translations PR 20180326 (#8514) 2018-03-28 10:08:07 +03:00
Christian Claus
257f748732 [PLT-4340] Channel Mute and "/mute" command #7617 (#7713)
* Add command and store changes to allow mute toggling

* Change channel muting to use ChannelMember notification structure

* Suppress email and push notifications for a muted channel

* Make i18n keys issue-compliant

* Add notification-cache handling for channel-muting

* Add channel handle for channel-muting slash-command

* Add unit test for mute command

* Merge branch 'master' into PLT-4340

# Conflicts:
#	app/notification.go

* Fix issue that command_mute responses will be overwritten

* Fix i18n key for channel muting

* Apply new Provider Interface to MuteCommand

* Migrate mute notification property to mark_unread

PLT-4340

* Make some i18n improvements for command_mute

PLT-4340

* Remove de.json translations

* Prevent push notifications when channel is muted

* Treat Group messages like Direct messages

* Fix unit test

* Send WS event when the channel member notify props changed
2018-03-28 07:02:04 +03:00
George Goldberg
71c9dff766 Merge branch 'advanced-permissions-phase-1' 2018-03-27 22:36:55 +01:00
Jesse Hallam
2af4c7e649 fix typo in the pull request template (#8521) 2018-03-27 15:18:57 -04:00
amyblais
e40b7f6b31 Update NOTICE.txt (#8523) 2018-03-27 15:18:28 -04:00
Saturnino Abril
07b14c370a post a system message after a channel is converted from public to private (#8501) 2018-03-27 21:14:42 +08:00
Martin Kraft
e13e64711f Merge remote-tracking branch 'origin/master' into advanced-permissions-phase-1 2018-03-27 09:01:42 -04:00
George Goldberg
d8b4207018 Fix typo in MANAGE_SYSTEM_WIDE_OAUTH permission. (#8516) 2018-03-27 13:42:44 +01:00
Jesús Espino
9e6db178b0 Adding durafmt library and use it from enterprise global relay export (#8487)
* Adding durafmt library and use it from enterprise global relay export

* Allow to specify different server host and server name on smtp connections

* Fixing utils/smtp tests
2018-03-27 10:23:33 +02:00
Jesse Hallam
8491ba5740 Relax 4k post message limit (#8478)
* MM-9661: rename POST_MESSAGE_MAX_RUNES to \0_v1

* MM-9661: s/4000/POST_MESSAGE_MAX_RUNES_V1/ in tests

* MM-9661: introduce POST_MESSAGE_MAX_RUNES_V2

* MM-9661: migrate Postgres Posts.Message column to TEXT from VARCHAR(4000)

This is safe to do in a production instance since the underyling type is
not changing. We explicitly don't do this automatically for MySQL, but
also don't need to since the ORM would have already created a TEXT column
for MySQL in that case.

* MM-9661: emit MaxPostSize in client config

This value remains unconfigurable at this time, but exposes the current
limit to the client. The limit remains at 4k in this commit.

* MM-9661: introduce and use SqlPostStore.GetMaxPostSize

Enforce a byte limitation in the database, and use 1/4 of that value as
the rune count limitation (assuming a worst case UTF-8 representation).

* move maxPostSizeCached, lastPostsCache and lastPostTimeCache out of the global context and onto the SqlPostStore

* address feedback from code review:

* ensure sqlstore unit tests are actually being run
* move global caches into SqlPostStore
* leverage sync.Once to address a race condition

* modify upgrade semantics to match new db semantics

gorp's behaviour on creating columns with a maximum length on Postgres
differs from MySQL:
* Postgres
  * gorp uses TEXT for string columns without a maximum length
  * gorp uses VARCHAR(N) for string columns with a maximum length of N
* MySQL
  * gorp uses TEXT for string columns with a maximum length >= 256
  * gorp uses VARCHAR(N) for string columns with a maximum length of N
  * gorp defaults to a maximum length of 255, implying VARCHAR(255)

So the Message column has been TEXT on MySQL but VARCHAR(4000) on
Postgres. With the new, longer limits of 65535, and without changes to
gorp, the expected behaviour is TEXT on MySQL and VARCHAR(65535) on
Postgres. This commit makes the upgrade semantics match the new database
semantics.

Ideally, we'd revisit the gorp behaviour at a later time.

* allow TestMaxPostSize test cases to actually run in parallel

* default maxPostSizeCached to POST_MESSAGE_MAX_RUNES_V1 in case the once initializer panics

* fix casting error

* MM-9661: skip the schema migration for Postgres

It turns out resizing VARCHAR requires a rewrite in some versions of
Postgres, but migrating VARCHAR to TEXT does not. Given the increasing
complexity, let's defer the migration to the enduser instead.
2018-03-26 17:55:35 -04:00
Christopher Speller
4a69c277a6 Adding go client support and basic unit tests for channel autocomplete. (#8510) 2018-03-26 12:41:06 -07:00
George Goldberg
ca5198c7b6 Ignore blank role names in getRolesByName call. (#8507) 2018-03-26 13:56:57 +02:00
Chris
2bf2b5b851 send websocket event when users are activated / deactivated (#8500) 2018-03-23 15:04:22 -05:00
Jesús Espino
a8e0fc6c5d Changing the user-0 data to sysadmin and user-1 username to user-1 (#8494) 2018-03-23 15:32:10 -04:00
Jesse Hallam
1351874528 improve error handling around invalid Forward80To443 settings (#8496)
* If Forward80To443 is true, but not configured to listen on 443, fail to start the server with an error message.
* If Forward80To443 is false and LetsEncrypt is true, fail to start the server with an error message.
2018-03-23 09:33:50 -07:00
Elias Nahum
67c0efae1b Allow to get the team icon for open teams (#8499)
* Allow to get the team icon for open teams

* feedback review
2018-03-23 16:49:18 +03:00
Fede
6094778e69 [MM-9777] Avoids adding custom emojis with the same name as a system emoji (#8461)
* Emoji validation fails if name exists in system emojis

* Use hashmap instead of array to improve performance

* Changed utils/StringInMap to emoji/isSystemEmoji

* Load system emojis from model/emoji.json

* Added emoji.json from webapp

* Load system emojis from emoji_data.go instead of emoji.json

* Run `gofmt -w model/emoji_data.go`
2018-03-23 09:11:43 -04:00
Martin Kraft
5fa1b35819 Merge branch 'master' into advanced-permissions-phase-1 2018-03-23 09:08:49 -04:00
Jesse Hallam
87762ae62e Improved bulkload error handling (#8491)
* log the config file path used by the server on startup

* return an err if the bulk import command fails

* log the underlying errors that occur when importing

The code assumed all errors meant a missing resource, but it's possible
something else is at fault. Including the error helps pinpoint that more
readily.
2018-03-23 03:33:02 +08:00