Commit Graph

9845 Commits

Author SHA1 Message Date
Christopher Speller
eb9ff34fcf Merge branch 'master' into advanced-permissions-phase-2 2018-04-27 14:12:01 -07:00
Christopher Speller
2e6b3da1d3 Fixing some merge conflicts with structured logging. (#8685) 2018-04-27 13:31:50 -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
Corey Hulen
2acbc77d78 MM-10375 Fixing connected socket count (#8682)
* Fixing connected socket count

* Adding unit test
2018-04-27 10:38:40 -07:00
George Goldberg
2386acb3dd Merge branch 'master' into advanced-permissions-phase-2 2018-04-27 10:53:38 +01:00
Jesse Hallam
7abd6176e9 modestly extend SQLite support (#8677)
This is primarily to unblock the advanced permissions merge. There's
still more work to do if we wanted this to be mainstream, but as it's
mainly for unit tests, I'm just focussing on the minimum.
2018-04-27 10:07:36 +01: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
james-mm
d3f09b54e2 Update ISSUE_TEMPLATE.md (#8292)
* Update ISSUE_TEMPLATE.md

Customer wanted us to be more explicit on this page about searching for existing tickets in JIRA vs Github before proceeding to submit a new ticket.

* Update ISSUE_TEMPLATE.md

* Shorten proposed text
2018-04-25 15:39:58 -04:00
Martin Kraft
7294644e9d Merge remote-tracking branch 'origin/master' into advanced-permissions-phase-2 2018-04-24 10:21:18 -04:00
Saturnino Abril
3224d2f6a3 add api to convert a channel from public to private and restrict that to system_admin (#8655) 2018-04-23 08:18:58 -04:00
George Goldberg
cd55c44c8f MM-8796: Full implementation of "Schemes" in Store/Model/App layers. (#8357)
* Add Scheme model and stub store.

* Port ChannelStore to be Scheme aware.

* Make almost all the API/APP layer work with ChannelSchemes.

Only thing still hacky is UpdateChannelMemberRoles().

* Add basic SchemeStore implementation.

* Migrate UpdateChannelMemberRoles properly and fix tests.

* Update store tests and mocks so they work.

* Include creating default roles in Scheme create store function.

* Implement role deletion and start scheme deletion.

* Only use non-deleted roles for authorization.

* Add GetByScheme method to Team store.

* Add GetChannelsByScheme.

* Update store mocks.

* Implement scheme deletion in the store.

* Rename is valid function.

* Add offset and limit to queries to fetch teams and channels by scheme.

* Fix queries.

* Implement scheme awareness in Team store and add a migration.

* Tidy up ChannelStore mapping functions and add exhaustive unit tests.

* Add all missing i18n.

* Proper tests for TeamStore internal functions and fix them.

* Make additional TeamMember fields nullable.

* Make new ChannelMember fields nullable.

* Create new nullable columns without defaults.

* Make new fields in large tables nullalble.

* Fix empty list of TeamMembers.

* Deduplicate SQL queries.

* Fix spelling.

* Fix review comment.

* More review fixes.

* More review fixes.
2018-04-20 14:49:13 -04:00
Joram Wilander
853445dc2e Properly implement session deep copy (#8602) 2018-04-20 12:25:14 -04:00
Joram Wilander
283f34b9c6 MM-10007 Send an admin and regular WS events when a user is updated (#8588)
* Add user.DeepCopy() function

* Add omit admins/non-admins to WS broadcast and use for updating users

* Updates per feedback and adding unit test for ShouldSendEvent
2018-04-20 08:44:18 -04:00
Joram Wilander
7987c95fcd MM-10133 Suppress confusing personal access token message in invalid session error (#8645)
* Suppress confusing personal access token message in invalid session error

* Updates per feedback
2018-04-20 08:44:01 -04:00
Joram Wilander
514033f14c Fix panics caused by race in notification code (#8652) 2018-04-19 11:21:33 -03:00
Martin Kraft
4921fda79f MM-10122: Adds a mention for added-to-channel messages even when 'username mentions' are disabled. (#8648) 2018-04-19 11:28:04 +01:00
Christopher Speller
2b83f8c48f Removing user cache clear from SessionHasPermissionsTo (#8624) 2018-04-18 19:41:15 -07:00
Jesús Espino
0910eae31d MM-9779: Incorporate a Token into the invitations system (#8604)
* Incorporate a Token into the invitations system

* Adding unit tests

* Fixing some api4 client tests

* Removing unnecesary hash validation

* Change the Hash concept on invitations with tokenId

* Not send invitation if it wasn't able to create the Token

* Fixing some naming problems

* Changing the hash query params received from the client side

* Removed unneded data param in the token usage
2018-04-18 13:46:10 -07:00
George Goldberg
b13a228b04 MM-10121: CLI command to reset permissions system to default state. (#8637)
* MM-10121: CLI command to reset permissions system to default state.

* Review comment.
2018-04-18 10:18:07 +01:00
Joram Wilander
a1882d4004 Ignore rolled log files (#8644) 2018-04-18 08:43:55 +01:00
Joram Wilander
b15f69ea30 Handle app errors in user autocomplete endpoint (#8643) 2018-04-17 15:39:08 -07:00
Carlos Tadeu Panato Junior
51a6e95f58 add app shutdown to make sure the goroutines finish and all process are closed (#8629)
* run the send email verification as goroutine as well

* add app shutdown to make sure all go routines finish
2018-04-17 11:06:55 -04:00
George Goldberg
5511106d93 MM-9918: Trim trailing / from push proxy URL. (#8635) 2018-04-17 07:13:16 -07:00
Derrick Anderson
af98bf1d49 Merge branch 'merge49final' 2018-04-17 09:49:02 -04:00
Derrick Anderson
58e559da39 Add MM9720 changes back in for master merge 2018-04-17 09:37:20 -04:00
Derrick Anderson
885b8e51f3 Merge remote-tracking branch 'origin/release-4.9' into merge49final 2018-04-17 09:21:33 -04:00
Daniel Schalla
997df03ac1 Initial Commit of Ephemeral Message Support for System Admins (#8611)
Fixed Permission Test

Fixed and extended ephemeral message tests; Removed Online/Activity Updates

Set Create Time to current time

gofmt
2018-04-17 08:20:47 -04:00
Jesse Hallam
3a4c7603b3 MM-10020: avoid duplicating unique indexes (#8587)
* unit test TestGet(Search)Replica

This adds partial, testing-focused support for SQLite, as well as removing
some translated log messages that required initializing i18n just for
testing.

* avoid returning master twice when no replicas are configured

* remove duplicate indexes

* unit test GetAllConns
2018-04-16 18:23:20 -07:00
Christopher Speller
ba6f9075c1 Fix opengraph images not going through the image proxy. (#8627) 2018-04-16 09:00:59 -04:00
Christopher Speller
6e2cb00008 Depenancy upgrades and movign to dep. (#8630) 2018-04-16 08:37:14 -04:00
Carlos Tadeu Panato Junior
bf24f51c4e [MM-9904] Add /invite slash command to invite users to a channel (#8482)
* [MM-9904] Add /invite slash command to invite users to a channel

* Update en.json
2018-04-16 14:23:58 +02:00
Derrick Anderson
3176e13b1f revert changes from MM9720 v4.9.0 v4.9.0-rc6 2018-04-13 20:42:27 -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
Christopher Speller
a7fd13384b Removing user cache clear from SessionHasPermissionsTo (#8625) 2018-04-13 20:09:06 -04:00
Derrick Anderson
0759cf639d Merge remote-tracking branch 'origin/merge49rc5' 2018-04-13 14:36:37 -04:00
Derrick Anderson
e83b1cba5c Merge remote-tracking branch 'origin/release-4.9' into merge49rc5 2018-04-13 13:49:52 -04:00
Jesús Espino
84ca98d9a9 Fixed the example text on CLI channel command (#8613) 2018-04-13 07:58:21 -07:00
Joram Wilander
21b1cd44e0 Fix error handling when requesting profile image for bad user ID (#8618) 2018-04-13 07:57:22 -07:00
Jesse Hallam
ae5e324be8 MM-9977: test config.SetDefaults leaves nothing nil (#8610)
* MM-9977: test config.SetDefaults leaves nothing nil

* clarify test default config test cases

* comment re: allowing nil slice

* extend config SetDefaults to handle partially initialized configs
2018-04-13 07:56:09 -07:00
Guy B
911b409936 Websocket custom dialer support (#8592)
* added support for custom websocket dialers (to be able to skip system proxy for example)

* removed newline

* typoe, arguments order
2018-04-12 15:54:03 -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
Jesús Espino
8df6d5cc30 Add list command to teams command in CLI (#8612)
* Add list command to teams command in CLI

* Using App instead of Store to get the teams
2018-04-12 11:50:44 -04:00
Joram Wilander
191e1ad556 MM-8180 Improve error message for testing smtp connections (#8608)
* Improve error message for testing smtp connections

* Update error message
2018-04-12 11:36:56 -04:00
Elias Nahum
bc49b12427 translations PR 20180411 (#8606) v4.9.0-rc5 v4.9.0-rc4 2018-04-12 10:11:55 -04:00
Elias Nahum
1ebf19825b Fix mute channel when not a member and adding unit tests (#8609) 2018-04-12 09:12:59 -04:00
Harrison Healey
2d0fef4d94 MM-10036 Ensured correct handling of capitalized special mentions (#8607) 2018-04-11 10:33:20 -04:00
Derrick Anderson
332411490d Merge branch 'jespino-merge-release-4.9' 2018-04-10 10:55:25 -04:00
Jesús Espino
5856325c13 Merge remote-tracking branch 'origin/release-4.9' into merge-release-4.9 2018-04-10 11:29:03 +02: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
Martin Kraft
ffa24fbcb2 MM-8834: Changes separator between jobs message and details. (#8589) v4.9.0-rc3 2018-04-09 09:39:57 -04:00