mattermost/server/public/model/system.go

110 lines
3.9 KiB
Go
Raw Permalink Normal View History

// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
2015-09-16 22:59:57 -04:00
package model
import (
"math/big"
2015-09-16 22:59:57 -04:00
)
2015-10-15 14:16:26 -04:00
const (
MM-64486: Remove telemetry (#33606) * MM-64486: Remove telemetry Remove telemetry from Mattermost. We're no longer relying on Rudder upstream, and no longer making use of this information. * recover mock for SystemStore.Get * Fix TestClearPushNotificationSync by adding missing SystemStore mock The test was failing because the SystemStore mock was missing the Get() method that's required by the ServerId() function. Added the missing mock to return a StringMap with SystemServerId. * fix mocking issue * Remove now-unused telemetry and constants * Remove "Disable telemetry events" debug setting * Remove empty functions * Remove most "Telemetry tracking removed" comments * Remove remains of DataPrefetch telemetry * Remove now-unused prop from InviteMembersButton * Remove trackDotMenuEvent * Remove some more leftover comments * Remove lingering logic related to trackingLocation * Remove now-unused argument from useCopyText * Remove lingering telemetry references from PreparingWorkspace * fixup Remove trackDotMenuEvent * Remove lingering telemetry references from signup page and password check * Update snapshots and fix test broken by my changes * Fix unintended behavior change in thread list filtering Remove handleSetFilter wrapper that was accidentally modified during telemetry removal. The function was calling clear() when switching to unread filter, which was not the original behavior. Use setFilter directly instead, restoring the original functionality. * Remove unused useOpenDowngradeModal hook The useOpenDowngradeModal hook was not being used anywhere in the codebase. * Remove unused expandableLink from useExpandOverageUsersCheck The expandableLink return value was not being used by any components. * Re-add missing TeamLinkClicked performance telemetry The mark(Mark.TeamLinkClicked) call was accidentally removed from the handleSwitch function. This telemetry is needed for Looker-based performance tracking. * drop LogSettings.VerboseDiagnostics --------- Co-authored-by: Harrison Healey <harrisonmhealey@gmail.com> Co-authored-by: Mattermost Build <build@mattermost.com>
2025-09-04 14:46:18 -04:00
SystemServerId = "DiagnosticId"
2021-07-12 14:05:36 -04:00
SystemRanUnitTests = "RanUnitTests"
SystemLastSecurityTime = "LastSecurityTime"
SystemActiveLicenseId = "ActiveLicenseId"
SystemLastComplianceTime = "LastComplianceTime"
SystemAsymmetricSigningKeyKey = "AsymmetricSigningKey"
SystemPostActionCookieSecretKey = "PostActionCookieSecret"
SystemInstallationDateKey = "InstallationDate"
SystemOrganizationName = "OrganizationName"
SystemFirstAdminRole = "FirstAdminRole"
2021-07-12 14:05:36 -04:00
SystemFirstServerRunTimestampKey = "FirstServerRunTimestamp"
SystemClusterEncryptionKey = "ClusterEncryptionKey"
SystemPushProxyAuthToken = "PushProxyAuthToken"
2021-07-12 14:05:36 -04:00
SystemUpgradedFromTeId = "UpgradedFromTE"
SystemWarnMetricNumberOfTeams5 = "warn_metric_number_of_teams_5"
SystemWarnMetricNumberOfChannels50 = "warn_metric_number_of_channels_50"
SystemWarnMetricMfa = "warn_metric_mfa"
SystemWarnMetricEmailDomain = "warn_metric_email_domain"
SystemWarnMetricNumberOfActiveUsers100 = "warn_metric_number_of_active_users_100"
SystemWarnMetricNumberOfActiveUsers200 = "warn_metric_number_of_active_users_200"
SystemWarnMetricNumberOfActiveUsers300 = "warn_metric_number_of_active_users_300"
SystemWarnMetricNumberOfActiveUsers500 = "warn_metric_number_of_active_users_500"
SystemWarnMetricNumberOfPosts2m = "warn_metric_number_of_posts_2M"
SystemWarnMetricLastRunTimestampKey = "LastWarnMetricRunTimestamp"
SystemFirstAdminVisitMarketplace = "FirstAdminVisitMarketplace"
2022-02-25 14:56:40 -05:00
SystemFirstAdminSetupComplete = "FirstAdminSetupComplete"
SystemLastAccessiblePostTime = "LastAccessiblePostTime"
SystemLastAccessibleFileTime = "LastAccessibleFileTime"
SystemHostedPurchaseNeedsScreening = "HostedPurchaseNeedsScreening"
SystemPostChannelTypeBackfillComplete = "PostChannelTypeBackfillComplete"
2021-07-12 14:05:36 -04:00
AwsMeteringReportInterval = 1
AwsMeteringDimensionUsageHrs = "UsageHrs"
CloudRenewalEmail = "CloudRenewalEmail"
)
const (
2021-07-12 14:05:36 -04:00
WarnMetricStatusLimitReached = "true"
WarnMetricStatusRunonce = "runonce"
WarnMetricStatusAck = "ack"
WarnMetricStatusStorePrefix = "warn_metric_"
WarnMetricJobInterval = 24 * 7
WarnMetricNumberOfActiveUsers25 = 25
WarnMetricJobWaitTime = 1000 * 3600 * 24 * 7 // 7 days
2015-10-15 14:16:26 -04:00
)
2015-09-16 22:59:57 -04:00
type System struct {
Name string `json:"name"`
Value string `json:"value"`
}
MM-10516: Added support for PostActions in ephemeral posts (#10258) * Added support for PostActions in ephemeral posts The general approach is that we take all the metadata that DoPostAction needs to process client DoPostActionRequests, and store it in a serialized, encrypted Cookie field, in the PostAction struct. The client then must send it back, and it is then used to process PostActions as a fallback top the metadata in the database. This PR adds a new config setting, `ServiceSettings.ActionCookieSecret`. In a cluster environment it must be the same for all instances. - Added type PostActionCookie, and a Cookie string to PostAction. - Added App.AddActionCookiesToPost. - Use App.AddActionCookiesToPost in api4.createEphemeralPost, App.SendEphemeralPost, App.UpdateEphemeralPost. - Added App.DoPostActionWithCookie to process incoming requests with cookies. For backward compatibility, it prefers the metadata in the database; falls back to cookie. - Added plugin.API.UpdateEphemeralPost and plugin.API.DeleteEphemeralPost. - Added App.encryptActionCookie/App.decryptActionCookie. * Style * Fixed an unfortunate typo, tested with matterpoll * minor PR feedback * Fixed uninitialized Context * Fixed another test failure * Fixed permission check * Added api test for DoPostActionWithCookie * Replaced config.ActionCookieSecret with Server.PostActionCookieSecret Modeled after AsymetricSigningKey * style * Set DeleteAt in DeleteEphemeralPost * PR feedback * Removed deadwood comment * Added EXPERIMENTAL comment to the 2 APIs in question
2019-03-01 13:15:31 -05:00
type SystemPostActionCookieSecret struct {
Secret []byte `json:"key,omitempty"`
}
type SystemAsymmetricSigningKey struct {
ECDSAKey *SystemECDSAKey `json:"ecdsa_key,omitempty"`
}
type SystemECDSAKey struct {
Curve string `json:"curve"`
X *big.Int `json:"x"`
Y *big.Int `json:"y"`
D *big.Int `json:"d,omitempty"`
}
// ServerBusyState provides serialization for app.Busy.
type ServerBusyState struct {
2021-07-12 14:05:36 -04:00
Busy bool `json:"busy"`
Expires int64 `json:"expires"`
ExpiresTS string `json:"expires_ts,omitempty"`
}
type AppliedMigration struct {
Version int `json:"version"`
Name string `json:"name"`
}
type LogFilter struct {
ServerNames []string `json:"server_names"`
LogLevels []string `json:"log_levels"`
DateFrom string `json:"date_from"`
DateTo string `json:"date_to"`
}
type LogEntry struct {
Timestamp string
Level string
}
// SystemPingOptions is the options for setting contents of the system ping
// response.
type SystemPingOptions struct {
// FullStatus allows server to set the detailed information about
// the system status.
FullStatus bool
// RestSemantics allows server to return 200 code even if the server
// status is unhealthy.
RESTSemantics bool
}