Commit Graph

523 Commits

Author SHA1 Message Date
Martin Kraft
be177caf5f Merge remote-tracking branch 'origin/master' into advanced-permissions-phase-2 2018-05-28 08:20:12 -04:00
Carlos Tadeu Panato Junior
b6d5cc4f69 re-enabling TestSendMailUsingConfigAdvanced (#8836) 2018-05-27 09:56:44 -04:00
Martin Kraft
baf697e348 Merge remote-tracking branch 'origin/master' into advanced-permissions-phase-2 2018-05-25 11:25:40 -04:00
Saturnino Abril
94b2eca2d1 add ExperimentalHideTownSquareinLHS in config setting (#8751) 2018-05-24 16:41:30 -04:00
Martin Kraft
a51b2367a3 MM-10402: Adds RunJobs to client config API. (#8846) 2018-05-24 16:22:54 +02:00
Martin Kraft
69304fb54d Merge remote-tracking branch 'origin/master' into advanced-permissions-phase-2 2018-05-24 08:40:52 -04:00
Saturnino Abril
70a118c0fd remove license check when enforcing password requirements (#8840)
Signed-off-by: Saturnino Abril <saturnino.abril@gmail.com>
2018-05-23 20:36:20 +08:00
Martin Kraft
f40666f9e8 Merge branch 'master' into advanced-permissions-phase-2 2018-05-22 14:15:54 -04:00
Saturnino Abril
ce378adc97 add EnablePreviewModeBanner in config (#8834)
Signed-off-by: Saturnino Abril <saturnino.abril@gmail.com>
2018-05-22 11:10:27 -07:00
Martin Kraft
4c683aff76 Merge remote-tracking branch 'origin/master' into advanced-permissions-phase-2 2018-05-22 12:54:00 -04:00
Balasankar C
d3ead7dc85 MM-10640 Set EnableUserCreation to true by default (#8815)
* Set EnableUserCreation to true by default

* Fix argument type to FormatBool

* Convert EnableUserCreation instances to pointer

* Convert to boolean in tests also

* Set value of pointer to be false

* Convert remaining EnableUserCreation instances to pointer
2018-05-18 09:57:30 -04:00
Martin Kraft
78d95a25f7 Merge remote-tracking branch 'origin/master' into advanced-permissions-phase-2 2018-05-18 08:23:02 -04:00
Christopher Speller
11cbb59747 Renaming platform binary to mattermost. (#8801) 2018-05-17 12:40:40 -07:00
George Goldberg
463065c8ba MM-10606: License feature flag for custom schemes. (#8804)
* MM-10606: Add new field to license for custom schemes.

* Add feature flag to license check for Schemes.
2018-05-17 16:29:31 +01:00
Joram Wilander
1f6c271b3b MM-8708 Remove api package (#8784)
* Remove api package

* Remove api dependency from cmd package

* Remove EnableAPIv3 setting

* Update web tests

* Add more websocket tests

* Move some ws and oauth tests to api4 package

* Move command tests into api4 package

* Test fixes

* Fix msg command test

* Add some app file tests
2018-05-16 13:43:22 -04:00
Jesse Hallam
2b27e12445 MM-10188: expect io.Reader in FileBackend.WriteFile (#8765)
This is a reworked set of changes originally from @josephGuo to begin
reducing the duplicated memory required when uploading files.
2018-05-10 15:16:33 -07:00
Harrison Healey
3b138c8b16 MM-10189 Fixed inconsistency when using environment variables for MessageExportSettings (#8705) 2018-05-03 09:55:03 -04:00
Jesús Espino
ffb834ec3c Fix TestSendNotifications test (#8712) 2018-05-03 09:40:54 -04:00
Jesús Espino
baba8fa92f Upgrading minio-go library to 6.0.0 (#8651)
* Upgrading minio-go library to 6.0.0

* Removing unnecesary Gopkg constraint
2018-04-30 14:35:10 -07:00
Christopher Speller
686c2fbab7 Structured logging (#8673)
* Implementing structured logging

* Changes to en.json to allow refactor to run.

* Fixing global logger

* Structured logger initalization.

* Add caller.

* Do some log redirection.

* Auto refactor

* Cleaning up l4g reference and removing dependancy.

* Removing junk.

* Copyright headers.

* Fixing tests

* Revert "Changes to en.json to allow refactor to run."

This reverts commit fd8249e99b.

* Fixing some auto refactor strangeness and typo.

* Making keys more human readable.
2018-04-27 12:49:45 -07:00
Jesse Hallam
6d50d836f5 MM-10232, MM-10259: Improve error handling from invalid json (#8668)
* MM-10232: improve error handling from malformed slash command responses

Switch to json.Unmarshal, which doesn't obscure JSON parse failures like
json.Decode. The latter is primarily designed for streams of JSON, not
necessarily unmarshalling just a single object.

* rework HumanizedJsonError to expose Line and Character discretely

* MM-10259: pinpoint line and character where json config error occurs

* tweak HumanizeJsonError to accept err first
2018-04-26 11:19:25 -04:00
Derrick Anderson
885b8e51f3 Merge remote-tracking branch 'origin/release-4.9' into merge49final 2018-04-17 09:21:33 -04:00
Jesse Hallam
8056dc33e3 Prevent disabling or modifying l4g logging filters (#8628)
The underlying l4g library is not resilient to filter modifications in
the presence of concurrent goroutines. In particular, it's not safe to
call Close() on filters which might be actively held by a goroutine for
logging.

This change disables all modifications to existing filters once
initialized by the App layer. In practice, we might be able to get away
with some modifications to the existing filters (i.e. changing levels),
but the [golang memory model](https://golang.org/ref/mem) makes no
guarantees that it is safe to do so:

> Programs that modify data being simultaneously accessed by multiple goroutines must serialize such access.

We can solve this holistically by introducing the requisite locking
within our fork of the l4g library. For now, we just disable all
modifications.
2018-04-13 20:09:38 -04:00
Stan Chan
7826774a14 Add Auto Responder handler (#8386)
WIP Out Of Office

Return error for status command if user status is OOO

Ignore notifications if Out Of Office

Disable AutoResponder if status is set to online

Add test for AutoResponder

DisableAutoResponse when manually setting status

Remove check on status slash command

return early if user does not exists in SendAutoResponse method

Add proper error handling

Add a newline after error handling

Revert back to err == nil in api4/status.go

Remove a.Go when using a.Publish

Add name consistency with the feature auto responder

Last changes for name consistency, also fix failing test with auto_responder

Fix names of functions in auto responder test

Add ExperimentalEnableAutomaticReplies flag

Auto Responder reply to a post
2018-04-12 15:02:36 -04:00
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
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
Joram Wilander
fb45087545 Comment out problematic mail test (#8579) 2018-04-04 22:24:26 -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
Martin Kraft
e13e64711f Merge remote-tracking branch 'origin/master' into advanced-permissions-phase-1 2018-03-27 09:01:42 -04: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
Martin Kraft
5fa1b35819 Merge branch 'master' into advanced-permissions-phase-1 2018-03-23 09:08:49 -04:00
Jesse Hallam
6036ddad85 MM-9804: emit defaults for all enterprise config (#8490)
* MM-9804: emit defaults for all enterprise config

This prevents the client from having to write inverted checks if a
certain value defaults as `'true'` instead of `'false'`.

* move EnableMobileFile(Upload|Download) to a defaulted enterprise configuration
2018-03-22 07:57:29 -07: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
Jesse Hallam
9d701c7044 Fix various segfaults when running go test manually (#8448)
* failing to find i18n shouldn't segfault

The server was trying to handle the fact that it couldn't find the i18n
directory, by emitting a translated log message...

* fix utils.FindDir

The attempts to find the directory in the parent or grandparent directory
don't work if the current working directory was inside `enterprise`, with
`enterprise` itself being a symlink as per the usual developer setup.

Recurse to the root of the filesystem, cleaning the path along the way
to work around this limitation (and allow tests to be run from an
arbitrarily deep nesting level.)

Fix corresponding usages to employ filepath.Join.

* failing to find html templates shouldn't segfault

* fail fast if the test user cannot be created

* rework utils.FindDir to retain backwards compatibility
2018-03-21 18:27:14 +00:00
Jesús Espino
b4784be2de Receive the email date as parameter (#8484) 2018-03-21 16:11:45 +01:00
George Goldberg
37f0e5e0eb Merge branch 'master' into advanced-permissions-phase-1 2018-03-19 10:53:37 +00:00
Derrick Anderson
accf612d25 Merge remote-tracking branch 'origin/release-4.8' into t0merge48master 2018-03-15 14:30:57 -04:00
Jesús Espino
e3edc2c121 Isolating configuration, sending emails and connection to SMTP. (#8452)
* Isolating configuration, sending emails and connection to SMTP.

* Building smtpAddress once

* Remove unnecesary errX variables

* Moving mail connection information to new data structure
2018-03-15 19:07:47 +01:00
Joram Wilander
d1ed79a66c Add content type to API error response (#8460) 2018-03-14 18:09:04 -04:00
Derrick Anderson
690cbc4903 Merge remote-tracking branch 'origin/release-4.8' into t2releasetomaster 2018-03-13 17:14:05 -04:00
Michał Odziemczyk
88b9d2225d MM-9795: Fix theme chooser for non-EE builds (#8440)
* Fix theme chooser for non-EE builds

* fix compilation

* remove whitespace

* fix
2018-03-13 13:21:02 -04:00
Carlos Tadeu Panato Junior
db4402c40d remove s3 region to be mandatory and fix when user call test s3 when the config is saved (#8454) 2018-03-14 00:26:56 +08:00
George Goldberg
fadcdd271a Merge branch 'master' into advanced-permissions-phase-1 2018-03-13 13:36:23 +00:00
Chris
e8943936c5 general cleanup (#8387) 2018-03-07 12:36:40 -06:00
George Goldberg
901acc9703 Merge branch 'master' into advanced-permissions-phase-1 2018-03-02 15:55:03 +00:00
Carlos Tadeu Panato Junior
4b5541db46 [PLT-8024] Support LOGIN authentication method for SMTP (#8140)
* [PLT-8024] Support LOGIN authentication method for SMTP

* added initial unit tests
2018-03-01 12:58:35 +01: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
600528e1cf optimize lru purging (#8381) 2018-02-28 12:07:11 -08:00
Joram Wilander
2782602c6e Temporarily disable flaky TestSendMailUsingConfigAdvanced test (#8379)
* Temporarily disable flaky TestSendMailUsingConfigAdvanced test

* Remove imports
2018-02-27 13:07:31 -05:00