summaryrefslogtreecommitdiffstats
path: root/cmd/platform/server.go
Commit message (Collapse)AuthorAgeFilesLines
* Adding enterprise commands support (#8327)Jesús Espino2018-03-071-289/+0
|
* Send systemd READY notification (#8296)Pierre de La Morinerie2018-02-151-0/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, when starting Mattermost programmatically, it's hard to tell when the server is actually ready to receive network connections. This isn't convenient for monitoring (the systemd service status is "running" although the server is still booting), nor for programatic use (where a script would need to know when the server is ready to perform further actions). To improve this, systemd allow processes to tell when they started successfully. The launcher waits for this notification before reporting the service as successfully launched. The way processes notify systemd is by sending a `READY=1` string over a standard unix socket, whose path is provided in an environment var. The systemd service is then told to expect this notification: ```diff [Service] -Type=simple +Type=notify ExecStart=/home/vagrant/go/bin/platform ``` Now, when starting the server, systemd will actually wait for the server to be ready before returning the control to the shell. Additionally, during this time, querying the server status with `service mattermost status` will report the service as "activating" – before transitioning to "running" when the server is ready.
* Wait for goroutines to finish before shuting down server (#8259)Pierre de La Morinerie2018-02-141-5/+15
| | | | | | | | When running server tests, the server will exit while some jobs spawned through a goroutine are still running. This may crash the test harness, as the jobs try to access a shut down app instance. Fortunately the fix is easy: we just have to use the same App goroutine-counting facility than the rest of the method's goroutines.
* Add tests for the `platform server` command (#8231)Pierre de La Morinerie2018-02-121-5/+5
| | | | | | | | | | | | | | | | | | | | * 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.
* Abort on critical error during server startup (#8204)Pierre de La Morinerie2018-02-071-2/+7
| | | | | | | | | | | | | | | | | 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
|
* 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, ``
* 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-121-1/+1
| | | | | | * remove global cfg vars * enterprise update
* Remove global config watcher (#8080)Chris2018-01-111-23/+16
| | | | | | | | | | * remove global config watcher * keep config watcher disabled for tests * compile fix * fix resource leak
* [PLT-6936] Translate AppError.Message automatically by default (#8063)Jesús Espino2018-01-081-0/+6
|
* Remove utils.ClientCfg and utils.ClientCfgHash (#8041)Chris2018-01-051-17/+2
| | | | | | * remove utils.ClientCfg and utils.ClientCfgHash * remove unused import
* Add plugin slash command support (#7941)Chris2017-12-081-2/+2
| | | | | | | | * add plugin slash command support * remove unused string * rebase
* PLT-8289 Added ability to change location of client plugins (#7942)Harrison Healey2017-12-051-12/+8
|
* Reorganize file util functionality (#7848)Chris2017-11-161-4/+8
| | | | | | | | * reorganize file util functionality * fix api test compilation * fix rebase issue
* fix config cli option (#7850)Chris2017-11-161-1/+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-031-1/+1
|
* Add config setting to configure plugins directory (#7725)Joram Wilander2017-10-261-1/+1
|
* Differentiate between installed and activated states for plugins (#7706)Joram Wilander2017-10-251-8/+0
|
* Miscellaneous app cleanup (#7594)Chris2017-10-091-8/+1
| | | | | | | | | | | | * app cleanup * whoops, forgot a file * some minor cleanup * longer container deadline * defensive checks
* Do not require server restart when enabling/disabling plugins (#7592)Joram Wilander2017-10-061-0/+10
|
* Don't use global app for api / api4 tests (#7528)Chris2017-10-021-3/+3
| | | | | | | | | | | | | | * don't use global app for api / api4 tests * put sleep back. we're gonna have to do some goroutine wrangling * fix oauth test config assumptions * jobs package, i'm comin' for you next * app test fix * try increasing sleep a little
* remove jobs.Srv and other jobs-related globals (#7535)Chris2017-09-291-6/+5
|
* remove remaining Global() calls (outside of tests) (#7521)Chris2017-09-281-2/+2
|
* remove global refs from api/api4 (#7496)Chris2017-09-221-4/+4
|
* remove einterface gets (#7455)Chris2017-09-191-13/+12
|
* PLT-7622 Improvements to server handling of webapp plugins (#7445)Joram Wilander2017-09-151-6/+11
| | | | | | | | * Improvements to server handling of webapp plugins * Fix newline * Update manifest function names
* Remove global app references (#7433)Chris2017-09-121-34/+42
| | | | | | | | * remove global app references * test fix * fix api4 test compilation
* PLT-7407: Back-end plugins (#7409)Chris2017-09-111-11/+13
| | | | | | | | | | | | * tie back-end plugins together * fix comment typo * add tests and a bit of polish * tests and polish * add test, don't let backend executable paths escape the plugin directory
* Renaming repoChristopher Speller2017-09-061-10/+10
|
* app type transition (#7167)Chris2017-09-061-15/+15
|
* PLT-???? Prepare file upload infrastructure for Data Retention. (#7266)George Goldberg2017-08-251-1/+1
| | | | | | | | | | | | | | | | | * Prepare file upload infrastructure for Data Retention. This commit prepares the file upload infrastructure for the data retention feature that is under construction. Changes are: * Move file management code to utils to allow access to it from jobs. * From now on, store all file uploads in a top level folder which is the date of the day on which they were uploaded. This commit is based on Harrison Healey's branch, but updated to work with the latest master. * Use NewAppError
* Adding check for file write or minio/s3 bucket before server start. (#7254)Christopher Speller2017-08-181-0/+4
|
* PLT-6226 Fixing races with licensing (#7213)Corey Hulen2017-08-161-2/+2
| | | | | | | | | | * PLT-6226 Fixing races with licensing * Fixing build issue * Fixing licensing issue * removing commented code
* PLT-1649: add response_url support for custom slash commands (#6739)Chris2017-08-161-0/+10
| | | | | | | | | | * add response_url support for custom slash commands * pr suggestions * pr update / suggestion * test fix
* PLT-6965 jira integration (plus plugin scaffolding) (#6918)Chris2017-08-021-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * plugin scaffolding / jira integration * add vendored testify packages * webhook fix * don't change i18n ids * support configuration watching * add basic jira plugin configuration to admin console * fix eslint errors * fix another eslint warning * polish * undo unintentional config.json commit >:( * test fix * add jira plugin diagnostics, remove dm support, add bot tag, generate web-safe secrets * rebase, implement requested changes * requested changes * remove tests and minimize makefile change * add missing license headers * add missing comma * remove bad line from Makefile
* Add jobserver command to platform binary (#7067)Christopher Speller2017-08-011-2/+6
| | | | | | | | * Add jobserver command to platform binary * Fixing jobserver config. Adding jobserver flags. * Fixing govet in makefile
* PLT-6976: Elasticsearch capitalisation and tests. (#6839)George Goldberg2017-07-071-2/+2
| | | | | | | * Fixes Elasticsearch to have consistent capitalisation everywhere across the code and UI (except the config file unfortunately). * Adds basic unit tests for Elastichsearch. * Adds a Elasticsearch docker image to the Makefile to enable testing the Elasticsearch feature.
* PLT-6916: Redesign the jobs package and Jobserver. (#6733)George Goldberg2017-07-071-2/+5
| | | | | | | | | | | | | | This commit redesigns the jobserver to be based around an architecture of "workers", which carry out jobs of a particular type, and "jobs" which are a unit of work carried by a particular worker. It also introduces "schedulers" which are responsible for scheduling jobs of a particular type automatically (jobs can also be scheduled manually when apropriate). Workers may be run many times, either in instances of the platform binary, or the standalone jobserver binary. In any mattermost cluster, only one instance of platform OR jobserver must run the schedulers. At the moment this is controlled by a config variable, but in future will be controlled through the cluster leader election process.
* PLT-6080 moving clustering to memberlist (#6499)Corey Hulen2017-06-191-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * PLT-6080 adding cluster discovery service * Adding memberlist lib * Adding memberlist lib * WIP * WIP * WIP * WIP * Rolling back config changes * Fixing make file * Fixing config for cluster * WIP * Fixing system console for clustering * Fixing default config * Fixing config * Fixing system console for clustering * Tweaking hub setting * Bumping up time * merging vendor dir * Updating vendor dir * Fixing unit test * Fixing bad merge * Remove some testing code * Moving comment * PLT-6868 adding db ping retry * Removing unused loc strings * Adding defer to cancel
* PLT-6471 Properly panic when translations can't be loaded (#6414)Harrison Healey2017-05-231-3/+7
| | | | | | | | | | * PLT-6471 Properly panic when translations can't be loaded * Print usage messages when errors occur during CLI initialization * Reverted behaviour of FindDir and added second return value to it * Fixed merge conflict
* PLT-6408 Framework for job server (#6404)Harrison Healey2017-05-181-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Added initial job server * Added job server to be ran as part of platform * Added test job to the enterprise repo * Fixed job server not loading license * Renamed job package to jobs * Fixed TE not being buildable * Added JobStatus table to database * Changed fields used by JobStatus * Added APIs to query job status * Added config change listener to server * Added option to run job server from Makefile * Added ability to enable/disable jobs from config * Commented out placeholder for search indexing job * Fixed govet * Removed debug messages and fixed job api init message
* PLT-6472: Basic Elastic Search implementation. (#6382)George Goldberg2017-05-181-0/+6
| | | | | | | | | | | | | | * PLT-6472: Basic Elastic Search implementation. This currently supports indexing of posts at create/update/delete time. It does not support batch indexing or reindexing, and does not support any entities other than posts yet. The purpose is to more-or-less replicate the existing full-text search feature but with some of the immediate benefits of using elastic search. * Alter settings for AWS compatability. * Remove unneeded i18n strings.
* Creating common token store and moving email invites and verification to it ↵Christopher Speller2017-04-271-0/+11
| | | | (#6213)
* PLT-6317 disable file watcher while running from makefile (#6103)Corey Hulen2017-04-171-0/+2
| | | | | | * PLT-6317 disable file watcher while running from make file * Removing debug stmt