Commit graph

49 commits

Author SHA1 Message Date
Ben Schumacher
36b00d9bb6
[MM-64485] Remove separate notification log file (#33473)
- Remove NotificationLogSettings configuration entirely
- Add new notification-specific log levels (NotificationError, NotificationWarn, NotificationInfo, NotificationDebug, NotificationTrace)
- Consolidate all notification logs into standard mattermost.log file
- Update all notification logging code to use new multi-level logging (MlvlNotification*)
- Remove notification logger infrastructure and support packet integration
- Update test configurations and remove deprecated functionality tests
- Add comprehensive tests for new notification log levels

This change simplifies log analysis by unifying all application logging while maintaining flexibility through Advanced Logging configuration for administrators who need separate notification logs.

🤖 Generated with [Claude Code](https://claude.ai/code)
---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-08-20 10:17:45 +02:00
Devin Binnie
4f06ab8379
[MM-64607] Add endpoint to check for upgradability, show correct error message and remove button if upgrade is not possible (#33528)
* [MM-64607] Add endpoint to check for upgradability, show correct error message and remove button if upgrade is not possible

* PR feedback

* PR feedback

* Fix test

* Fix tests again
2025-08-18 10:40:48 -04:00
Ben Schumacher
f16b040643
[MM-64858] Generate Support Packet in memory instead of writing it to the file store first (#33443)
Co-authored-by: Claude <noreply@anthropic.com>
2025-07-22 12:25:08 +02:00
Vishal
dbc04cfebe
use consts for audit events (#33433) 2025-07-16 10:17:03 +05:30
David Krauser
aaa62a40ae
[MM-64686] Expose audit logging functionality via plugin API (#31204)
This commit exposes audit logging functionality to plugins via the plugin API, allowing plugins to create and log audit records. Additionally, it addresses a gob encoding issue that could cause plugin crashes when audit data contains nil pointers or unregistered types.
2025-06-25 20:37:32 -04:00
Ben Schumacher
0cf6361139
[MM-63578] Fix support packet caching issue (#31133)
Fix support packet caching issue by adding no-cache headers

Added Cache-Control headers to prevent browser caching when downloading support packets.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-10 11:39:06 +02:00
Jesse Hallam
42274b9eee
MM-63200: unrestricted local admin (#30295)
* use SessionHasPermissionToCheckRestrictedAdmin

* allow unrestricted config edits from localmode

* check model.PermissionManageSystem for getLatestVersion

* simplify/clarify RequestTrialLicense semantics

* rename for clarity

* whitespace from linter

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
2025-04-10 22:22:03 +03:00
Ben Schumacher
8d4bf4bae0
[MM-54288] Support Packet V2 (#29403) 2025-01-13 20:23:09 +01:00
Jesús Espino
d316df6d28
Replacing interface{} with any everywhere (except generated mocks) (#29446) 2024-12-15 21:11:36 +01:00
Daniel Espino García
118d0346ee
Add test notification tool (#28334)
* Add test notification tool

* Add frontend styles

* Remove option from admin view

* Refactor create post and add translations

* Fix several CI errors

* Fix API and frontend snapshots

* Refactor trailing and leading icon on buttons

* Add different button states

* i18n-extract

* Fix wrong text

* Add tests

* Fix wrong string

* Fix test

* feat: E2E send test notifications (#28371)

* Refactor send desktop notification

* Address rest of the feedback

* Fix tests

* Add correct link

* Fix test

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
Co-authored-by: yasserfaraazkhan <attitude3cena.yf@gmail.com>
2024-11-08 13:57:06 +01:00
Rohan Sharma
a2acee5280
fix: system errcheck issues (#28537)
Co-authored-by: Ben Schumacher <ben.schumacher@mattermost.com>
2024-10-07 13:37:46 +00:00
Ben Schumacher
2b426573cd
[MM-60619] Annotate cluster logs messages (#28268) 2024-09-27 09:17:16 +02:00
goooov
70cb1934e9
[MM-55296] Added warning in Workspace dashboard if Mattermost is running as root (#27999)
Co-authored-by: Ben Schumacher <ben.schumacher@mattermost.com>
2024-09-18 11:51:50 +02:00
Daniel Espino García
af503d9d45
Ignore ack and notification counts if notifications are blocked by the device (#27570)
* Ignore performance counts if notifications are blocked by the device

* Change the endpoint to allow more information

* Add tests and API description

* Remove wrong test

* Address feedback

* Only update the cache when there is no error

* Follow same casing as other props

* use one single endpoint

* Fix tests

* Fix i18n

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
2024-09-11 18:01:21 +02:00
Agniva De Sarker
540febd866
MM-56876: Redis: first introduction (#27752)
```release-note
NONE
```

---------

Co-authored-by: Jesús Espino <jespinog@gmail.com>
Co-authored-by: Mattermost Build <build@mattermost.com>
2024-08-06 09:28:41 +05:30
Ben Schumacher
1158e6358c
[MM-54593] HA aware Support Packet (#27598) 2024-08-03 16:11:13 +02:00
enzowritescode
d44c3d5d45
Replace Hard-coded HTTP Verbs with Constants (#27219)
* Replace hard-coded HTTP verbs with constants in `net/http`
2024-07-15 08:52:03 -06:00
Daniel Espino García
e5a3dd7fea
Add platform information for push notification metrics (#27460)
* Add platform information for push notification metrics

* Address feedback

* Add the client platform returned by the devices to the normalize function

* Add "no platform" platform label to distinguish from unknown
2024-07-05 09:34:01 +02:00
Arya Khochare
a8b18ac807
MM-57013 Added download button for downloading logs from server logs page in system console (#26389)
* added download system logs

* download all logs

* download all logs check-lint fix

* check lint fix

* download logs api

* download logs api working

* download logs working with error log

* linting issues and code cleanup

* CI check fix

* documented the api and logs from file with error handling

* test and final changes done

* final changes done

* Fix order of server-side translations

* Fix incorrect indentation of logs.yaml

---------

Co-authored-by: Harrison Healey <harrisonmhealey@gmail.com>
2024-06-24 14:05:23 -04:00
Devin Binnie
9cf5a4bccb
Notification metrics fixes (#26854)
* Ensure your own posts are never ACKed

* Don't ACK mobile websocket notifications

* Add counter for the unsupported Desktop Apps

* Count only push messages when checking for acks

* Fix generated

* Add tests, fix comment

* Fix help string

* Check for nil session
2024-04-23 21:31:17 +00:00
Ben Schumacher
8348acac49
[MM-57826] Make sure the original errors are wrapped when AppErrors are returned (#26771)
Co-authored-by: Ibrahim Serdar Acikgoz <serdaracikgoz86@gmail.com>
2024-04-22 12:03:28 +02:00
Devin Binnie
02e23a3275
[MM-57066][MM-57329] Added metrics for all notification stopping points, consolidated categories between metrics and logging (#26799)
* [MM-57066] Add metric counters for notification events

* Some small changes

* Account for Metrics() sometimes being nil

* Fix test (again)

* Fix more tests

* A few changes from testing - added success counter

* Missed a mock

* Lint

* Add feature flag for notification monitoring
2024-04-18 10:30:08 -04:00
Ibrahim Serdar Acikgoz
92f11f8971
Make support packet composable with plugins (#26403)
---------

Co-authored-by: Ben Schumacher <ben.schumacher@mattermost.com>
2024-04-12 10:05:58 +02:00
Aditya Pratap Singh Hada
33977e1702
[MM 55591] - Add Request Context and logger to all public methods in server/channels/app/analytics.go (#26331) 2024-03-11 13:27:27 +01:00
Devin Binnie
893c44fe85
[MM-56757] Expand NotificationsLog to include websocket and email, adding much more varied logging across the entire process (#26273)
* [MM-56757] Expand NotificationsLog to include websocket and email, adding much more varied logging across the entire process

* Rework the status/notify prop calls

* Avoid some repetition in the logging calls

* Fix one log

* Wrap error

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
2024-02-29 12:33:05 -05:00
Nick Misasi
9ffec5eab6
[CLD-7029] Add a new system console page for configuring custom export FileSettings (#26034)
* Add a new system console page for configuring custom export FileSettings

* Remove NONE option for ExportDriverName dropdown

* Fix tests

* Fix i18n

* Update webapp/channels/src/components/admin_console/admin_definition.tsx

Co-authored-by: Ben Schumacher <ben.schumacher@mattermost.com>

* PR Feedback

* Fix formatting

* gofmt

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
Co-authored-by: Ben Schumacher <ben.schumacher@mattermost.com>
2024-02-28 16:06:17 +00:00
Maria A Nunez
e9b9d4ff60
Deprecate admin advisor (#26045)
* Deprecate admin advisor

* Webapp portion

* More webapp deprecation

* More cleanup

* Linting

* emoved metric ack dialog from annoucenemet bar

* Cleanued up uninsed i18n strings

* Updated test

* fixed types

* Updating server test

* Updated i18n

* Updated cypress test:

* Updated cypress test:

---------

Co-authored-by: harshil Sharma <harshilsharma63@gmail.com>
2024-02-26 09:05:00 +05:30
Harshil Sharma
521844fed5
API handler opts modifier (#26148)
* POC for API handler opts modifier

* Made upload POSt api a  file upload API

* Specified file upload local API

* Specified file upload local API

* Specified file upload API

* Simplified handler params

* Added basic security checks

* Fixed i18n

* used type for API handler options

* Removed limited reader from util deserializers (#26263)
2024-02-21 12:13:50 +00:00
Ibrahim Serdar Acikgoz
7d8a56019b
[MM-56348] system/ping: add new method with options (#26079) 2024-02-20 14:22:28 +01:00
Scott Bishel
82b8d4dc07
MM-55966 - Update ArrayFromJSON to use LimitedReader (#25510)
* update ArrayFromJSON to use LimitedReader

* update for bad merge

* fix lint errors

* update test code

* update unit tests

* update unit tests

* fix unit tests

* use consts, other cleanup

* add non sorting duplicate check

* set config to default value, then config setting if available

* fix lint errors

* fixes and debugs

* fix log test

* remove setting from Client, add unlimited Parser to client

* a couple more fixes

* another fix

* rename some variables

* remove superflous call

* check for valid MaximumPayloadSize

* update language file

* fix for e2e-tests

* update util function to return error

* lint fix

* update config property name to include unit

* fix for unit test

* add new config to telemetry

* call function to create LimitedReader

* Deprecate old function, use new function name

* return new AppError on failed parse

* return new AppError on failed parse

* return new AppError on failed parse

* add constant for i18n valid constants

* Update server/public/model/utils_test.go

Co-authored-by: Miguel de la Cruz <mgdelacroix@gmail.com>

* Apply suggestions from code review

Co-authored-by: Miguel de la Cruz <mgdelacroix@gmail.com>

* update error variable, remove unnecessary check

* Update function names

* fix errors from merge

* update unit test to create unique ids

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
Co-authored-by: Miguel de la Cruz <mgdelacroix@gmail.com>
2024-01-09 10:04:16 -07:00
Thomas Brq
6cf7115e1f
[GH-25492] Add the request context to all public methods in server/channels/app/admin.go (#25498) 2023-11-29 17:07:54 +01:00
Ben Schumacher
e99ded1635
[MM-55480] Update logr to v2.0.21 (#25431) 2023-11-23 10:30:08 +01:00
KIMBOH LOVETTE
29cd6177c0
[GH-21565]-Add the request context and logger to all public methods in server/channels/app/audit.go (#25368) 2023-11-14 13:34:47 +01:00
Ben Schumacher
a4ece51391
[MM-45065] Switch all api4 methods to use the new logger (#24896) 2023-10-31 11:00:22 +01:00
Ben Schumacher
4ed32be6d2
[MM-53019] Add file storage permission check to workspace health dashboard (#24403) 2023-10-19 17:31:09 +02:00
Ben Schumacher
eb35e83152
[MM-54850] Use request-specific logger in channels/app/admin_advisor.go (#24859) 2023-10-12 08:23:57 +02:00
Deepayan Mukherjee
77ee4d93b7
[MM-24856] User request specific loggers in channels/api4/system.go (#24881)
* replace global mlog with local c.Logger and setInvalidParam with setInvalidParamWithErr if relevant

Signed-off-by: Deepayan Mukherjee <deepayanmukherjee1312@gmail.com>

* replace global mlog.Info with local c.Logger.Info

Signed-off-by: Deepayan Mukherjee <deepayanmukherjee1312@gmail.com>

---------

Signed-off-by: Deepayan Mukherjee <deepayanmukherjee1312@gmail.com>
2023-10-11 17:34:49 +02:00
Ben Schumacher
aad25be4e1
[MM-54434] Use job.Logger to capture ldap logs (#24493) 2023-10-06 22:43:21 +02:00
Delaney Sylvans
d61364a24a
[MM-54024] Handle JSON nulls when unmarshalling in api4 (#24656)
* handle JSON nulls when unmarshalling in api4

* catch more cases of unhandled JSON null

* fix lint issues

* remove unnecessary checks

* add bot tests for null values

* fix bot_test lint

* add channel null tests

* add group null tests

* add notify_admin null tests

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
2023-10-05 19:25:59 +05:30
Agniva De Sarker
acdfefe456
Revert "MM-53879: Fix recursive loading of license (#24200)" (#24498)
This reverts commit dd73c2af0f.
2023-09-07 20:58:20 +05:30
Ben Schumacher
30b12f199b
[MM-54132] Use annotated logger for log messages from jobs (#24275) 2023-09-07 08:50:22 +02:00
Christopher Poile
b6f2c8205e
MM-54219 - Fix: Improve limits on redirectLocationDataCache (#24429)
* ignore redirect locations over certain length

* maybe the link isn't necessary

* remove unrelated debugging line

* PR comments
2023-09-05 14:04:14 -04:00
Agniva De Sarker
dd73c2af0f
MM-53879: Fix recursive loading of license (#24200)
There were multiple problems with loading of a license.

1. It was called from inside app/server.go and app/platform/service.go. The first one wasn't really needed anymore, so we remove it.

2. To make loading of a license work across a cluster, the license load action was attached along with the `InvalidateAllCachesSkipSend` method. But the problem with that was that it would even get called in the caller node as well, putting it in a recursive loop.

```
LoadLicense -> SaveLicense -> InvalidateAllCaches -> InvalidateAllCachesSkipSend -> LoadLicense
```

To fix this, we create a dedicated loadLicense cluster event and move it away from the `InvalidateAllCachesSkipSend` method. And then from the caller side, we just trigger this action.

3. We also remove the first call to check license expiration which would load the license again. This is unnecessary because if the license is expired, server wouldn't start at all.

While here, we also make some other improvements like removing unnecessary goroutine spawning while publishing websocket events. They are already handled asynchronously, so there is no need
to create a goroutine for that.

We also remove

```
ps.ReloadConfig()
ps.InvalidateAllCaches()
```

from requestTrialLicense as they are already called from inside `*PlatformService.SaveLicense`.

And lastly, we remove the `*model.AppError` return from `*PlatformService.InvalidateAllCaches` because there was nothing to return at all.

https://mattermost.atlassian.net/browse/MM-53879

```release-note
Fix several issues with loading of a license
```
2023-08-21 20:17:16 +05:30
Agniva De Sarker
efaa6264cc
MM-53032: Fix module path after repo rename (#23689)
It was a good decision in hindsight to keep the public module as 0.x
because this would have been a breaking change again.

https://mattermost.atlassian.net/browse/MM-53032
```release-note
Changed the Go module path from github.com/mattermost/mattermost-server/server/v8 to github.com/mattermost/mattermost/server/v8.

For the public facing module, it's path is also changed from github.com/mattermost/mattermost-server/server/public to github.com/mattermost/mattermost/server/public
```
2023-06-11 10:54:35 +05:30
Jesse Hallam
bb02b35048
Expose public/ API as submodule (#23345)
* model -> public/model

* plugin -> public/plugin

* public/model/utils -> public/utils

* platform/shared/mlog -> public/shared/mlog

* platform/shared/i18n -> public/shared/i18n

* platform/shared/markdown -> public/shared/markdown

* platform/services/timezones -> public/shared/timezones

* channels/einterfaces -> einterfaces

* expose public/ submodule

* go mod tidy

* .github: cache-dependency-path, setup-go-work

* modules-tidy for public/ too

* remove old gomodtidy
2023-05-10 13:07:02 -03:00
Agniva De Sarker
b200a07881
v8.0 module release (#22975)
https://mattermost.atlassian.net/browse/MM-52079

```release-note
We upgrade the module version to 8.0. The new module path is github.com/mattermost-server/server/v8.
```


Co-authored-by: Doug Lauder <wiggin77@warpmail.net>
2023-04-18 11:05:28 +05:30
Agniva De Sarker
56bf1b695a
MM-49984: Displaying active search backend in system console (#22721)
This will be shown in the system console to let users know
which search backend is active.

Implemented via adding an extra param in the ping response.

https://mattermost.atlassian.net/browse/MM-49984

```release-note
The database section in the system console now has an additional
read-only section which shows the active search backend in use.

This can be helpful to confirm which is the currently active
search engine when there are multiple of them configured.
```
---------

Co-authored-by: Mattermost Build <build@mattermost.com>
2023-04-14 14:28:50 +05:30
Sinan Sonmez (Chaush)
35d3e3e91e
GH21563: Add the request context and logger to all public methods in app/admin.go (#22898)
* migrate mlog

* fix linter issue
2023-04-13 14:21:11 +05:30
Doug Lauder
c943ed6859
Mono repo -> Master (#22553)
Combines the following repositories into one:

https://github.com/mattermost/mattermost-server
https://github.com/mattermost/mattermost-webapp
https://github.com/mattermost/focalboard
https://github.com/mattermost/mattermost-plugin-playbooks
2023-03-22 17:22:27 -04:00