Commit Graph

1043 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
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
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
Chris Duarte
80b3d14b56 Initialize timezone to a default state (#8560) 2018-03-29 23:50:24 -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
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
Joram Wilander
3394a51dc6 Add defaults for SAML settings (#8536) 2018-03-28 11:24:13 -04: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
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
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
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
Chris Duarte
74e703f58d Timezone feature (#8185)
* Add supported timezones into config

Remove Timezone list creation in favor of timezone from configs

Add Timezone field to Users table

Clean up format of SupportedTimezones in config

* Remove unwanted change

* Add test for updating user timezone

* Add empty map[string]string if Timezone is null

* Add EnableTimezoneSelection config

* Revert back to map[string]string for ClientConfig

* Refactor SupportedTimezones into timezones.json

* Include timezones.json in TestConfigFlag

* Add timezone api endpoint

* Bump varchar size to 256 and setMaxSize in user_store

* Refactor LoadConfig to LoadConfig and LoadTimezoneConfig

* Remove unnecessary argument in LoadConfig, mail_test

* Add test for timezone endpoint

* Add license header

* Refactor timezones endpoint to system.go

* Add system base route to timezone endpoint

* db timezone upgrade in db v4.9

* Avoid saving SupportedTimezones to config.json

* Add timezonePath support in config

* Remove EnableTimezoneSelection from config

* Use return statement without return parameter

* Refactor test for SupportedTimezones

* Check for supportedTimezone != nil instead of using len

* Decouple SupportedTimezones out of Config

* Fix failing test

* Add LastTeamIconUpdate back in upgrade.go

* Write timezone config in config_flag_test

* Add code fallback for default timezone support
2018-03-22 09:53:43 -04:00
Chris
7e444dfd88 add config for saml home realm discovery bypass (#8480) 2018-03-20 13:19:34 -05:00
George Goldberg
37f0e5e0eb Merge branch 'master' into advanced-permissions-phase-1 2018-03-19 10:53:37 +00:00
Carlos Tadeu Panato Junior
1b29b50330 update email test in the driver to be able to send the config in the body (#8453)
Signed-off-by: cpanato <ctadeu@gmail.com>
2018-03-13 10:42:56 -05:00
George Goldberg
fadcdd271a Merge branch 'master' into advanced-permissions-phase-1 2018-03-13 13:36:23 +00:00
Martin Kraft
426796829a MM-8839: Adds ChannelType to compliance-related model. (#8424) 2018-03-09 10:30:05 -05:00
Stephen Kiers
302dae5bb9 MM-9274- Sort Users in Channel by status (#8181)
* sort by lastActivity

* added status ordering to Users

* sort offline before dnd

* remove data not needed

* added seperate call for when order=‘status’ is on GetUser request

* remove PrintLn

* styling fix

* remove mistake

* mistake 2

* better comment

* explicit if statemnt

* writing tests

* removed manually added mocks

* generated mock

* ICU-668 Added unit tests

* style fix

* sort by lastActivity

* added status ordering to Users

* sort offline before dnd

* remove data not needed

* added seperate call for when order=‘status’ is on GetUser request

* remove PrintLn

* styling fix

* remove mistake

* mistake 2

* better comment

* explicit if statemnt

* writing tests

* removed manually added mocks

* generated mock

* ICU-668 Added unit tests

* style fix

* reverse dnd and offline

* Fixed app.SaveStatusAndBroadcast

* Fixed incorrect merge

* Fixing incorrect merge again
2018-03-09 07:48:30 -05:00
Jonathan
5ed3b42629 MM-8840: Add GlobalRelay Configuration Settings (#8304)
* Added new GlobalRelay config settings

* Adding default values to global relay config

* Migrate global relay config tests to table driven tests
2018-03-08 06:45:36 -05:00
Chris
03b6d1f652 respect plugin manifest webapp bundle_path (#8393) 2018-03-07 13:53:07 -06:00
Chris
e8943936c5 general cleanup (#8387) 2018-03-07 12:36:40 -06:00
Joram Wilander
6b3c9a480a Add preparatory upgrade code for 4.9 (#8408) 2018-03-05 14:39:49 -05:00
Jesse Hallam
fbff94f3be MM-8604: emit config/license websocket events (#8371) 2018-03-05 12:18:22 +00:00
George Goldberg
901acc9703 Merge branch 'master' into advanced-permissions-phase-1 2018-03-02 15:55:03 +00:00
Christian Hoff
2b3b6051d2 PLT-7567: Integration of Team Icons (#8284)
* PLT-7567: Integration of Team Icons

* PLT-7567: Read replica workaround, upgrade logic moved, more concrete i18n key

* PLT-7567: Read replica workaround, corrections

* PLT-7567: upgrade correction
2018-03-01 19:11:44 +00:00
Carlos Tadeu Panato Junior
6e024c45b5 [PLT-8186] add support for ec2 instance profile authentication (#8243) 2018-02-28 23:12:11 +00:00
Chris
55261a2b15 fix scheduled task race (#8355) 2018-02-23 12:56:32 -06:00
Christopher Speller
75d9a3a3b9 MM-8681 Adding config settings necessary for using CloudFront. (#8307)
* Adding config settings nessisary for using CloudFront.

* Adding new config settings to diagnostics.
2018-02-20 12:49:45 -08:00
Chris
19a5d0047d MM-8710: Web Hub optimizations (#8293)
* webhub optimizations

* test fix

* minor fix

* big perf improvement to ToJson after precomputing

* fix hub connection count
2018-02-20 10:50:10 -08:00
Harrison Healey
babd795d79 MM-9556 Added ability to upload files without a multipart request (#8306)
* MM-9556 Added ability to upload files without a multipart request

* MM-9556 Handled some unusual test behaviour
2018-02-20 10:41:00 -05:00
Saturnino Abril
45d7c51d9f merge 4.7.1 to master 2018-02-19 23:47:34 +08:00
George Goldberg
f8289eb286 Merge branch 'master' into advanced-permissions-phase-1 2018-02-19 11:19:39 +00:00
Jesús Espino
8891fa2a5e MM-8827: Add ADD_REACTION, REMOVE_REACTION and REMOVE_OTHERS_REACTIONS permissions (#8300) 2018-02-19 11:13:29 +00:00
JoramWilander
291432e254 Add upgrade code from 4.7.0 to 4.7.1 2018-02-16 17:14:22 -05:00
JoramWilander
98bd9a0753 Remove bad field from ChannelMemberHistory model 2018-02-16 17:03:12 -05:00
Carlos Tadeu Panato Junior
8c3a7b75de [PLT-539] Update incoming webhooks to accept multipart/form-data content (#7873) 2018-02-16 08:29:12 -08:00
Martin Kraft
642d78173a Merge remote-tracking branch 'origin/master' into advanced-permissions-phase-1 2018-02-14 08:53:25 -05:00
Derrick Anderson
4e4535bda9 Merge release-4.7 with master in side branch 2018-02-13 23:20:27 -05:00
Jonathan
bf1fdf92c7 XYZ-110: Cherrypicking changes from release-4.7 to master (#8254)
* Cherry-picking 7b2861de3a to master because enterprise/master has code in it that enterprise/release-4.7 does not, and I don't want enterprise/master to break the next time somebody merges enterprise/release-4.7 to enterprise/master

* Renamed file to match existing scheme

(cherry picked from commit 8c22c5c6c6)
2018-02-13 15:17:29 -05:00
Jonathan Fritz
8c22c5c6c6 Renamed file to match existing scheme 2018-02-13 10:48:34 -05:00
George Goldberg
5c101253c5 Merge branch 'master' into advanced-permissions-phase-1 2018-02-13 13:46:01 +00:00
Jonathan Fritz
18fa32567b Merge branch 'release-4.7' into XYZ-110 2018-02-13 08:39:56 -05:00
Martin Kraft
b7fc3d7d35 Updates migration tests to reflect front-end mapping changes. (#8237) 2018-02-13 12:08:21 +01:00