* Posts * Add missing translation * Fix internal store marshaling * [MM-22051] Remove To/From JSON (Channels) (#18116) * Channels * Channel members * ChannelSearch * Channel categories, list, sidebar, stats, view * Fix conversions * [MM-22051] Remove To/From JSON (Users) (#18121) * User related structs * Fix return * Team related structures (#18127) * [MM-22051] Remove To/From JSON (Status, Bot, Reaction, Thread, FileInfo) (#18130) * Status * Bot * Reaction * Thread * FileInfo * Some fixes * Translations update from Weblate (#18143) * Translated using Weblate (German) Currently translated at 100.0% (2309 of 2309 strings) Translation: mattermost-languages-shipped/mattermost-server Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/de/ * Translated using Weblate (Turkish) Currently translated at 100.0% (2309 of 2309 strings) Translation: mattermost-languages-shipped/mattermost-server Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/tr/ * Translated using Weblate (Hungarian) Currently translated at 100.0% (2309 of 2309 strings) Translation: mattermost-languages-shipped/mattermost-server Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/hu/ * Update translation files Updated by "Cleanup translation files" hook in Weblate. Translation: mattermost-languages-shipped/mattermost-server Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/ Update translation files Updated by "Cleanup translation files" hook in Weblate. Translation: mattermost-languages-shipped/mattermost-server Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/ Update translation files Updated by "Cleanup translation files" hook in Weblate. Translation: mattermost-languages-shipped/mattermost-server Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/ Update translation files Updated by "Cleanup translation files" hook in Weblate. Translation: mattermost-languages-shipped/mattermost-server Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/ * Translated using Weblate (German) Currently translated at 100.0% (2301 of 2301 strings) Translation: mattermost-languages-shipped/mattermost-server Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/de/ * Translated using Weblate (Turkish) Currently translated at 100.0% (2301 of 2301 strings) Translation: mattermost-languages-shipped/mattermost-server Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/tr/ * Translated using Weblate (Hungarian) Currently translated at 100.0% (2301 of 2301 strings) Translation: mattermost-languages-shipped/mattermost-server Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/hu/ * Translated using Weblate (English (Australia)) Currently translated at 100.0% (2301 of 2301 strings) Translation: mattermost-languages-shipped/mattermost-server Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/en_AU/ * Translated using Weblate (Bulgarian) Currently translated at 100.0% (2301 of 2301 strings) Translation: mattermost-languages-shipped/mattermost-server Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/bg/ * Translated using Weblate (Japanese) Currently translated at 100.0% (2301 of 2301 strings) Translation: mattermost-languages-shipped/mattermost-server Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/ja/ * Translated using Weblate (Chinese (Simplified)) Currently translated at 100.0% (2301 of 2301 strings) Translation: mattermost-languages-shipped/mattermost-server Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/zh_Hans/ Co-authored-by: JtheBAB <srast@bioc.uzh.ch> Co-authored-by: Kaya Zeren <kayazeren@gmail.com> Co-authored-by: Tóth Csaba // Online ERP Hungary Kft <csaba.toth@online-erp.hu> Co-authored-by: Matthew Williams <Matthew.Williams@outlook.com.au> Co-authored-by: Nikolai Zahariev <nikolaiz@yahoo.com> Co-authored-by: kaakaa <stooner.hoe@gmail.com> Co-authored-by: aeomin <lin@aeomin.net> Co-authored-by: Weblate (bot) <hosted@weblate.org> Co-authored-by: JtheBAB <srast@bioc.uzh.ch> Co-authored-by: Kaya Zeren <kayazeren@gmail.com> Co-authored-by: Tóth Csaba // Online ERP Hungary Kft <csaba.toth@online-erp.hu> Co-authored-by: Matthew Williams <Matthew.Williams@outlook.com.au> Co-authored-by: Nikolai Zahariev <nikolaiz@yahoo.com> Co-authored-by: kaakaa <stooner.hoe@gmail.com> Co-authored-by: aeomin <lin@aeomin.net> * [MM-22051] Remove To/From JSON methods from model (#18138) * Scheme * Role * Session * Config * Status * Fix logic * Emoji * GuestsInvite * Group * Command * ClusterInfo * License * Job * System * Plugin * Command2 * IncomingWebhook * OutgoingWebhook * Fix tests * Update traslation * Some fixes * Add missing return * Simplify * Make Config.ToJSONFiltered() return []byte * Make Busy.ToJSON() return []byte * Include error in log * Split logic * [MM-22051] Remove To/From JSON (final) (#18150) * SwitchRequest * PluginEventData * Permalink * PushNotification * SuggestCommand * PluginsResponse * WebSocketMessage * RemoteCluster * SharedChannel * PluginStatuses * InitialLoad * ClusterDiscovery * ClusterStats * MfaSecret * GroupSyncable * SAML * WebSocketRequest * TypingRequest * SecurityBulletin * OAuthApp * IntegrationAction * DataRetention * Preference * FileInfoList * Compliance * Preferences * FileInfoSearchResults * TermsOfService * InstallMarketplacePluginRequest * GitLabUser * UploadSessions * Remove unused helpers * Fix tests * [MM-23280] Fix linting for ToJSON/FromJSON (#18153) * SwitchRequest * PluginEventData * Permalink * PushNotification * SuggestCommand * PluginsResponse * WebSocketMessage * RemoteCluster * SharedChannel * PluginStatuses * InitialLoad * ClusterDiscovery * ClusterStats * MfaSecret * GroupSyncable * SAML * WebSocketRequest * TypingRequest * SecurityBulletin * OAuthApp * IntegrationAction * DataRetention * Preference * FileInfoList * Compliance * Preferences * FileInfoSearchResults * TermsOfService * InstallMarketplacePluginRequest * GitLabUser * UploadSessions * Remove unused helpers * Fix tests * Fix linting for ToJSON/FromJSON * Fix conversions Co-authored-by: Weblate (bot) <hosted@weblate.org> Co-authored-by: JtheBAB <srast@bioc.uzh.ch> Co-authored-by: Kaya Zeren <kayazeren@gmail.com> Co-authored-by: Tóth Csaba // Online ERP Hungary Kft <csaba.toth@online-erp.hu> Co-authored-by: Matthew Williams <Matthew.Williams@outlook.com.au> Co-authored-by: Nikolai Zahariev <nikolaiz@yahoo.com> Co-authored-by: kaakaa <stooner.hoe@gmail.com> Co-authored-by: aeomin <lin@aeomin.net> Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
183 строки
5.6 KiB
Go
183 строки
5.6 KiB
Go
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
// See LICENSE.txt for license information.
|
|
|
|
package model
|
|
|
|
import (
|
|
"math/big"
|
|
)
|
|
|
|
const (
|
|
SystemTelemetryId = "DiagnosticId"
|
|
SystemRanUnitTests = "RanUnitTests"
|
|
SystemLastSecurityTime = "LastSecurityTime"
|
|
SystemActiveLicenseId = "ActiveLicenseId"
|
|
SystemLicenseRenewalToken = "LicenseRenewalToken"
|
|
SystemLastComplianceTime = "LastComplianceTime"
|
|
SystemAsymmetricSigningKeyKey = "AsymmetricSigningKey"
|
|
SystemPostActionCookieSecretKey = "PostActionCookieSecret"
|
|
SystemInstallationDateKey = "InstallationDate"
|
|
SystemFirstServerRunTimestampKey = "FirstServerRunTimestamp"
|
|
SystemClusterEncryptionKey = "ClusterEncryptionKey"
|
|
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"
|
|
SystemMetricSupportEmailNotConfigured = "warn_metric_support_email_not_configured"
|
|
SystemFirstAdminVisitMarketplace = "FirstAdminVisitMarketplace"
|
|
AwsMeteringReportInterval = 1
|
|
AwsMeteringDimensionUsageHrs = "UsageHrs"
|
|
UserLimitOverageCycleEndDate = "UserLimitOverageCycleEndDate"
|
|
OverUserLimitForgivenCount = "OverUserLimitForgivenCount"
|
|
OverUserLimitLastEmailSent = "OverUserLimitLastEmailSent"
|
|
)
|
|
|
|
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 SupportPacket struct {
|
|
ServerOS string `yaml:"server_os"`
|
|
ServerArchitecture string `yaml:"server_architecture"`
|
|
DatabaseType string `yaml:"database_type"`
|
|
DatabaseVersion string `yaml:"database_version"`
|
|
LdapVendorName string `yaml:"ldap_vendor_name,omitempty"`
|
|
LdapVendorVersion string `yaml:"ldap_vendor_version,omitempty"`
|
|
ElasticServerVersion string `yaml:"elastic_server_version,omitempty"`
|
|
ElasticServerPlugins []string `yaml:"elastic_server_plugins,omitempty"`
|
|
}
|
|
|
|
type FileData struct {
|
|
Filename string
|
|
Body []byte
|
|
}
|
|
|
|
var WarnMetricsTable = map[string]WarnMetric{
|
|
SystemWarnMetricMfa: {
|
|
Id: SystemWarnMetricMfa,
|
|
Limit: -1,
|
|
IsBotOnly: true,
|
|
IsRunOnce: true,
|
|
},
|
|
SystemWarnMetricEmailDomain: {
|
|
Id: SystemWarnMetricEmailDomain,
|
|
Limit: -1,
|
|
IsBotOnly: true,
|
|
IsRunOnce: true,
|
|
},
|
|
SystemWarnMetricNumberOfTeams5: {
|
|
Id: SystemWarnMetricNumberOfTeams5,
|
|
Limit: 5,
|
|
IsBotOnly: true,
|
|
IsRunOnce: true,
|
|
},
|
|
SystemWarnMetricNumberOfChannels50: {
|
|
Id: SystemWarnMetricNumberOfChannels50,
|
|
Limit: 50,
|
|
IsBotOnly: true,
|
|
IsRunOnce: true,
|
|
},
|
|
SystemWarnMetricNumberOfActiveUsers100: {
|
|
Id: SystemWarnMetricNumberOfActiveUsers100,
|
|
Limit: 100,
|
|
IsBotOnly: true,
|
|
IsRunOnce: true,
|
|
},
|
|
SystemWarnMetricNumberOfActiveUsers200: {
|
|
Id: SystemWarnMetricNumberOfActiveUsers200,
|
|
Limit: 200,
|
|
IsBotOnly: true,
|
|
IsRunOnce: true,
|
|
},
|
|
SystemWarnMetricNumberOfActiveUsers300: {
|
|
Id: SystemWarnMetricNumberOfActiveUsers300,
|
|
Limit: 300,
|
|
IsBotOnly: true,
|
|
IsRunOnce: true,
|
|
},
|
|
SystemWarnMetricNumberOfActiveUsers500: {
|
|
Id: SystemWarnMetricNumberOfActiveUsers500,
|
|
Limit: 500,
|
|
IsBotOnly: false,
|
|
IsRunOnce: true,
|
|
},
|
|
SystemWarnMetricNumberOfPosts2m: {
|
|
Id: SystemWarnMetricNumberOfPosts2m,
|
|
Limit: 2000000,
|
|
IsBotOnly: false,
|
|
IsRunOnce: true,
|
|
},
|
|
SystemMetricSupportEmailNotConfigured: {
|
|
Id: SystemMetricSupportEmailNotConfigured,
|
|
Limit: -1,
|
|
IsBotOnly: true,
|
|
IsRunOnce: false,
|
|
SkipAction: true,
|
|
},
|
|
}
|
|
|
|
type WarnMetric struct {
|
|
Id string
|
|
Limit int64
|
|
IsBotOnly bool
|
|
IsRunOnce bool
|
|
SkipAction bool
|
|
}
|
|
|
|
type WarnMetricDisplayTexts struct {
|
|
BotTitle string
|
|
BotMessageBody string
|
|
BotSuccessMessage string
|
|
EmailBody string
|
|
}
|
|
type WarnMetricStatus struct {
|
|
Id string `json:"id"`
|
|
Limit int64 `json:"limit"`
|
|
Acked bool `json:"acked"`
|
|
StoreStatus string `json:"store_status,omitempty"`
|
|
}
|
|
|
|
type SendWarnMetricAck struct {
|
|
ForceAck bool `json:"forceAck"`
|
|
}
|