Remote Cluster Service
- provides ability for multiple Mattermost cluster instances to create a trusted connection with each other and exchange messages
- trusted connections are managed via slash commands (for now)
- facilitates features requiring inter-cluster communication, such as Shared Channels
Shared Channels Service
- provides ability to shared channels between one or more Mattermost cluster instances (using trusted connection)
- sharing/unsharing of channels is managed via slash commands (for now)
* Add cloud installation and group id to feature flag attributes
* Add some debug lines
* Allow non-cloud servers to use split.io for feature flag management
* Create the system console setting and send to webapp
* MI-1145: Add custom status APIs
* MI-1145 Add slash commands to set and clear status
* Add validation for custom status API
* Trim custom status message
* Code refactoring
- Run gofmt
- Rename constants
* Remove sendUserUpdated webhook event
* Fix recent custom status length
* Update error conditions
* Disable /status slash command when config setting is off
* MI-1155: Create the feature flag for custom status APIs and slash commands
* Move recent custom statuses to user preferences (#7)
* Move recent custom statuses to user preferences
* Code refactoring and feedback changes
* Update slash command text and emoji regex
* Make the custom status feature flag off by default
* Update SetCustomStatus, handle recents not set better
* Update status codes
* Update slash command handling
* Add telementry settings
* Fix i18n order
* Revert "Fix i18n order"
This reverts commit 499f7eaca8.
* Update i18n strings
* Fix FeatureFlags section erroneously getting written to config
* Avoid invoking config listeners if config has not changed
* Avoid resetting feature flags on store creation
* init commit
* clean up the code
* make mocks
* fix translations
* mocks and lint fixes
* add tests
* little fixes
* Update i18n/en.json
Co-authored-by: Scott Bishel <scott.bishel@mattermost.com>
* Update i18n/en.json
Co-authored-by: Scott Bishel <scott.bishel@mattermost.com>
* Update i18n/en.json
Co-authored-by: Scott Bishel <scott.bishel@mattermost.com>
* Update i18n/en.json
Co-authored-by: Scott Bishel <scott.bishel@mattermost.com>
* Update i18n/en.json
Co-authored-by: Scott Bishel <scott.bishel@mattermost.com>
* Address Comments
* fix i18n
* update api endpoint
* add enable file and file level for conditional show of banner
* Address Comments
* Make it more clear about returns
* Create zip file utility function
* update en.json
* address comments
* write tests
* check for data in test
* remove warning string
* Correct expected and actual
* set database through environment variables
* reset environment variable at end of test
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Co-authored-by: Scott Bishel <scott.bishel@mattermost.com>
There was a mistake in my earlier analysis. t.Parallel only
applies to the current test and not its subtests.
There is some other test running with t.Parallel that is causing duplicate
file watcher events to be fired. I have now verified that removing this
causes the race to go away in CI
* format using `goimports -local github.com/mattermost/mattermost-server/v5 -w`
* added goimports lint check to .golangci.yml
* format using `goimports -local github.com/mattermost/mattermost-server/v5 -w` for a corner case
* make app-layers, *-mocks and store-layers for ci check
Co-authored-by: Mahmudul Haque <mahmudulhaque@protonmail.com>
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Since this test had t.Parallel set, it would run the sub-tests
in parallel. The issue was that the same file path was being written
from the 2 sub-tests causing duplicate firing of the event handlers.
This would cause a race where the store would be closing, and at the same time,
an event handler would fire, trying to read the fs.watcher field.
Having two separate file paths resolves this.
https://mattermost.atlassian.net/browse/MM-31369
```release-note
NONE
```
* Add shared channels related configuration under a E20 license check
* Apply PR suggestions; Default config value for shared channels
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
When configuration is backed by a database, a separate pool of
connections is used for access from the primary database. This
change sets sensible config DB connection limits in order to
reduce database resource usage at scale.
This change addresses a few issues where config stores were not
properly closed when an error was encountered on server startup.
This could result in leaked database connections when dealing with
a database config store.
* Removing supplier concept from the sql store
* Removing other metions to supplier
* Fixing gofmt
* Fixing gofmt
* Renaming NewSqlStore to New
* Fixing tests
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
* Add support for boolean feature flags.
* Tests
* Use strconv.ParseBool to accept additional values as true.
* Update config/feature_flags.go
Co-authored-by: Christopher Poile <cpoile@gmail.com>
Co-authored-by: Christopher Poile <cpoile@gmail.com>
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
* Basic framework for use of feature flags. Enviroment variable overrides.
* Use Apperr instead of error number increments.
* Undo random viper change.
* Update model/config_test.go
Co-authored-by: Jesse Hallam <jesse.hallam@gmail.com>
Co-authored-by: Jesse Hallam <jesse.hallam@gmail.com>
MM-27744 disable Zap for unit tests.
Zap has no concept of shutdown or close. Zap is only shutdown when the app exits. Not a problem for console logging, but when creating a new Zap logger that outputs to files on every unit test, that leaves no easy way to clean up until process exit. Depending on what else is running this can exhaust all file handles and cause unit tests to fail.
Zap is now disabled unit tests and uses Logr instead, regardless of config settings. `make test-server` peak file handle usage dropped from ~5K to less than 100.
* Moving diagnostics into a service
* Fixing golint checks
* Fixing tests
* Renaming from diagnostics to telemetry
* Adding missing files
* Initializing telemetry earlier in the server startup
* Fixing tests
* Adding a log for the telemetryID initialization error
* Addressing PR review comments
* Fixing merge problem
* Removing some extra Diagnostics mentions
* Making tests pass
* Fix return nil
A nil error is an interface having nil value but a non-nil type.
This leads to unexpected errors in the code well-documented here:
https://golang.org/doc/faq#nil_error
We fix this by passing an additional parameter to handle it.
Caught using https://github.com/dgryski/semgrep-go
* Bring back auto-generated line
* MM-27525: Obscures the Global Relay SMTP password.
* MM-27525: Desanitize global relay's SMTP password.
* MM-27525: Does not set the fake value if the field is blank.
* Add a config for MM User Limit
* Adding graceful errors for if an administrator invites people passed their user limit
* Including changed vendor files
* Adding unit test
* Fix a bug
* Push up working tests (Thanks Joram)
* Add more cases, clean up logs in code
* One more case
* Refactoring based on PR comments
* Updating i18n
* Some changes based on PR review
* Remove a comment
* Bring back some translations that were somehow removed
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
* MM-27178: use FileSettings.Directory in export
* Set empty FileSettings.Directory to default value
* Validate that FileSettings.Directory is non-empty
* Don't set FileSettings.Directory to / in fixConfig
* Run make i18n-extract
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>