Disambiguates some units. (#19875)
* Disambiguates some units. * Updates DB attribute. * Updates some more error-prone units. * Updates some tests with legible constants. * Updates query for MySQL case sensitivity. * Fixes more casing issues. Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
@@ -275,15 +275,16 @@ var ServerTLSSupportedCiphers = map[string]uint16{
|
||||
}
|
||||
|
||||
type ServiceSettings struct {
|
||||
SiteURL *string `access:"environment_web_server,authentication_saml,write_restrictable"`
|
||||
WebsocketURL *string `access:"write_restrictable,cloud_restrictable"`
|
||||
LicenseFileLocation *string `access:"write_restrictable,cloud_restrictable"` // telemetry: none
|
||||
ListenAddress *string `access:"environment_web_server,write_restrictable,cloud_restrictable"` // telemetry: none
|
||||
ConnectionSecurity *string `access:"environment_web_server,write_restrictable,cloud_restrictable"`
|
||||
TLSCertFile *string `access:"environment_web_server,write_restrictable,cloud_restrictable"`
|
||||
TLSKeyFile *string `access:"environment_web_server,write_restrictable,cloud_restrictable"`
|
||||
TLSMinVer *string `access:"write_restrictable,cloud_restrictable"` // telemetry: none
|
||||
TLSStrictTransport *bool `access:"write_restrictable,cloud_restrictable"`
|
||||
SiteURL *string `access:"environment_web_server,authentication_saml,write_restrictable"`
|
||||
WebsocketURL *string `access:"write_restrictable,cloud_restrictable"`
|
||||
LicenseFileLocation *string `access:"write_restrictable,cloud_restrictable"` // telemetry: none
|
||||
ListenAddress *string `access:"environment_web_server,write_restrictable,cloud_restrictable"` // telemetry: none
|
||||
ConnectionSecurity *string `access:"environment_web_server,write_restrictable,cloud_restrictable"`
|
||||
TLSCertFile *string `access:"environment_web_server,write_restrictable,cloud_restrictable"`
|
||||
TLSKeyFile *string `access:"environment_web_server,write_restrictable,cloud_restrictable"`
|
||||
TLSMinVer *string `access:"write_restrictable,cloud_restrictable"` // telemetry: none
|
||||
TLSStrictTransport *bool `access:"write_restrictable,cloud_restrictable"`
|
||||
// In seconds.
|
||||
TLSStrictTransportMaxAge *int64 `access:"write_restrictable,cloud_restrictable"` // telemetry: none
|
||||
TLSOverwriteCiphers []string `access:"write_restrictable,cloud_restrictable"` // telemetry: none
|
||||
UseLetsEncrypt *bool `access:"environment_web_server,write_restrictable,cloud_restrictable"`
|
||||
@@ -1884,17 +1885,18 @@ func (s *ThemeSettings) SetDefaults() {
|
||||
}
|
||||
|
||||
type TeamSettings struct {
|
||||
SiteName *string `access:"site_customization"`
|
||||
MaxUsersPerTeam *int `access:"site_users_and_teams"`
|
||||
EnableUserCreation *bool `access:"authentication_signup"`
|
||||
EnableOpenServer *bool `access:"authentication_signup"`
|
||||
EnableUserDeactivation *bool `access:"experimental_features"`
|
||||
RestrictCreationToDomains *string `access:"authentication_signup"` // telemetry: none
|
||||
EnableCustomUserStatuses *bool `access:"site_users_and_teams"`
|
||||
EnableCustomBrand *bool `access:"site_customization"`
|
||||
CustomBrandText *string `access:"site_customization"`
|
||||
CustomDescriptionText *string `access:"site_customization"`
|
||||
RestrictDirectMessage *string `access:"site_users_and_teams"`
|
||||
SiteName *string `access:"site_customization"`
|
||||
MaxUsersPerTeam *int `access:"site_users_and_teams"`
|
||||
EnableUserCreation *bool `access:"authentication_signup"`
|
||||
EnableOpenServer *bool `access:"authentication_signup"`
|
||||
EnableUserDeactivation *bool `access:"experimental_features"`
|
||||
RestrictCreationToDomains *string `access:"authentication_signup"` // telemetry: none
|
||||
EnableCustomUserStatuses *bool `access:"site_users_and_teams"`
|
||||
EnableCustomBrand *bool `access:"site_customization"`
|
||||
CustomBrandText *string `access:"site_customization"`
|
||||
CustomDescriptionText *string `access:"site_customization"`
|
||||
RestrictDirectMessage *string `access:"site_users_and_teams"`
|
||||
// In seconds.
|
||||
UserStatusAwayTimeout *int64 `access:"experimental_features"`
|
||||
MaxChannelsPerTeam *int64 `access:"site_users_and_teams"`
|
||||
MaxNotificationsPerChannel *int64 `access:"environment_push_notification_server"`
|
||||
|
||||
@@ -13,9 +13,9 @@ type GlobalRetentionPolicy struct {
|
||||
}
|
||||
|
||||
type RetentionPolicy struct {
|
||||
ID string `db:"Id" json:"id"`
|
||||
DisplayName string `json:"display_name"`
|
||||
PostDuration *int64 `json:"post_duration"`
|
||||
ID string `db:"Id" json:"id"`
|
||||
DisplayName string `json:"display_name"`
|
||||
PostDurationDays *int64 `db:"PostDuration" json:"post_duration"`
|
||||
}
|
||||
|
||||
type RetentionPolicyWithTeamAndChannelIDs struct {
|
||||
@@ -46,8 +46,8 @@ type RetentionPolicyWithTeamAndChannelCountsList struct {
|
||||
}
|
||||
|
||||
type RetentionPolicyForTeam struct {
|
||||
TeamID string `db:"Id" json:"team_id"`
|
||||
PostDuration int64 `json:"post_duration"`
|
||||
TeamID string `db:"Id" json:"team_id"`
|
||||
PostDurationDays int64 `db:"PostDuration" json:"post_duration"`
|
||||
}
|
||||
|
||||
type RetentionPolicyForTeamList struct {
|
||||
@@ -56,8 +56,8 @@ type RetentionPolicyForTeamList struct {
|
||||
}
|
||||
|
||||
type RetentionPolicyForChannel struct {
|
||||
ChannelID string `db:"Id" json:"channel_id"`
|
||||
PostDuration int64 `json:"post_duration"`
|
||||
ChannelID string `db:"Id" json:"channel_id"`
|
||||
PostDurationDays int64 `db:"PostDuration" json:"post_duration"`
|
||||
}
|
||||
|
||||
type RetentionPolicyForChannelList struct {
|
||||
|
||||
@@ -11,9 +11,12 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
DayInSeconds = 24 * 60 * 60
|
||||
DayInMilliseconds = DayInSeconds * 1000
|
||||
|
||||
ExpiredLicenseError = "api.license.add_license.expired.app_error"
|
||||
InvalidLicenseError = "api.license.add_license.invalid.app_error"
|
||||
LicenseGracePeriod = 1000 * 60 * 60 * 24 * 10 //10 days
|
||||
LicenseGracePeriod = DayInMilliseconds * 10 //10 days
|
||||
LicenseRenewalLink = "https://mattermost.com/renew/"
|
||||
|
||||
LicenseShortSkuE10 = "E10"
|
||||
@@ -307,7 +310,7 @@ func (l *License) HasEnterpriseMarketplacePlugins() bool {
|
||||
// NewTestLicense returns a license that expires in the future and has the given features.
|
||||
func NewTestLicense(features ...string) *License {
|
||||
ret := &License{
|
||||
ExpiresAt: GetMillis() + 90*24*60*60*1000,
|
||||
ExpiresAt: GetMillis() + 90*DayInMilliseconds,
|
||||
Customer: &Customer{},
|
||||
Features: &Features{},
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user