summaryrefslogtreecommitdiffstats
path: root/utils/config_test.go
Commit message (Collapse)AuthorAgeFilesLines
* MM-11382 Remove special handling of PluginSettings when loading config (#9234)Harrison Healey2018-08-101-0/+73
| | | | | | | | * MM-11382 Only override PluginSettings from environment when necessary * MM-11382 Remove special handling of PluginSettings when loading config * Add extra unit test
* MM-10730 Added support for empty environment variables to viper (#8973)Harrison Healey2018-06-211-0/+25
|
* MM-8701 Limit the number of client config fields sent before user logs in ↵Harrison Healey2018-06-181-1/+3
| | | | | | | | | | (#8954) * MM-8701 Limit the number of client config fields sent before user logs in * Fixed missing client config field * Reduced duplication between limited and regular client config
* MM-6839: searching for paths relative to executable (#8915)Jesse Hallam2018-06-061-11/+273
| | | | | | | | | | | | | | | | | | * 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
* Revert "MM-6839: search relative to executable (#8853)" (#8876)Christopher Speller2018-05-291-163/+11
| | | This reverts commit d3cf110620033f8831a55a3fd911d7864b6aab4a.
* MM-6839: search relative to executable (#8853)Jesse Hallam2018-05-291-11/+163
| | | | | | | | | | * 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
* MM-10189 Fixed inconsistency when using environment variables for ↵Harrison Healey2018-05-031-0/+22
| | | | MessageExportSettings (#8705)
* Structured logging (#8673)Christopher Speller2018-04-271-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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 fd8249e99bcad0231e6ea65cd77c32aae9a54026. * Fixing some auto refactor strangeness and typo. * Making keys more human readable.
* MM-10232, MM-10259: Improve error handling from invalid json (#8668)Jesse Hallam2018-04-261-0/+14
| | | | | | | | | | | | | | * 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
* MM-9849 Added tracking of which settings are set through environment ↵Harrison Healey2018-04-091-19/+55
| | | | | | | | | | | | | | | | 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
* MM-8400 Provide default config values to viper so that it reads all ↵Harrison Healey2018-04-061-33/+65
| | | | | | | | environment variables (#8581) * MM-8400 Provide default config values to viper so that it reads all environment variables * Added unit tests
* Fixing misspell errors (#8544)Jesús Espino2018-03-291-6/+6
|
* MM-9804: emit defaults for all enterprise config (#8490)Jesse Hallam2018-03-221-6/+99
| | | | | | | | | * MM-9804: emit defaults for all enterprise config This prevents the client from having to write inverted checks if a certain value defaults as `'true'` instead of `'false'`. * move EnableMobileFile(Upload|Download) to a defaulted enterprise configuration
* Timezone feature (#8185)Chris Duarte2018-03-221-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add supported timezones into config Remove Timezone list creation in favor of timezone from configs Add Timezone field to Users table Clean up format of SupportedTimezones in config * Remove unwanted change * Add test for updating user timezone * Add empty map[string]string if Timezone is null * Add EnableTimezoneSelection config * Revert back to map[string]string for ClientConfig * Refactor SupportedTimezones into timezones.json * Include timezones.json in TestConfigFlag * Add timezone api endpoint * Bump varchar size to 256 and setMaxSize in user_store * Refactor LoadConfig to LoadConfig and LoadTimezoneConfig * Remove unnecessary argument in LoadConfig, mail_test * Add test for timezone endpoint * Add license header * Refactor timezones endpoint to system.go * Add system base route to timezone endpoint * db timezone upgrade in db v4.9 * Avoid saving SupportedTimezones to config.json * Add timezonePath support in config * Remove EnableTimezoneSelection from config * Use return statement without return parameter * Refactor test for SupportedTimezones * Check for supportedTimezone != nil instead of using len * Decouple SupportedTimezones out of Config * Fix failing test * Add LastTeamIconUpdate back in upgrade.go * Write timezone config in config_flag_test * Add code fallback for default timezone support
* Remove license globals entirely (#8229)Chris2018-02-091-1/+1
| | | | | | | | * remove license globals entirely * fix infinite recursion * test fix
* Remove global cfg vars (#8099)Chris2018-01-121-165/+63
| | | | | | * remove global cfg vars * enterprise update
* Remove utils.ClientCfg and utils.ClientCfgHash (#8041)Chris2018-01-051-1/+1
| | | | | | * remove utils.ClientCfg and utils.ClientCfgHash * remove unused import
* fix config cli option (#7850)Chris2017-11-161-0/+19
|
* Refactoring cfg refs and load / save functions (#7749)Chris2017-10-311-11/+22
| | | | | | * refactoring cfg refs and load / save functions * improve error output
* simplify things (#7735)Chris2017-10-301-1/+1
|
* Renaming repoChristopher Speller2017-09-061-1/+1
|
* PLT-3893: Structured Logging Continues (#7252)Jonathan2017-08-311-7/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * PLT-3893: Imported logger work from https://github.com/MusikPolice/platform * PLT-3893: Integrated logger with system config * PLT-3893: Integrated Mattermost config with logging solution, modified log message serialization so entire message is serialized as a JSON object * PLT-3893: Added support for format strings in Debug methods. Added an overload that does not require a Context object for cases when one isn't available * PLT-3893: Added context and format string support to debug and error methods * PLT-3893: A few updates from pull request feedback * PLT-3893: Changed tests to use testify * Fixed TestAddRemoveConfigListener to no longer assume that there are zero config listeners when the test begins, since other tests could add config listeners * Updated TestGetDeletedChannelsForTeam so that it doesn't assume state when it begins * PLT-3893: Changed File property of log message so that it's relative to /mattermost directory, rather than to wherever the user is running the application from on their machine * Flipped expected/actual assert arguments, added an explicit test for getCallerFilename(...), since it's failing on Jenkins * Added printlns to debug failing tests on Jenkins * Relaxed test cases to avoid failure on Jenkins caused by code coverage calculations. Removed printlns. * Changed the way that caller filename is determined to make it more robust, updated tests to make them more lax, while not choking on the strange paths that Jenkins uses. * Fixed gofmt issues * Added debug output to tests to diagnose Jenkins build failures * Still trying to get some useful debug logging on Jenkins * Changed getCallerFilename to handle the strange paths that runtime.Caller(...) returns on Jenkins * Fixing checkstyle issues
* System Console: Email notification content setting (#7122)Jonathan2017-08-061-0/+10
| | | | | | | | | | | | | | | | * PLT-7195: Added new config option, new license feature, and config UI to system console. Still need to implement behaviour change in email batching code * PLT-7195: Modified batch emails to respect email notification content type setting * PLT-7195: Tweaking the colours a bit * PLT-7195: Added support for email notification content type setting in immediate (non-batched) notification messages. Attempted to clean up the code somewhat. Unit tests coming in a future commit * PLT-7195: Added unit tests for non-batched emails * Checked license when applying email content settings * Changed return type of getFormattedPostTime
* [PLT-7231/PLT-7306] Fix GitLab SSO failure with non-English locale and make ↵Saturnino Abril2017-08-061-0/+120
| | | | config locales more forgiving (#7125)
* PLT-6080 moving clustering to memberlist (#6499)Corey Hulen2017-06-191-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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-6408 Framework for job server (#6404)Harrison Healey2017-05-181-0/+79
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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-5860 Updated copyright date (#6058)Harrison Healey2017-04-121-1/+1
| | | | | | | | | | | | * PLT-5860 Updated copyright date in about modal * PLT-5860 Updated copyright notice in JSX files * PLT-5860 Updated copyright notice in go files * Fixed misc copyright dates * Fixed component snapshots
* PLT-6076 Read config file info from enviroment vars (#5873)Corey Hulen2017-03-291-0/+47
| | | | | | | | | | | | * Adding viper libs for config file changes * Removing the old fsnotify lib * updating some missing libs * PLT-6076 Read config file info from enviroment vars * Changing unit test to use less important props
* PLT-3456 Fix Errors while starting the server (#3445)enahum2016-07-041-0/+1
| | | | | | * PLT-3456 AppErrors that are triggered before translations are loaded crash server or produce bad error messages. * Fixing tests
* PLT-1800 Load server side locale from the config.json (#3202)enahum2016-06-021-1/+1
| | | | | | | | | | | | * PLT-1800 Load server side locale from the config.json * Add support for locales with country specifics * Fix localization on served locale file as plain/text * Remove github.com/cloudfoundry/jibber_jabber as vendor dependency * Fix get locale on login_controller
* Revert "PLT-1800 Load server side locale from the config.json" (#3201)Christopher Speller2016-06-011-1/+1
|
* PLT-1800 Load server side locale from the config.json (#3135)enahum2016-06-011-1/+1
| | | | | | | | | | * PLT-1800 Load server side locale from the config.json * Add support for locales with country specifics * Fix localization on served locale file as plain/text * Remove github.com/cloudfoundry/jibber_jabber as vendor dependency
* Revert "PLT-1800 Load server side locale from the config.json" (#3133)Christopher Speller2016-05-271-1/+1
|
* PLT-1800 Load server side locale from the config.json (#3092)enahum2016-05-271-1/+1
| | | | | | | | * PLT-1800 Load server side locale from the config.json * Add support for locales with country specifics * Fix localization on served locale file as plain/text
* Revert "PLT-1800 Load server side locale from the config.json (#3076)"Christopher Speller2016-05-241-1/+1
| | | | This reverts commit 34beaa569bfb32f1607375f1d5a22859322060d2.
* PLT-1800 Load server side locale from the config.json (#3076)enahum2016-05-241-1/+1
| | | | | | * PLT-1800 Load server side locale from the config.json * Add support for locales with country specifics
* PLT-7: Refactoring manuatesting & utils to use translations (chunk 5)Elias Nahum2016-01-251-0/+1
| | | | | - Add spanish translations - Skip tests
* Changing SpinPunch to Mattermost in copyrightChristopher Speller2015-10-081-1/+1
|
* Changing the way we mattermost handles URLs. team.domain.com becomes ↵Christopher Speller2015-07-201-15/+0
| | | | | | | domain.com/team. Renaming team.Name to team.DisplayName and team.Domain to team.Name. So: team.Name -> url safe name. team.DisplayName -> nice name for users
* Resurrecting config_docker.json. Moving docker related files to docker ↵Christopher Speller2015-06-171-3/+1
| | | | directory. Added copyright info.
* fixing ubild=Corey Hulen2015-06-161-1/+1
|
* Fixing build=Corey Hulen2015-06-161-0/+2
|
* Allow for setting of domain with enviroment variableChristopher Speller2015-06-161-0/+15
|
* first commit=Corey Hulen2015-06-141-0/+12