* Fix FeatureFlags section erroneously getting written to config
* Avoid invoking config listeners if config has not changed
* Avoid resetting feature flags on store creation
* [MM-31497] - Prevent end users from inviting people and exceeding the free tier limits
* Update error
* Commit forgotten code
* Chnage impl-1
* Change impl-2
* Remove test
* Include tier status
* Renable permissions check
* Change endpoint name
* Update endpoint
* Update api4/cloud.go
Co-authored-by: Maria A Nunez <maria.nunez@mattermost.com>
* Add test for new endpoint
* Format code
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Co-authored-by: Maria A Nunez <maria.nunez@mattermost.com>
* MM-5639: Write panic to log on the way out
We introduce a panic pass-through layer which logs
the panic at a critical level before crashing.
This helps customers to easily get the panic output
in their logging infrastructure, rather than having to
go through journaltctl logs.
https://mattermost.atlassian.net/browse/MM-5639
```release-note
Server crashes due to runtime panics are now captured
as a log line.
```
* re-arrange panic order
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
* 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>
* MM-31993: Add flag to disable gossip compression
Load tests have shown that our workload is not very suitable
to LZW compression. And in fact, compressing leads to more
network bandwidth than less. So we are spending more CPU cycles,
and creating more traffic, leading to a lose-lose situation.
We add a flag to control this behavior. Ideally, this should not
be a flag in the first place, since there is never a need to enable this
because clearly there is no benefit.
But to keep our community servers working, we need to be able
to configure this.
https://mattermost.atlassian.net/browse/MM-31993
```release-notes
Add a flag to disable compression in the Gossip protocol.
By default the value of the flag is false, which is not the existing
default. Therefore, this will cause incompatibility issues during upgrade
where servers of different versions are part of the same cluster.
It is recommended to completely shutdown a cluster, and then do an upgrade.
```
* flip flag to true
* Trigger CI
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
* Update config.go
* Update telemetry.go
* Update store and store test
* Update settings.go
* use new error code
* Trigger CI
Co-authored-by: Haardik Dharma <dharmahaardik08@gmail.com>
* use sync.pool for session
* added back to sync pool
* reverted change
* added a new line
* added back session object
* added back session object
* added back session object
* revert
* refactored into function
* added the session object back into the pool
* work in progress
* work in progress
* work in progress
* code review comments
Co-authored-by: Arjuna Marambe <arjunam@buildxact.com>
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
As mentioned in the documentation:
> Truncate operates on the time as an absolute duration since the zero time;
it does not operate on the presentation form of the time. Thus,
Truncate(Hour) may return a time with a non-zero minute, depending on the
time's Location.
As a result, truncating for anything more than an hour is buggy and should
not be done. The correct way is to construct the date object using the
day, month and year.
https://mattermost.atlassian.net/browse/MM-31353
```release-notes
Fixed a bug in product notices where a date constraint might
fail to match, and would lead to the notice not being fetched
```
We were allowing new password to be reset without asking
for the old password. This was not advertised but was possible nevertheless
through the API.
Since there is already a separate API to change password, we choose to remove
this functionality.
https://mattermost.atlassian.net/browse/MM-32013
```release-note
The /api/v4/users/me/auth API endpoint cannot be used to change password anymore.
This was a hidden feature that was not documented, but was nevertheless possible.
We are just removing the hidden feature.
```
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
We were incorrectly setting the cache control to public
when it should be rather private.
https://mattermost.atlassian.net/browse/MM-31721
```release-notes
Fix Cache-Control headers to instruct that responses may only be cached
on browsers.
```
* docker: prometheus and grafana for development
Add prometheus and grafana docker configuration when developing with access to the enterprise repository. This simplifies the setup for developers adding new metrics or even examining events from their development server. The services are disabled by default when no enterprise source is detected.
Grafana is provisioned automatically with the Prometheus datasource, as well as the canonical dashboards used with Mattermost. Furthermore, no authentication is required to access Grafana to simplify access from a development environment. The default home dashboard is customized to automatically show links to the provisioned dashboards. Dashboards can be saved, and login remains available via the default `admin/admin` credentials (which initiates a password reset), but no dashboard or system configuration is (currently) persisted if the container is destroyed.
Linux requires slightly special handling (well, really it's Docker for MacOS/Windows), in that `host.docker.internal` is the canonical way to resolve the host on MacOS/Windows, but on Linux it's usually sufficient to just use `localhost`. Until https://github.com/docker/for-linux/issues/264 is resolved, this PR includes code to customize the Prometheus configuration to point at the required address for the running platform.
* metrics: track active jobs by type
* metrics: active jobs chart
* metrics: server start and job annotations
* Update build/docker-compose.common.yml
Co-authored-by: Claudio Costa <cstcld91@gmail.com>
* prometheus: resolve docker host via 172.17.0.1 instead
* skip enabling prometheus and grafana by default
* handle JOB_STATUS_ERROR and JOB_STATUS_CANCELED end states
* handle nil srv.metrics
* lookup job to determine type for metrics
* mocked unit tests for jobs
* goimports lint fixes
* missing license
* add instance to server start tag
* filter annotations by selected instance
Co-authored-by: Claudio Costa <cstcld91@gmail.com>
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>