Граф коммитов

223 Коммитов

Автор SHA1 Сообщение Дата
George Goldberg
8d3cfc6ad7 MM-12815: Clearly deprecated disused config settings. (#9751)
* MM-12815: Clearly deprecated disused config settings.

* Fix tests.
2018-10-31 08:38:38 +00:00
Mukul Rawat
2b6d6acb78 [MM-12361] Create CLI-command "config set" (#9535) (#9582)
* Create the config set command in the variable

* Register the command and declare the command in the run function

* Finish implementation of 'config set' cli command

* Write tests for config set command

* Change minimum number of arguments to 2

* Correct changes

* Correct error problem

* Update the command description and errors

* Refactor function name and improve error messages

* Write test for UpdateMap function
2018-10-29 09:29:15 +00:00
Shobhit Gupta
c317d6f265 MM-12356 Add cli command "command delete" (#9553)
* Add cli command for deleting commands

* Add code/test for delete command

* Fix test

* Add confirm flag

* Update as per comments

* Uncomment test

* Fix test
2018-10-23 12:19:10 +01:00
Artur Mogozov
c3993704ef MM-12372 Add modify-incoming webhook command (#9683)
* MM-12372 Add modify-incoming webhook command

* Review comments
2018-10-19 12:04:12 +01:00
Artur Mogozov
cedf6488e4 MM-12368 Add create webhook-incoming command (#9566) 2018-10-16 12:13:00 +01:00
Mukul Rawat
80153ef873 [MM-12362] Add CLI command 'config show' (#9536) (#9564)
* Add the subcommand by creating a new Command instance.

* Implemented the structure of the subcommand function.

* Register our new command

* Write some helper functions

* finish the pretty print function

* write some test for config show

* Refactor and extract the tab printing functionality in its own function

* Use app.Config() to create our config object & accept incoming changes

* Removed reading the file, make helper functions return string and perform printing inside the command

* Remove the previous code for checking presence of arguments and use 'cobra.NoArgs()' instead

* Remove named return and instead declare the variable and then return it.

* Remove printTab function and simplify printing out tabs using strings.Repeat

* Add some functions to test the output

* Update the usage and remove a comment

* Update the print
2018-10-15 18:06:46 -04:00
Wasim Thabraze
457a34c5f4 [MM-12363] Added Team archive command to archive a team by name (#9565)
* Added Team archive command to archive a team by name

* Team archive command now uses SoftDelete method

Team search and list command now shows archived teams with the term '(archived)' appended to them
2018-10-15 19:48:18 +01:00
Mukul Rawat
9385dc750d [MM-12360] Created CLI command "config get" (#9534) (#9558)
* Added the get command to get the value of a config setting.

* Depending on the config setting it can work on any depth of the
setting.

* Added test for the get command.

* Add print tabs

* Remove excess else statements

* Return with the value and remove named return variable

* Refactor the printMap function and return a string, remove side effects

* Improve the error message, use the name argument

* Use app.Config() to create our config object

* Remove reading the file, make helper functions return string and perform printing inside the command

* Remove the tab printing

* Add extra quotes on the output

* Remove extra code for checking arguments and replaced it with cobra.ExactArgs(1)

* Remove buffer from printConfigValues

* Add some tests to check the output of the command

* Write test for the function 'structToMap' and test for complext nested structs

* Write test for the function 'configToMap' and test for complext nested structs

* Write test for the function 'printMap' and test for complext maps as input

* Write test for the function 'printConfigValues' and test for complext maps as input

* Remove commented code

* Update the description of the  command
2018-10-15 10:49:25 -04:00
Jason Mojica
f025e749a9 MM-12355: Add CLI command "command create" (#9569)
* Add create command

* Create CreateCommand Tests

* Change method flag description

* Change nil test assertion
2018-10-13 13:35:00 +01:00
George Goldberg
9a4f3ce1e5 MM-12251: Add flag to MoveChannel to remove all deactivated users. (#9515) 2018-10-08 16:39:03 +01:00
Jesús Espino
0a68e741d0 Small fix in the webhook list error handling (#9567) 2018-10-05 16:40:26 +02:00
Ashutosh Kumar
cba33137d2 MM-12357: Add CLI command "team list" (#9531)
* (feat:command list)add command list for teams

Signed-off-by: sonasingh46 <sonasingh46@gmail.com>

* address review comments

Signed-off-by: sonasingh46 <sonasingh46@gmail.com>

* address review comments

Signed-off-by: sonasingh46 <sonasingh46@gmail.com>
2018-10-05 08:12:03 +02:00
Ben Echols
939ee15013 MM-12371 Add webhook list command (#9528)
* Added start of the webhook command

* start of unit tests

* created a simple hook for unit test

* added outgoing as well

* have it all working

* Add license headers to the files

* Addressing code review, fixed print reverted sql change
2018-10-04 20:16:25 +02:00
Daniel Schalla
7468f35cb0 Fix CMD Init. Error Checks (#9547) 2018-10-03 12:04:04 -07:00
Wasim Thabraze
b6835ab984 [MM-12367] Added CLI command 'team search' (#9512)
* Added 'search' sub-command for the command 'team' to search across teams with name

* Addressed code review

* Moved 'removeDuplicatesAndSortTeams' function to team.go

Addressed more code reviews

* Added unit test case for team search command

* Added unit test case to test searching of teams by display name
2018-10-03 09:31:53 +02:00
Jesús Espino
2945e8a2b0 MM-10699: Disallow renaming direct and group message channels (#9518)
* MM-10699: Disallow renaming direct and group message channels

* Replacing errors.New with errors.Wrapf
2018-10-02 19:33:52 +02:00
Christopher Speller
3785ad48c1 Adding arg spec to bulk export. (#9453) 2018-09-25 10:57:35 +01:00
Jesús Espino
a08df883b4 Move file backend to its own service (#9435)
* Move file backend to its own service

* Moving utils/inbucket to mailservice package
2018-09-20 10:07:03 -07:00
George Goldberg
ab99f0656f MM-11781: Basic Data Export Command Line. (#9296)
* MM-11781: Basic Data Export Command Line.

* ChannelStore new unit tests.

* TeamStore new unit tests.

* Unit test for new UserStore function.

* Unit tests for post store new methods.

* Review fixes.

* Fix duplicate command name.
2018-09-17 15:51:26 +01:00
Carlos Tadeu Panato Junior
35c148d255 fixing log messages (#9341)
* fixing log messages

* update per review

* Update notification.go

* Update server.go

* Update notification.go
2018-09-17 09:29:04 +02:00
George Goldberg
504591e7d6 MM-11882: Remove all users from a channel via CLI. (#9381) 2018-09-10 07:42:15 -04: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
Carlos Tadeu Panato Junior
0da5c852f0 add --username in the example for the commands (#9320)
* add --username in the example for the commands

* update per review
2018-08-29 16:57:26 +02:00
Jesús Espino
bba3bbd9f3 MM-11572: Force correct order on messages generated in the bulk (#9244) 2018-08-24 09:53:44 +02:00
cpanato
620d55810d Merge remote-tracking branch 'upstream/release-5.2' into release-5.2-daily-merge-20180810 2018-08-10 15:03:18 +02:00
Jesse Hallam
d8c8a19d35 avoid t.Fatal() in tests (#9189)
I've been burned a few times by tests that simply fatal, requiring me to
run another build to learn more about what the mismatch was. Avoid this.

This is part of a long running goal of mine to make testing "better".
2018-08-09 11:26:38 +02:00
Jesse Hallam
7649488a26 MM-11637: avoid stopping unstarted jobs (#9240)
The new locking primitives in 5.2 around jobs assume the
worker/scheduler was actually started, so don't try to stop if not
started.
2018-08-09 11:04:49 +02:00
Jesús Espino
3b640cd51b Remove global-relay export command from the cli (#9226) 2018-08-08 12:04:16 +02:00
George Goldberg
185ed89978 MM-11243: Make Elasticsearch work after enabling without restart. (#9146)
* MM-11243: Make Elasticsearch work after enabling without restart.

* Also cope with config vars changing whilst enabled.
2018-07-26 15:50:38 +01:00
Jesse Hallam
8948b91d7a unpack prepacked plugins on plugins initialization (#9149)
* unpack prepackaged plugins on plugins initialization

* leverage utils.FindDir
2018-07-26 08:45:26 -04:00
Jesús Espino
bfb2640451 Add idiomatic error handling in mattermost commands (#9147) 2018-07-24 10:11:47 -04:00
Jesús Espino
610ac5a53c MM-11003: Global Relay Export Refactor (#9136) 2018-07-20 17:13:35 +02:00
Druhin Bala
301e7eb1c4 MM-10699 Add channel renaming to CLI (#9094) 2018-07-18 11:49:48 +01:00
Santos Solorzano
f57d279dc0 [MM-10117] Add support to add/delete and enable/disable plugins via CLI (#8745)
* Testing caching for emojis

* MM-10117 Add support to add/delete and activate/deactivate plugins via CLI

* Removing old work

* MM-10117 Moved files and addedd plugin test

* MM-10117 Renamed commands to enable/disable and updated add test

* MM-10117 Finished plugin test and improved error message for plugin commands

* MM-10117 Fixing plugin directories for test

* MM-10117 Renamed commands and updated commands to support multiple plugins

* MM-10117 Updating removed to deleted textclear

* MM-10117 Fixing nil pointer error for listing plugins

* MM-10117 Removing fileReader close

* MM-10117 Declaring error for GetPlugins

* MM-10117 Removing unnecessary nil check
2018-07-11 12:17:19 -04:00
JoramWilander
6c7dc2d29c Merge branch 'plugins-2' 2018-07-10 15:01:43 -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
Martin Kraft
8a02121767 MM-11110: Fixes CLI error message. (#9062) 2018-07-09 12:48:43 +02:00
JoramWilander
b78b216a3c Merge branch 'master' into plugins-2 2018-07-07 12:04:18 -04:00
George Goldberg
0e17babdd3 Make sure diagnostic ID is loaded before client config. (#9032) 2018-07-03 17:54:59 +02:00
Christopher Speller
1e5c432e10 MM-10702 Moving plugins to use hashicorp go-plugin. (#8978)
* Moving plugins to use hashicorp go-plugin.

* Tweaks from feedback.
2018-06-25 12:33:13 -07:00
Jesús Espino
d9390244af MM-8810: Add CSV Compliance export (#8966)
* MM-8810: Add CSV Compliance export

* Only allowing to schedule actiances export throught the cli

* De-duplicating some code

* Fixes on texts

* Fixes on translations
2018-06-22 11:15:19 +02:00
Jesse Hallam
dd35ad43ca MM-10370: serve subpath (#8968)
* factor out GetSubpathFromConfig

* mv web/subpath.go to utils/subpath.go

* serve up web, api and ws on /subpath if configured

* pass config to utils.RenderWeb(App)?Error

This allows the methods to extract the configured subpath and redirect
to the appropriate `/subpath/error` handler.

* ensure GetSubpathFromConfig returns trailing slashes deterministically

* fix error 404 handling

* redirect /subpath to /subpath/

This is necessary for the static handler to match, otherwise none of the
registered routes find anything. This also makes it no longer necessary
to add trailing slashes in the root router.
2018-06-21 11:31:51 -07:00
Jesse Hallam
f106417103 MM-10367: rewrite subpath assets on startup (#8944)
Examine ServiceSettings.SiteURL on startup and rewrite assets
accordingly if not in a development environment.

Also export `mattermost config subpath` command to manually do same.

This accompanies a webapp PR to use the updated `root.html` to define
the necessary webpack asset path for dynamically loading assets.
2018-06-14 08:26:22 -07:00
George Goldberg
1b821c7319 MM-10684: Show logs on Slack Import CLI. (#8936) 2018-06-11 15:48:32 +01: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
George Goldberg
27e7841a73 Merge branch 'advanced-permissions-phase-2' 2018-05-31 10:25:31 +01:00
Christopher Speller
af4e907f5e MM-10731 Revert site url kill server (#8877)
* Revert "MM-9983 Requiring SiteURL to be set. (#8769)"

This reverts commit 0432f995ec.

* Add log message for SiteURL not being set.
2018-05-30 09:58:24 -04:00
George Goldberg
994ccf475f Add note about clearing caches when permissions reset CLI done. (#8823)
* Add note about clearing caches when permissions reset CLI done.

* Adjust text.
2018-05-30 11:21:36 +01: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
Jesús Espino
e88fe4bb1d MM-8853: Adding MANAGE_EMOJIS and MANAGE_OTHERS_EMOJIS permissions (#8860)
* MM-8853: Adding MANAGE_EMOJIS and MANAGE_OTHERS_EMOJIS permissions

* MM-8853: Removing unnecesary emoji enterprise feature

* Create emojis migration

* Adding MANAGE_EMOJIS and MANAGE_OTHERS_EMOJIS always to system admins

* Simplifing permissions checks

* Revert "Simplifing permissions checks"

This reverts commit e2cafc1905fc9e20125dd9a1552d2d0c7340ae59.
2018-05-29 15:58:12 +01:00