Commit Graph

312 Commits

Author SHA1 Message Date
Joshua Bezaleel Abednego
c49f755a14 Create CLI command "team modify" to modify team's privacy setting. (#10898) 2019-07-17 11:49:12 +02:00
Rajat Varyani
c1f3c83d38 Config migrate SAML keys and certificates (#11596) 2019-07-14 09:19:51 +02:00
Claudio Costa
70fd0e0d6f Fix mixup between stdout and stderr in CLI (#11529) 2019-07-10 14:36:49 +02:00
Taufiq Rahman
9ce5b28c63 [MM-16667] Migrate User.GetByUsername to Sync by default #11453 (#11520)
* Migrate User.GetByUsername to Sync by default #11453

* fix app errors #11453

* fix app errors #11453

* fix cmd error #11453

* fix shadow var #11453

* fix shadow user var #11453

* fix test error

* fix test error #11453
2019-07-10 10:46:03 +02:00
Mounica Paladugu
ff89b2c8e1 [MM-16170] Migrate Team.GetTeamsByUserId to Sync by default (#11100)
* [MM-16170] Migrate Team.GetTeamsByUserId to Sync by default

* Fixing comments
2019-07-09 12:21:18 -04:00
Marc Argent
e209a7acb4 GH-11466 Migrate User.UpdatePassword to Sync by default (#11495)
* GH-11466 Migrate User.UpdatePassword to Sync by default

* GH-11466 format fix
2019-07-09 04:50:01 -07:00
Jesús Espino
da6cb83f9b Allow to export global relay to zip (#11492)
* Allow to export global relay to zip

* Addressing review comments
2019-07-08 11:06:59 +02:00
Claudio Costa
c95d295dce Update CLI channel list and search commands to show if a channel is private (#11480) 2019-07-02 16:27:00 -04:00
George Goldberg
0d8377cc59 MM-16439: Print config ordered by key alphabetically for easy diff. (#11349)
* MM-16439: Print config ordered by key alphabetically for easy diff.

* Clarify comment.
2019-06-21 17:38:26 +01:00
Rodrigo Villablanca Vásquez
59e7bf1c23 Migrates Channel.GetByName to sync by default (#11187)
* Channel.GetByName and Channel.GetByNameIncludedDeleted sync by default

* Suggested changes

* Fix some vars shadowing

* Rename of vars inside goroutine

* Shadow variable corrected
2019-06-20 15:21:36 +02:00
piperRyan
2ce36c2eb1 Migrates "Channel.GetAll" to Sync by default (#11281) 2019-06-19 10:40:05 +01:00
Rodrigo Villablanca Vásquez
d1569c48d2 Migrates Channel.PermanentDeleteMembersByChannel to sync by default (#11238) 2019-06-18 09:33:42 -07:00
Jesús Espino
693017a317 Migrate Bots store to sync by default (#11182)
* Migrate Bots store to sync by default

* Fixing tests

* Fixing govet

* Fixing tests
2019-06-14 08:20:49 -07:00
Jesús Espino
76bab4f0c2 Migrating User Store VerifyEmail, GetByAuth and GetByEmail functions to sync by default (#10941) 2019-06-12 19:30:50 +02:00
Bolarinwa Balogun
88202a76d9 [MM-16159] Migrate "Team.GetByName" to Sync by default (#11107)
* [MM-16159] Migrate "Team.GetByName" to Sync by default

* Refactor to correct mistakes and remove irrelevant code
2019-06-11 09:35:17 -04:00
Jesse Hallam
719412c1a0 MM-15956: consistent params for config migrate (#11024)
This changes the syntax of the config migrate command from:

    mattermost config migrate --from <from config> --to <to config>

to:

    mattermost config migrate <from config> <to config>

making it more consistent with our other CLI commands.
2019-05-31 17:04:59 -04:00
Jesse Hallam
ca15690685 MM-15371: allow config show --json (#10918)
* MM-15371: allow config show --json

Mattermost Cloud will (temporarily?) rely on `mattermost config show` to dump the configuration for an active cluster installation. This adds support for a `--json` flag to dump the config in a format more suitable for programmatic consumption.

* indent config show --json

* ignore coverage lines too
2019-05-28 22:18:17 -05:00
Martin Kraft
b7fcddb0fc MM-15784: Prevents non-private channels from being group-constrained … (#10950)
* MM-15784: Prevents non-private channels from being group-constrained via CLI.

* MM-15786: Fixes tests.
2019-05-28 10:55:54 -04:00
Daniel Schalla
d269891476 [MM-15490] Rework default password requirements (#10844)
* Rework default password requirements

* Update API Test Lib Default User PW

* Remove unused function; Disable password reqs in dev mode

* Disable strict password requirements for unit tests

* Update unit tests
2019-05-21 11:03:36 -07:00
Martin Kraft
8d8a4d8614 MM-15485: In-channel system behaviour for at-mentions and slash commands for group-constrained channels. (#10855)
* MM-15108: Prevent non-group-members from being added to group-constrained channels.

* MM-15485: Updates ephemeral message when non-group member is invited to group-constrained channel.

* MM-15485: Prevent group-permitted members from being removed from group-constrained channels. Show custom ephemeral when attempting /kick or /remove.
2019-05-17 12:43:19 +01:00
Pradeep Murugesan
5d1ee9373f made the Restore and Delete store method to be sync (#10835) 2019-05-16 12:31:50 +02:00
Martin Kraft
1b78f9debc MM-14897: Changes to be able to add and remove groups from channels. (#10794)
* MM-15162: Changes for LDAP groups removals phase.

* MM-14897: Changes to be able to add and remove groups from channels.

* Update model/client4.go

* MM-14897: PR-requested change to string interpolation.
2019-05-15 12:03:47 -04:00
Siyuan Liu
2130e9f0b1 [GH-10800] convert bot account to user account (#10803)
* [10800] convert bot account to user account

* check password validity first

* review comments
2019-05-15 13:23:12 +01:00
Martin Kraft
480fffd3cc MM-15162: Changes for LDAP groups removals. (#10701)
* MM-15162: Changes for LDAP groups removals phase.

* MM-15162: Adds missing translation.

* MM-15162: Fixes tests.

* MM-15162: Removes some confusing branching.

* MM-15162: Make permission less restrictive.

* MM-15162: Moves counting to the DB tier.

* MM-15162: Moves CountGroupsByTeam into own store method.

* MM-15162: Adds count to tests.

* MM-15162: Fix for wrong cast type.

* MM-15162: Fix for possible null SchemeGuest column.

* MM-15162: Fixes bug whereby permissions error didn't return.

* MM-15162: Changes for LDAP groups removals phase.

* MM-15162: Adds missing translation.

* MM-15162: Fixes tests.

* MM-15162: Removes some confusing branching.

* MM-15162: Make permission less restrictive.

* MM-15162: Moves counting to the DB tier.

* MM-15162: Moves CountGroupsByTeam into own store method.

* MM-15162: Adds count to tests.

* MM-15162: Fix for wrong cast type.

* MM-15162: Fix for possible null SchemeGuest column.

* MM-15162: Fixes bug whereby permissions error didn't return.

* MM-15162: Adds missing translation blocking enterprise build.

* MM-15162: Update to group commands.
2019-05-10 11:47:21 -04:00
Miguel de la Cruz
2c0068a288 [MM-15164] Add group commands (#10812) 2019-05-10 15:53:01 +01:00
Puneeth Reddy
6ce3cc6921 MM-15290: Migrate commandStore.GetByTrigger to sync by default (#10741)
* MM-15290: migrate command.GetByTrigger to sync by default

* Fix build

* MM-15290: fix go vet issue
2019-05-07 20:44:30 +02:00
Puneeth Reddy
2d3fb4f426 MM-15288: Migrate CommandStore.Get to sync by default (#10739)
* MM-15288: Migrate Command.Get to sync by default

* addressing review comments, updating status code of err returned by Get Method
2019-05-06 18:12:41 +02:00
Siyuan Liu
fc15eda37f [MM-14719] convert users to bots through cmd (#10672)
* [MM-14719] convert users to bots through cmd

* address review comments, add / fix unit tests

* change command from "modify" to "convert"; review comments

* code review comments, clean up
2019-05-06 07:59:51 -07:00
Jesús Espino
584ec68755 MM-15021: Adding new builtin system schema for Guests (#10601)
* MM-15021: Adding new builtin system schema for Guests

* Fixing tests

* Setting properly the permissions

* Adding guests to sampledata

* Restrict more roles updates in the app layer for guests

* Adding comment to explain that permissions migration must go at the end

* Setting the default guest role for custom scheme during migration

* Fixing import and export

* Creating scheme guest roles on migration

* Fixing tests

* Fixing tests

* Fixing tests
2019-04-30 20:36:21 +02:00
Puneeth Reddy
171058eb3d MM-15289 Migrate command.GetByTeam to sync by default (#10740) 2019-04-29 10:20:51 +02:00
Puneeth Reddy
9f9620b4c8 MM-15186: Migrate "WebHook.GetOutgoingByTeam" to Sync by defa (#10707) 2019-04-26 21:20:36 +02:00
tengis b
8252eab5da [MM-15274] Migrate "Team.Get" to Sync by default (#10694)
* Migrate Team.Get to Sync by default

* change parseRange return value to ok

* fix formatting

* remove err checks

* use require.nil

* require nil
2019-04-26 18:18:07 +02:00
Puneeth Reddy
dc0441e28c change UpdateOutgoing func signature to return OutgoingWebhook and fix formatting (#10710) 2019-04-26 09:28:04 +02:00
Puneeth Reddy
ec95793b90 MM-15276: Migrate Team.Update to sync by default (#10693)
* MM-15276: Migrate Team.Update to sync by default

* MM-15276: Addressing review comments and change Update func signature similar to other interface Update method

* update store mocks for update fn

* addressing review comments
2019-04-25 15:29:02 +02:00
Andres Orozco
928ecba2d4 MM-15198 Migrate Channel.Get/GetFromMaster to Sync by default (#10667)
* MM-15198 Migrate Channel.Get/GetFromMaster to Sync by default

* MM-15198 - Update store/storetest/post_store.go

fix error handling in post_store.go test case

Co-Authored-By: andresoro <ao15@my.fsu.edu>
2019-04-24 20:28:06 +01:00
Siyuan Liu
434f343f69 [MM-15122] Migrate "WebHook.GetIncomingByTeam" to Sync by default (#10631) 2019-04-22 11:29:55 -04:00
Fede
17092e7e48 [MM-15117] Migrate "WebHook.UpdateIncoming" to Sync by default (#10637)
* SyncStore: Migrate Webhooks.UpdateIncoming method to Sync

* Changes requested by @jespino
2019-04-18 13:03:59 +01:00
Jesús Espino
12c50eb830 Initial migration of the store to be sync (#10592)
* Migrating audit store

* Final migration example for the audit store

* async example

* Ending migration

* Removing Async helper

* Fixing tests

* Fixing govet problems with the StoreResult instanstiation
2019-04-15 22:53:52 +02:00
James Vasky
1a102e13c8 MM-12358 Create CLI command "command modify" (#10538)
* Added ability to modify a command using the CLI

* Added ability to modify a command using the CLI

* Added TestModifyCommand to command_test.go and unit tests for new modify command

* Added ability to modify a command using the CLI

* Added TestModifyCommand to command_test.go and unit tests for new modify command
2019-04-09 10:27:15 +01:00
d28park
0edad1c3fa [MM-13895] Implement config migration command (#10508)
* [MM-13895] Implement config migration command

* Discarding unused error
2019-04-04 08:15:51 +02:00
Miguel de la Cruz
683f215bd9 [MM-14254] Add elasticsearch initialisation to the cmd (#10405) 2019-03-18 15:45:45 +01:00
Jesse Hallam
e94faea383 Address config startup issues (#10439)
* support --config for the jobserver

* leverage viper to map MM_CONFIG to --config
2019-03-14 16:14:18 +01:00
Miguel de la Cruz
434d01a284 [MM-14361] Initialise the translations before loading the config store (#10435) 2019-03-12 17:50:48 +00:00
Jesús Espino
200cfdd4a7 Fixing emojis and webhooks permissions split (#10420) 2019-03-08 11:40:44 +01:00
Jesús Espino
84afd47021 Split Emojis and Webhooks permissions (#10239)
* Split Emojis and Webhooks permissions

* Fixing some tests

* Fixing more tests

* Fix more tests

* Fixed review comments

* Fixing review comments
2019-03-07 16:07:09 +01:00
Jesse Hallam
1e462da2d4 MM-14143 config cleanup final (#10374)
* TestGetLicenseFileFromDisk: avoid using fileutils.FindConfigFile

* config: abstract config-related file access, extend memory store

* simplify config validate to avoid file knowledge

* fix relative file tests

* cluster: fix ConfigChanged event

The old and new configurations were swapped when notifying the enterprise code of configuration changes, creating needless instability in propagating config updates across a cluster.

* config/database: ignore duplicates

* test cleanup

* remove unnecessary Save() in test
2019-03-06 15:06:45 -05:00
Dmytro Chukmasov
3716918c57 [MM-12365] Create CLI command "team rename" (#9764) (#10083)
Allow renaming teams like in `channel rename` command

Example: `team rename myteam newteamname --display_name "My New Team Name`
2019-03-06 18:48:49 +01:00
Saturnino Abril
d85dff81a8 skip tutorial steps for sysadmin, user-1 and user-2 from generated sample data (#10387) 2019-03-01 20:11:38 +08:00
Christopher Poile
8bd182c38f MM-14145: The config store Set will now Save automatically (#10377)
* MM-14145: The config store Set will now Save automatically

When UpdateConfig (and configStore.Set) is called in admin.go and
config.go, commonStore.Set now takes a store-specific persist function.
It uses that persist function to save the configuration automatically.

Removed: Now callers do not have to call configStore.Save or
app.PersistConfig, and those functions have been removed.

Possible downside: this means a "failed to persist config" error can now
be thrown during a app.UpdateConfig or commonStore.Set call. But
considering application code never really sets a config without saving
it (except in the test cases, which were testing that -- see below), it
seems fine to group these responsibilities.

Also removed: tests for 'set without save'. Since that can not happen
anymore, the tests are not needed.

* Removed Save completely, cleaned up formatting, joined save test with
set tests.

* fixed shadowed variable error
2019-02-28 10:51:42 -05:00
Jesse Hallam
72448d12a9 deprecate timezones.json (#10311) 2019-02-25 12:07:45 -04:00