Commit Graph

286 Commits

Author SHA1 Message Date
cpanato
4cf6913c1c Merge remote-tracking branch 'upstream/release-5.3' into release-5.3-daily-merge-20180904 2018-09-04 23:27:39 +02:00
Jesse Hallam
b98ef658ad MM-11720: disable loading plugin specific config from the environment (#9334)
There are numerous issues here, including some non-determinism in the viper library (fixable) and some annoying behaviour regarding periods in keys, often used by plugin ids (fix unknown). Let's defer the handling of same until we can get our config loading library to do what we need it to do vs. having to hack around viper all the time.
2018-09-03 17:08:25 +02:00
Daniel Schalla
531897b1f0 add megacheck as makefile target (#9288)
Fix code issues in channel_test.go

Fix Channel Test Issues detected by Megacheck

Fix API Emoji Test Issues detected by Megacheck

Fixed API Issues Reported by Megacheck

Fixed App issues reported by megacheck

Remaining fixes

removed test added by mistake from old HEAD

gofmt

Store Fixes

simplified returns

Fix test for multi member channel delete

revert to delete unused function
2018-09-03 14:08:40 +02:00
George Goldberg
d2945cdd77 MM-11782: Make archived channels experimental and off-by-default. (#9281)
* MM-11782: Make archived channels experimental and off-by-default.

* Fix test.
2018-08-22 21:12:51 +02:00
Harrison Healey
4299ef312b MM-11382 Remove special handling of PluginSettings when loading config (#9234)
* MM-11382 Only override PluginSettings from environment when necessary

* MM-11382 Remove special handling of PluginSettings when loading config

* Add extra unit test
2018-08-10 10:10:29 +02:00
Martin Kraft
5872bf9c2f Pr 9039 (#9187)
* MM-11065: Allow to search and get archived channels from the API

* Fixing more tests

* Add some unit tests

* Add includeDeleted parameter to session permissions check function

* More test fixing

* Adding archive channels list in channels search

* Add restriction for archived channel edition

* Reverting permissions checks modification

* Changed the query parameter to include_deleted

* Enable search archive channels as true by default

* Adding tests for verify search on deleted channels

* Allowing to override archive channels during the imports

* Fixed test

* Search in archive channels from the API must be explicitly requested

* Removing includeDeleted parameter from GetChannelByName and GetChannelByNameForTeam

* Back to ViewArchivedChannels config

* Fixing tests

* Reverting GetChannelByName parameter

* Add include deleted parameter on GetChannel functions in plugins api

* Fixing tests
2018-07-30 15:06:08 -04:00
Chris Duarte
da124f018d Add ExperimentalSidebarPreference in the config (#9013)
* Add ExperimentalSidebarPreference in the config

* Override Sidebar preference based on GroupUnread settings

* Rename to ExperimentalChannelOrganization

* Add Sidebar config in diagnostics

* Fix diagnostics for experimental_channel_organization
2018-07-23 11:18:24 -04:00
Christopher Speller
74e5d8ae66 MM-11120 Adding setting to disable email invitations and rate limiting. (#9063)
* Adding setting to disable email invitations.

* Adding a setting and rate limiting for email invite sending.

* Modifying email rate limit to 20/user/hour

* Adding EnableEmailInvitations to client side config and command.
2018-07-10 10:54:25 +02:00
Kenny Au
437f9f5b64 Gfycat integration (#8971)
* Gfycat integration

* Added gfycat api credentials to config.
2018-06-27 15:35:15 -04:00
Harrison Healey
6d8140337e MM-8701 Limit the number of client config fields sent before user logs in (#8954)
* MM-8701 Limit the number of client config fields sent before user logs in

* Fixed missing client config field

* Reduced duplication between limited and regular client config
2018-06-18 12:39:22 -04:00
Harrison Healey
d0cda0500e MM-10769 Rename references to spf13/viper to mattermost/viper (#8948) 2018-06-14 08:15:02 -07:00
Corey Hulen
656c8a62d1 Prototype for CBA (#8475)
* Prototype for CBA

* Fixing gofmt issues

* Do not require password if logging in with certificate

* Fixing issues from feedback

* Adding unit tests

* Fixing feedback
2018-06-12 10:16:39 -07:00
Jesse Hallam
0ba0af889e MM-6839: searching for paths relative to executable (#8915)
* MM-6839: search relative to executable (#8853)

* MM-6839: searching for paths relative to executable

In addition to searching relative to the current working directory, also
search relative to the location of the binary. This helps locate config
and i18n files when invoking an absolute path to the mattermost binary.

* MM-6839: find mattermost/ binary using utils.FindFile

* add unit tests for utils.FindFile to exclude directories

* fix filtering out directories in FindFile

* fix platform invoking ./bin/mattermost
2018-06-06 07:18:24 -07:00
Saturnino Abril
312edbe531 [MM-10718] Move custom branding to TE (#8871)
* move custom branding to TE
* move brand's enterprise code to server and remove BrandInterface
2018-06-02 06:33:59 +08:00
George Goldberg
27e7841a73 Merge branch 'advanced-permissions-phase-2' 2018-05-31 10:25:31 +01:00
Harrison Healey
2fe8878749 MM-9547 Added config setting to control url autolinking schemes (#8862)
* MM-9547 Added config setting to control autolinking schemes

* Renamed AutolinkingSchemes to CustomUrlSchemes
2018-05-30 10:48:04 -04:00
Christopher Speller
2f6039f23f Revert "MM-6839: search relative to executable (#8853)" (#8876)
This reverts commit d3cf110620.
2018-05-29 13:21:42 -07:00
Jesse Hallam
d3cf110620 MM-6839: search relative to executable (#8853)
* MM-6839: searching for paths relative to executable

In addition to searching relative to the current working directory, also
search relative to the location of the binary. This helps locate config
and i18n files when invoking an absolute path to the mattermost binary.

* MM-6839: find mattermost/ binary using utils.FindFile
2018-05-29 10:55:49 -04:00
Carlos Tadeu Panato Junior
4f5fdb6f89 fix bad merge (#8869) 2018-05-29 14:00:46 +02:00
Martin Kraft
c180cdbd1c Merge remote-tracking branch 'origin/master' into advanced-permissions-phase-2 2018-05-28 10:35:27 -04:00
Carlos Tadeu Panato Junior
c3e9c41440 [MM-1915] Add Deactivate Account - server side (#8699) 2018-05-28 16:20:08 +02: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
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
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
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
Christopher Speller
11cbb59747 Renaming platform binary to mattermost. (#8801) 2018-05-17 12:40:40 -07: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
Harrison Healey
3b138c8b16 MM-10189 Fixed inconsistency when using environment variables for MessageExportSettings (#8705) 2018-05-03 09:55:03 -04: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
Chris Duarte
eb48292a3a Add ExperimentalTimezone flag (#8539) 2018-03-29 10:04:17 -04: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
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
George Goldberg
37f0e5e0eb Merge branch 'master' into advanced-permissions-phase-1 2018-03-19 10:53:37 +00: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
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
Joram Wilander
5fb4b1bc93 MM-8593 Default APIv3 to disabled for new installs (#8353)
* Default APIv3 to disabled for new installs

* Add EnableAPIv3 setting to client config

* Enable APIv3 for needed tests
2018-02-23 07:55:02 -08:00
Chris
d44ef7ea67 Remove global site url (#8343)
* remove global site url

* missed one

* revert mysterious change
2018-02-22 18:23: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