summaryrefslogtreecommitdiffstats
path: root/cmd
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'master' into advanced-permissions-phase-1George Goldberg2018-02-133-6/+78
|\
| * Add tests for the `platform server` command (#8231)Pierre de La Morinerie2018-02-122-5/+77
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Cleanup app state on initialization error When returning an initialization error, the app state was not cleaned up. This is especially visible during tests, as `appCount` is not decremented, and makes the new app initialization fail. * Test the `platform server` command As the `platform server` command only exits when interrupted by a signal, it is not possible to test it as the other cobra commands. Instead we directly test the actual command function. The internal command handler is slighly refactored to take a channel in argument, and registers it as the signal handler. Nothing very different—except than controlling this channel from the outside allows the test to send the system signal itself, thus preventing the server to run forever.
| * Remove license globals entirely (#8229)Chris2018-02-091-1/+1
| | | | | | | | | | | | | | | | * remove license globals entirely * fix infinite recursion * test fix
* | Merge remote-tracking branch 'origin/master' into advanced-permissions-phase-1Jesús Espino2018-02-074-10/+61
|\|
| * PLT-7537: Move channel CLI command posts system message to channel. (#8161)Vordimous2018-02-072-4/+40
| | | | | | | | | | | | | | | | | | | | | | | | * [PTL-7537] implement feature and test * [PTL-7537] Update feature to post the the room requiring a username flag to be used * [PTL-7537] update tests with username * update test to remove changes to the test helper struct * use the basic team and user
| * Abort on critical error during server startup (#8204)Pierre de La Morinerie2018-02-072-4/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Only a handful of critical errors are present in the codebase. They all occur during server startup (in `app.StartServer()`). Currently, when one of these critical error occurs, it is simpled mentionned in the logs – then the error is discarded, and the app attempts to continue the execution (and probably fails pretty quickly in a weird way). Rather than continuing operations in an unknow state, these errors should trigger a clean exit. This commit rewrites critical startup errors to be correctly propagated, logged, and then terminate the command execution. Additionnaly, it makes the server return a proper error code to the shell.
| * add App.License, remove utils.IsLicensed / utils.License calls (#8203)Chris2018-02-061-2/+4
| |
* | Merge branch 'master' into advanced-permissions-phase-1George Goldberg2018-02-063-11/+16
|\|
| * report server launch errors (#8189)Pierre de La Morinerie2018-02-021-7/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When starting the server using `platform server`, errors occuring during startup are not reported in the console. The command exit with a 0 exit code (i.e. "success"), although the server failed to launch. With this change, when an error occurs while initializing the app (like a missing or invalid configuration file): - the error is printed to the console; - the command exit with a "-1" exit code. This allow shell scripts to properly detect the startup failure, and to react to it. Example of error displayed: ``` $ platform server Error: LoadConfig: Error decoding config file=config.json, err=While parsing config: invalid character ':' after top-level value, ``
| * Use default configurations for user-0 in sampledata (#8174)Jesús Espino2018-01-311-4/+4
| |
| * Upgrading server dependancies (#8154)Christopher Speller2018-01-291-0/+3
| |
* | XYZ-37: Advanced Permissions Phase 1 Backend. (#8159)George Goldberg2018-02-061-0/+2
|/ | | | | | | | | | | | | | | | | | | | | | | | | | * XYZ-13: Update Permission and Role structs to new design. * XYZ-10: Role store. * XYZ-9/XYZ-44: Roles API endpoints and WebSocket message. * XYZ-8: Switch server permissions checks to store backed roles. * XYZ-58: Proper validation of roles where required. * XYZ-11/XYZ-55: Migration to store backed roles from policy config. * XYZ-37: Update unit tests to work with database roles. * XYZ-56: Remove the "guest" role. * Changes to SetDefaultRolesFromConfig. * Short-circuit the store if nothing has changed. * Address first round of review comments. * Address second round of review comments.
* Post a system message to the affected channel by CLI command (#7877) (#7968)Evgeniy2018-01-181-2/+9
|
* Finally remove utils.Cfg (#8113)Chris2018-01-171-1/+1
| | | | | | | | * finally remove utils.Cfg * fix compile error * another test compilation fix
* ABC-73 Move session clean-up to daily task (#8095)Joram Wilander2018-01-171-1/+16
| | | | | | * Move session clean-up to daily task * Split delete query into batches
* Remove global cfg vars (#8099)Chris2018-01-123-6/+8
| | | | | | * remove global cfg vars * enterprise update
* Remove global config watcher (#8080)Chris2018-01-112-27/+20
| | | | | | | | | | * remove global config watcher * keep config watcher disabled for tests * compile fix * fix resource leak
* [XYZ-6] Add sampledata platform command (#8027)Jesús Espino2018-01-113-1/+654
| | | | | | | | * Add fake dependency * [XYZ-6] Add sampledata platform command * Creating EMOJI_NAME_MAX_LENGTH as a constant and using it where needed
* [PLT-6936] Translate AppError.Message automatically by default (#8063)Jesús Espino2018-01-083-0/+12
|
* Remove utils.ClientCfg and utils.ClientCfgHash (#8041)Chris2018-01-051-17/+2
| | | | | | * remove utils.ClientCfg and utils.ClientCfgHash * remove unused import
* disable config watching during cli tests (#8040)Chris2018-01-051-1/+1
|
* Add plugin slash command support (#7941)Chris2017-12-081-2/+2
| | | | | | | | * add plugin slash command support * remove unused string * rebase
* Allow deactivation of SSO users (#7952)Joram Wilander2017-12-081-2/+2
|
* PLT-8289 Added ability to change location of client plugins (#7942)Harrison Healey2017-12-051-12/+8
|
* PLT-7503: Create Message Export Scheduled Task and CLI Command (#7612)Jonathan2017-11-303-1/+145
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Created message export scheduled task * Added CLI command to immediately kick off an export job * Added email addresses for users joining and leaving the channel to the export * Added support for both MySQL and PostgreSQL * Fixing gofmt error * Added a new ChannelMemberHistory store and associated tests * Updating the ChannelMemberHistory channel as users create/join/leave channels * Added user email to the message export object so it can be included in the actiance export xml * Don't fail to log a leave event if a corresponding join event wasn't logged * Adding copyright notices * Adding message export settings to daily diagnostics report * Added System Console integration for message export * Cleaned up TODOs * Made batch size configurable * Added export from timestamp to CLI command * Made ChannelMemberHistory table updates best effort * Added a context-based timeout option to the message export CLI * Minor PR updates/improvements * Removed unnecessary fields from MessageExport object to reduce query overhead * Removed JSON functions from the message export query in an effort to optimize performance * Changed the way that channel member history queries and purges work to better account for edge cases * Fixing a test I missed with the last refactor * Added file copy functionality to file backend, improved config validation, added default config values * Fixed file copy tests * More concise use of the testing libraries * Fixed context leak error * Changed default export path to correctly place an 'export' directory under the 'data' directory * Can't delete records from a read replica * Fixed copy file tests * Start job workers when license is applied, if configured to do so * Suggestions from the PR * Moar unit tests * Fixed test imports
* Role refactor (#7867)Chris2017-11-211-1/+0
| | | | | | | | * role refactor * add missing file * fix web test
* Small fix to run webapp tests (#7777)Jesús Espino2017-11-201-1/+6
|
* refactor template code (#7860)Chris2017-11-201-3/+0
|
* PLT-6217 Fixes system message posted to Town Square when a member leaves a ↵Tsilavina Razafinirina2017-11-201-1/+1
| | | | | | | | | | | | | | | | | | team (#7752) * Fixes system message posted to Town Square when adding/removing team member (#6483) Fixes unit test method call to match RemoveUserFromTeam modification (#6483) Fixes system message posted to Town Square when adding/removing team member (#6483) Removes unnessary error message * Updates system message when a user leaves a team (#6483) * Changes system message when a user is removed from team (#6483) * Adds a new string to be post to town-square when a member is added to a team (#6483)
* make `config validate` exit with non-zero code on failure (#7855)Chris2017-11-173-23/+12
|
* Reorganize file util functionality (#7848)Chris2017-11-161-4/+8
| | | | | | | | * reorganize file util functionality * fix api test compilation * fix rebase issue
* add one more config test (#7853)Chris2017-11-161-0/+49
|
* fix config cli option (#7850)Chris2017-11-164-3/+32
|
* Improve test coverage reporting / accuracy (#7819)Chris2017-11-137-287/+341
| | | | | | | | | | * improve test coverage reporting / accuracy * handle absolute coverpaths * move tests into multiple files * rename codecov.yml (https://github.com/codecov/support/issues/426)
* Updating server dependancies. (#7816)Christopher Speller2017-11-131-5/+1
|
* more global config ref cleanup (#7802)Chris2017-11-091-7/+11
|
* fix builtin plugin http router (#7797)Chris2017-11-061-2/+0
|
* PLT-8011: Make Elasticsearch startup fully async. (#7761)George Goldberg2017-11-061-3/+5
| | | | | | * PLT-8011: Make Elasticsearch startup fully async. * Use a.Go
* PLT-8086 Fix plugin config watcher for enabling and disabling (#7770)Joram Wilander2017-11-031-0/+7
| | | | | | | | * Fix plugin config watcher for enabling and disabling * Make sure HTTP routes are served * Set content-type explicitly
* several one-line panic, race, and logic fixes (#7766)Chris2017-11-033-3/+3
|
* PLT-7978 Add websocket event for user role update (#7745)Joram Wilander2017-10-312-3/+3
| | | | | | | | * Add websocket event for user role update * Fix tests * More test fixes
* Refactoring cfg refs and load / save functions (#7749)Chris2017-10-312-12/+13
| | | | | | * refactoring cfg refs and load / save functions * improve error output
* Remove unused variables / code (#7736)Chris2017-10-302-57/+0
| | | | | | * remove unused variables / code * fix bug in testPostStoreGetOldest
* simplify things (#7735)Chris2017-10-301-5/+1
|
* Add config setting to configure plugins directory (#7725)Joram Wilander2017-10-261-1/+1
|
* add missing license headers, test to makefile (#7711)Chris2017-10-251-0/+3
|
* Differentiate between installed and activated states for plugins (#7706)Joram Wilander2017-10-251-8/+0
|
* eliminate more utils.Cfg references (#7701)Chris2017-10-241-3/+3
|
* Fix teams create example (#7655)Ema Panz2017-10-181-1/+1
| | | Fix the "team create" command wrongly shows a `teams create` example, where an extra "s" is appended to the command name.
* Use tmpfs containers for api/api4 tests, move and speed up CLI tests (#7606)Chris2017-10-121-0/+287
| | | | | | | | | | | | * use tmpfs containers for api/api4, move and speed up cli tests * minor optimizations * add missing files, fix pre-existing race condition * add . to TestMain check * add requested log message