Files
upstream-mattermost/server/public/model/support_packet.go
upstream-mirror 240db4e2a7
Some checks failed
Server CI / Postgres (shard 0) (push) Has been skipped
Server CI / Postgres (shard 3) (push) Has been skipped
BuildEnv Docker Image / build-image (push) Failing after 4s
BuildEnv Docker Image / build-image-fips (push) Failing after 4s
Migration Review & Release Notes / Generate migration review & release notes (push) Failing after 3s
Server CI / Build Environment (push) Failing after 3s
Server CI / Postgres (shard 1) (push) Has been skipped
Tools CI / check-style (mattermost-govet) (push) Failing after 4s
Server CI / Postgres (shard 2) (push) Has been skipped
Tools CI / check-style (mmgotool) (push) Failing after 3s
Server CI / Elasticsearch v8 Compatibility (push) Has been skipped
Server CI / OpenSearch v2 Compatibility (push) Has been skipped
Server CI / Postgres FIPS (shard 0) (push) Has been skipped
Tools CI / Test (mattermost-govet) (push) Failing after 3s
Server CI / Postgres FIPS (shard 1) (push) Has been skipped
Server CI / Postgres FIPS (shard 2) (push) Has been skipped
Tools CI / Test (mmgotool) (push) Failing after 3s
Server CI / Postgres FIPS (shard 3) (push) Has been skipped
Server CI / Run mmctl tests (push) Has been skipped
Server CI / Run mmctl tests (FIPS) (push) Has been skipped
Server CI / Merge Postgres Test Results (push) Has been skipped
Server CI / Merge Postgres FIPS Test Results (push) Has been skipped
Server CI / Check backport migrations (push) Has been skipped
Server CI / Check generated files (push) Has been skipped
Server CI / check-style (push) Has been skipped
Server CI / Vet API (push) Has been skipped
Server CI / Build mattermost server app (push) Has been skipped
Server CI / Server CI Complete (push) Failing after 2s
Server CI / Server CI Artifacts (push) Has been skipped
Server CI / Sentry Upload (push) Has been skipped
Server CI / Server CI Report (push) Failing after 5m1s
Server CI Nightly Race / Race Detector (push) Has been skipped
CodeQL / Analyze (go) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
Webapp CI Cache Warm / Warm Webapp node_modules Cache (push) Has been cancelled
E2E CI Cache Warm / Warm E2E npm Registry Cache (push) Has been cancelled
API / build (push) Has been cancelled
Web App CI / check-types (push) Has been cancelled
Web App CI / check-lint (push) Has been cancelled
Web App CI / check-i18n (push) Has been cancelled
Web App CI / check-external-links (push) Has been cancelled
Web App CI / test (platform) (push) Has been cancelled
Web App CI / test (mattermost-redux) (push) Has been cancelled
Web App CI / test (channels shard 1/4) (push) Has been cancelled
Web App CI / test (channels shard 2/4) (push) Has been cancelled
Web App CI / test (channels shard 3/4) (push) Has been cancelled
Web App CI / test (channels shard 4/4) (push) Has been cancelled
Web App CI / upload-coverage (push) Has been cancelled
Web App CI / build (push) Has been cancelled
YAML Lint / yamllint (push) Has been cancelled
Push mirrored docker images / cd/Push mirrored docker images (push) Has been cancelled
docs-cd / Build and deploy docs (push) Has been cancelled
Docs CI / build (push) Has been cancelled
E2E Cache Warm: Cypress deps / Warm Cypress deps cache (push) Has been cancelled
Scorecards supply-chain security / Scorecard analysis (push) Has been cancelled
Server CI Weekly / Postgres FIPS (push) Has been skipped
Server CI Weekly / Run mmctl tests (FIPS) (push) Has been skipped
Server CI Weekly / Postgres with binary parameters (push) Has been skipped
Server CI Weekly / Build Environment (push) Failing after 1s
Server CI Nightly Race / Build Environment (push) Failing after 1s
Server CI Cache Warm / Warm Go Module and Build Cache (push) Failing after 2s
snapshot of https://github.com/mattermost/mattermost.git (master, 2026-09-16; blobs > 131072B omitted)
2026-09-16 00:29:55 +05:00

246 lines
9.8 KiB
Go

// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
package model
import "time"
const (
CurrentSupportPacketVersion = 2
SupportPacketErrorFile = "warning.txt"
)
type SupportPacketDiagnostics struct {
Version int `yaml:"version"`
License struct {
Company string `yaml:"company"`
Users int `yaml:"users"`
SkuShortName string `yaml:"sku_short_name"`
IsTrial bool `yaml:"is_trial,omitempty"`
IsGovSKU bool `yaml:"is_gov_sku,omitempty"`
IsNonProduction bool `yaml:"is_non_production,omitempty"`
} `yaml:"license"`
Server struct {
// Machine
OS string `yaml:"os"`
Architecture string `yaml:"architecture"`
Hostname string `yaml:"hostname"`
InstallationType string `yaml:"installation_type"`
// Capacity
CPUCores int `yaml:"cpu_cores"`
TotalMemoryMB uint64 `yaml:"total_memory_mb"`
ContainerCPULimit float64 `yaml:"container_cpu_limit,omitempty"`
ContainerMemoryLimitMB uint64 `yaml:"container_memory_limit_mb,omitempty"`
// Process lifecycle
ProcessID int `yaml:"process_id"`
StartedAt time.Time `yaml:"started_at"`
HostStartedAt time.Time `yaml:"host_started_at,omitempty"`
OpenFileDescriptors int64 `yaml:"open_file_descriptors"`
MaxFileDescriptors int64 `yaml:"max_file_descriptors"`
// Software
Version string `yaml:"version"`
BuildHash string `yaml:"build_hash"`
GoVersion string `yaml:"go_version"`
} `yaml:"server"`
Config struct {
Source string `yaml:"store_type"`
} `yaml:"config"`
Database struct {
Type string `yaml:"type"`
Version string `yaml:"version"`
SchemaVersion string `yaml:"schema_version"`
MasterConnections int `yaml:"master_connections"`
ReplicaConnections int `yaml:"replica_connections"`
SearchConnections int `yaml:"search_connections"`
MasterConnectionsInUse int `yaml:"master_connections_in_use"`
MasterConnectionsIdle int `yaml:"master_connections_idle"`
MasterPoolWaitCount int64 `yaml:"master_pool_wait_count"`
MasterPoolWaitDurationMs int64 `yaml:"master_pool_wait_duration_ms"`
MasterConnectionsClosedMaxIdle int64 `yaml:"master_connections_closed_max_idle"`
MasterConnectionsClosedMaxLifetime int64 `yaml:"master_connections_closed_max_lifetime"`
ReplicaConnectionsInUse int `yaml:"replica_connections_in_use"`
ReplicaConnectionsIdle int `yaml:"replica_connections_idle"`
ReplicaPoolWaitCount int64 `yaml:"replica_pool_wait_count"`
ReplicaPoolWaitDurationMs int64 `yaml:"replica_pool_wait_duration_ms"`
ReplicaConnectionsClosedMaxIdle int64 `yaml:"replica_connections_closed_max_idle"`
ReplicaConnectionsClosedMaxLifetime int64 `yaml:"replica_connections_closed_max_lifetime"`
CacheHitRatio *float64 `yaml:"cache_hit_ratio,omitempty"`
Deadlocks *int64 `yaml:"deadlocks,omitempty"`
TempFiles *int64 `yaml:"temp_files,omitempty"`
TempBytesMB *float64 `yaml:"temp_bytes_mb,omitempty"`
Rollbacks *int64 `yaml:"rollbacks,omitempty"`
IdleInTransactionCount *int64 `yaml:"idle_in_transaction_count,omitempty"`
LongestQueryDurationSeconds *float64 `yaml:"longest_query_duration_seconds,omitempty"`
WaitingForLockCount *int64 `yaml:"waiting_for_lock_count,omitempty"`
PostsDeadTuples *int64 `yaml:"posts_dead_tuples,omitempty"`
PostsLastAutovacuum *time.Time `yaml:"posts_last_autovacuum,omitempty"`
} `yaml:"database"`
FileStore struct {
Status string `yaml:"file_status"`
Error string `yaml:"error,omitempty"`
Driver string `yaml:"file_driver"`
FilesystemType string `yaml:"filesystem_type,omitempty"`
TotalMB uint64 `yaml:"total_mb,omitempty"`
AvailableMB uint64 `yaml:"available_mb,omitempty"`
} `yaml:"file_store"`
Websocket struct {
Connections int `yaml:"connections"`
} `yaml:"websocket"`
Cluster struct {
ID string `yaml:"id"`
NumberOfNodes int `yaml:"number_of_nodes"`
} `yaml:"cluster"`
Notifications struct {
Email struct {
Status string `yaml:"status"`
Error string `yaml:"error,omitempty"`
} `yaml:"email,omitempty"`
Push struct {
Status string `yaml:"status"`
Error string `yaml:"error,omitempty"`
} `yaml:"push,omitempty"`
} `yaml:"notifications,omitempty"`
LDAP struct {
Status string `yaml:"status,omitempty"`
Error string `yaml:"error,omitempty"`
ServerName string `yaml:"server_name,omitempty"`
ServerVersion string `yaml:"server_version,omitempty"`
} `yaml:"ldap"`
SAML struct {
ProviderType string `yaml:"provider_type,omitempty"`
Status string `yaml:"status,omitempty"`
Error string `yaml:"error,omitempty"`
} `yaml:"saml"`
ElasticSearch struct {
Status string `yaml:"status,omitempty"`
Backend string `yaml:"backend,omitempty"`
ServerVersion string `yaml:"server_version,omitempty"`
ServerPlugins []string `yaml:"server_plugins,omitempty"`
Error string `yaml:"error,omitempty"`
} `yaml:"elastic"`
OAuthProviders OAuthProviders `yaml:"oauth_providers,omitempty"`
}
// OAuthProviderStatus reports the connectivity status of a single OAuth2/OpenID Connect provider.
type OAuthProviderStatus struct {
Status string `yaml:"status,omitempty"` // ok / fail / disabled
Error string `yaml:"error,omitempty"`
}
// OAuthProviders aggregates the connectivity status for the configured OAuth2/OpenID Connect providers.
type OAuthProviders struct {
GitLab OAuthProviderStatus `yaml:"gitlab,omitempty"`
Google OAuthProviderStatus `yaml:"google,omitempty"`
Office365 OAuthProviderStatus `yaml:"office365,omitempty"`
OpenID OAuthProviderStatus `yaml:"openid,omitempty"`
}
type SupportPacketStats struct {
RegisteredUsers int64 `yaml:"registered_users"`
ActiveUsers int64 `yaml:"active_users"`
DailyActiveUsers int64 `yaml:"daily_active_users"`
MonthlyActiveUsers int64 `yaml:"monthly_active_users"`
DeactivatedUsers int64 `yaml:"deactivated_users"`
Guests int64 `yaml:"guests"`
SingleChannelGuests int64 `yaml:"single_channel_guests"`
BotAccounts int64 `yaml:"bot_accounts"`
Posts int64 `yaml:"posts"`
Channels int64 `yaml:"channels"`
Teams int64 `yaml:"teams"`
SlashCommands int64 `yaml:"slash_commands"`
IncomingWebhooks int64 `yaml:"incoming_webhooks"`
OutgoingWebhooks int64 `yaml:"outgoing_webhooks"`
}
// SupportPacketJobList contains the list of latest run enterprise job runs.
// It is included in the Support Packet.
type SupportPacketJobList struct {
LDAPSyncJobs []*Job `yaml:"ldap_sync_jobs"`
DataRetentionJobs []*Job `yaml:"data_retention_jobs"`
MessageExportJobs []*Job `yaml:"message_export_jobs"`
ElasticPostIndexingJobs []*Job `yaml:"elastic_post_indexing_jobs"`
ElasticPostAggregationJobs []*Job `yaml:"elastic_post_aggregation_jobs"`
MigrationJobs []*Job `yaml:"migration_jobs"`
}
// SupportPacketPermissionInfo contains the list of schemes and the list of roles.
// It is included in the Support Packet.
type SupportPacketPermissionInfo struct {
Roles []*Role `yaml:"roles"`
Schemes []*Scheme `yaml:"schemes"`
}
// SupportPacketConfig contains the Mattermost configuration. In contrast to [Config], it also contains the list of Feature Flags.
// It is included in the Support Packet.
type SupportPacketConfig struct {
*Config
FeatureFlags FeatureFlags `json:"FeatureFlags"`
}
// SupportPacketPluginList contains the list of enabled and disabled plugins.
// It is included in the Support Packet.
type SupportPacketPluginList struct {
Enabled []Manifest `json:"enabled"`
Disabled []Manifest `json:"disabled"`
}
// SupportPacketDatabaseSchema contains the database schema information.
// It is included in the Support Packet.
type SupportPacketDatabaseSchema struct {
DatabaseCollation string `yaml:"database_collation,omitempty"`
DatabaseEncoding string `yaml:"database_encoding,omitempty"`
Tables []DatabaseTable `yaml:"tables"`
}
// DatabaseTable represents a table in the database schema.
type DatabaseTable struct {
Name string `yaml:"name"`
Collation string `yaml:"collation,omitempty"`
Options map[string]string `yaml:"options,omitempty"`
Columns []DatabaseColumn `yaml:"columns"`
Indexes []DatabaseIndex `yaml:"indexes,omitempty"`
}
// DatabaseColumn represents a column in a database table.
type DatabaseColumn struct {
Name string `yaml:"name"`
DataType string `yaml:"data_type"`
MaxLength int64 `yaml:"max_length,omitempty"`
IsNullable bool `yaml:"is_nullable"`
}
// DatabaseIndex represents an index in a database table.
type DatabaseIndex struct {
Name string `yaml:"name"`
Definition string `yaml:"definition"`
}
type FileData struct {
Filename string
Body []byte
}
type SupportPacketOptions struct {
IncludeLogs bool // IncludeLogs is the option to include server logs
PluginPackets []string // PluginPackets is a list of pluginids to call hooks
// CPUProfileDuration lets programmatic callers (e.g. tests) override how long to sample
// the CPU profile for. It is not exposed via the HTTP API.
// nil leaves the server default in place; 0 skips CPU profile generation entirely.
CPUProfileDuration *time.Duration
}