mattermost/server/public/model/system.go
Christopher Poile 2ada8d7659
MM-67540 - Allow searching public channel messages without channel membership (#35298)
* UpdateByQuery methods for channel_type; rewrite reindexChannelPosts

log pre-fetch error in channel Update and upgrade reindexChannelPosts to error level

* add backfill orchestration, config listener, webapp toggle changes

fix misleading backfill complete log when SaveOrUpdate fails

* add integration & unit tests for public channel search and backfill

* fix nil pointer dereference on UpdateByQuery response and log partial failures

* add tests for compliance mode override and P channel post leakage

* update system console snapshots

* add instructions to error message

* improve compliance-mode test

* getAllChannels doesn't filter by O/S, need to do ourselves

* in search, load channel info for channels we're not a member of

* blank commit -- something is wrong with github, maybe this will help

* improve channelType passing; error msg; simplify settings naming

* debug logging for timing backfill and channel change; TO BE REVERTED

* fix getMissingChannelsFromFiles in search as well

* blank commit
2026-03-09 14:07:44 -04:00

109 lines
3.9 KiB
Go

// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
package model
import (
"math/big"
)
const (
SystemServerId = "DiagnosticId"
SystemRanUnitTests = "RanUnitTests"
SystemLastSecurityTime = "LastSecurityTime"
SystemActiveLicenseId = "ActiveLicenseId"
SystemLastComplianceTime = "LastComplianceTime"
SystemAsymmetricSigningKeyKey = "AsymmetricSigningKey"
SystemPostActionCookieSecretKey = "PostActionCookieSecret"
SystemInstallationDateKey = "InstallationDate"
SystemOrganizationName = "OrganizationName"
SystemFirstAdminRole = "FirstAdminRole"
SystemFirstServerRunTimestampKey = "FirstServerRunTimestamp"
SystemClusterEncryptionKey = "ClusterEncryptionKey"
SystemPushProxyAuthToken = "PushProxyAuthToken"
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"
SystemFirstAdminSetupComplete = "FirstAdminSetupComplete"
SystemLastAccessiblePostTime = "LastAccessiblePostTime"
SystemLastAccessibleFileTime = "LastAccessibleFileTime"
SystemHostedPurchaseNeedsScreening = "HostedPurchaseNeedsScreening"
SystemPostChannelTypeBackfillComplete = "PostChannelTypeBackfillComplete"
AwsMeteringReportInterval = 1
AwsMeteringDimensionUsageHrs = "UsageHrs"
CloudRenewalEmail = "CloudRenewalEmail"
)
const (
WarnMetricStatusLimitReached = "true"
WarnMetricStatusRunonce = "runonce"
WarnMetricStatusAck = "ack"
WarnMetricStatusStorePrefix = "warn_metric_"
WarnMetricJobInterval = 24 * 7
WarnMetricNumberOfActiveUsers25 = 25
WarnMetricJobWaitTime = 1000 * 3600 * 24 * 7 // 7 days
)
type System struct {
Name string `json:"name"`
Value string `json:"value"`
}
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 {
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
}