PLT-6924 Added config options to disable file uploads/downloads on mobile (#7049)
Этот коммит содержится в:
коммит произвёл
Corey Hulen
родитель
da6e6ca0bf
Коммит
3c0f082506
@@ -46,18 +46,10 @@
|
|||||||
"TimeBetweenUserTypingUpdatesMilliseconds": 5000,
|
"TimeBetweenUserTypingUpdatesMilliseconds": 5000,
|
||||||
"EnablePostSearch": true,
|
"EnablePostSearch": true,
|
||||||
"EnableUserTypingMessages": true,
|
"EnableUserTypingMessages": true,
|
||||||
"EnableUserStatuses": true,
|
|
||||||
"EnableChannelViewedMessages": true,
|
"EnableChannelViewedMessages": true,
|
||||||
|
"EnableUserStatuses": true,
|
||||||
"ClusterLogTimeoutMilliseconds": 2000
|
"ClusterLogTimeoutMilliseconds": 2000
|
||||||
},
|
},
|
||||||
"ElasticsearchSettings": {
|
|
||||||
"ConnectionUrl": "http://dockerhost:9200",
|
|
||||||
"Username": "elastic",
|
|
||||||
"Password": "changeme",
|
|
||||||
"EnableIndexing": false,
|
|
||||||
"EnableSearching": false,
|
|
||||||
"Sniff": true
|
|
||||||
},
|
|
||||||
"TeamSettings": {
|
"TeamSettings": {
|
||||||
"SiteName": "Mattermost",
|
"SiteName": "Mattermost",
|
||||||
"MaxUsersPerTeam": 50,
|
"MaxUsersPerTeam": 50,
|
||||||
@@ -112,6 +104,8 @@
|
|||||||
},
|
},
|
||||||
"FileSettings": {
|
"FileSettings": {
|
||||||
"EnableFileAttachments": true,
|
"EnableFileAttachments": true,
|
||||||
|
"EnableMobileUpload": true,
|
||||||
|
"EnableMobileDownload": true,
|
||||||
"MaxFileSize": 52428800,
|
"MaxFileSize": 52428800,
|
||||||
"DriverName": "local",
|
"DriverName": "local",
|
||||||
"Directory": "./data/",
|
"Directory": "./data/",
|
||||||
@@ -167,6 +161,9 @@
|
|||||||
"AboutLink": "https://about.mattermost.com/default-about/",
|
"AboutLink": "https://about.mattermost.com/default-about/",
|
||||||
"HelpLink": "https://about.mattermost.com/default-help/",
|
"HelpLink": "https://about.mattermost.com/default-help/",
|
||||||
"ReportAProblemLink": "https://about.mattermost.com/default-report-a-problem/",
|
"ReportAProblemLink": "https://about.mattermost.com/default-report-a-problem/",
|
||||||
|
"AdministratorsGuideLink": "https://about.mattermost.com/administrators-guide/",
|
||||||
|
"TroubleshootingForumLink": "https://about.mattermost.com/troubleshooting-forum/",
|
||||||
|
"CommercialSupportLink": "https://about.mattermost.com/commercial-support/",
|
||||||
"SupportEmail": "feedback@mattermost.com"
|
"SupportEmail": "feedback@mattermost.com"
|
||||||
},
|
},
|
||||||
"AnnouncementSettings": {
|
"AnnouncementSettings": {
|
||||||
@@ -287,6 +284,14 @@
|
|||||||
"TurnUsername": "",
|
"TurnUsername": "",
|
||||||
"TurnSharedKey": ""
|
"TurnSharedKey": ""
|
||||||
},
|
},
|
||||||
|
"ElasticsearchSettings": {
|
||||||
|
"ConnectionUrl": "http://dockerhost:9200",
|
||||||
|
"Username": "elastic",
|
||||||
|
"Password": "changeme",
|
||||||
|
"EnableIndexing": false,
|
||||||
|
"EnableSearching": false,
|
||||||
|
"Sniff": true
|
||||||
|
},
|
||||||
"DataRetentionSettings": {
|
"DataRetentionSettings": {
|
||||||
"Enable": false
|
"Enable": false
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -236,6 +236,8 @@ type PasswordSettings struct {
|
|||||||
|
|
||||||
type FileSettings struct {
|
type FileSettings struct {
|
||||||
EnableFileAttachments *bool
|
EnableFileAttachments *bool
|
||||||
|
EnableMobileUpload *bool
|
||||||
|
EnableMobileDownload *bool
|
||||||
MaxFileSize *int64
|
MaxFileSize *int64
|
||||||
DriverName string
|
DriverName string
|
||||||
Directory string
|
Directory string
|
||||||
@@ -539,6 +541,16 @@ func (o *Config) SetDefaults() {
|
|||||||
*o.FileSettings.EnableFileAttachments = true
|
*o.FileSettings.EnableFileAttachments = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if o.FileSettings.EnableMobileUpload == nil {
|
||||||
|
o.FileSettings.EnableMobileUpload = new(bool)
|
||||||
|
*o.FileSettings.EnableMobileUpload = true
|
||||||
|
}
|
||||||
|
|
||||||
|
if o.FileSettings.EnableMobileDownload == nil {
|
||||||
|
o.FileSettings.EnableMobileDownload = new(bool)
|
||||||
|
*o.FileSettings.EnableMobileDownload = true
|
||||||
|
}
|
||||||
|
|
||||||
if o.FileSettings.MaxFileSize == nil {
|
if o.FileSettings.MaxFileSize == nil {
|
||||||
o.FileSettings.MaxFileSize = new(int64)
|
o.FileSettings.MaxFileSize = new(int64)
|
||||||
*o.FileSettings.MaxFileSize = 52428800 // 50 MB
|
*o.FileSettings.MaxFileSize = 52428800 // 50 MB
|
||||||
|
|||||||
@@ -452,6 +452,8 @@ func getClientConfig(c *model.Config) map[string]string {
|
|||||||
props["SupportEmail"] = *c.SupportSettings.SupportEmail
|
props["SupportEmail"] = *c.SupportSettings.SupportEmail
|
||||||
|
|
||||||
props["EnableFileAttachments"] = strconv.FormatBool(*c.FileSettings.EnableFileAttachments)
|
props["EnableFileAttachments"] = strconv.FormatBool(*c.FileSettings.EnableFileAttachments)
|
||||||
|
props["EnableMobileFileUpload"] = strconv.FormatBool(*c.FileSettings.EnableMobileUpload)
|
||||||
|
props["EnableMobileFileDownload"] = strconv.FormatBool(*c.FileSettings.EnableMobileDownload)
|
||||||
props["EnablePublicLink"] = strconv.FormatBool(c.FileSettings.EnablePublicLink)
|
props["EnablePublicLink"] = strconv.FormatBool(c.FileSettings.EnablePublicLink)
|
||||||
|
|
||||||
props["WebsocketPort"] = fmt.Sprintf("%v", *c.ServiceSettings.WebsocketPort)
|
props["WebsocketPort"] = fmt.Sprintf("%v", *c.ServiceSettings.WebsocketPort)
|
||||||
|
|||||||
@@ -26,6 +26,8 @@ export default class StorageSettings extends AdminSettings {
|
|||||||
|
|
||||||
getConfigFromState(config) {
|
getConfigFromState(config) {
|
||||||
config.FileSettings.EnableFileAttachments = this.state.enableFileAttachments;
|
config.FileSettings.EnableFileAttachments = this.state.enableFileAttachments;
|
||||||
|
config.FileSettings.EnableMobileUpload = this.state.enableMobileUpload;
|
||||||
|
config.FileSettings.EnableMobileDownload = this.state.enableMobileDownload;
|
||||||
config.FileSettings.MaxFileSize = this.parseInt(this.state.maxFileSize) * 1024 * 1024;
|
config.FileSettings.MaxFileSize = this.parseInt(this.state.maxFileSize) * 1024 * 1024;
|
||||||
config.FileSettings.DriverName = this.state.driverName;
|
config.FileSettings.DriverName = this.state.driverName;
|
||||||
config.FileSettings.Directory = this.state.directory;
|
config.FileSettings.Directory = this.state.directory;
|
||||||
@@ -41,6 +43,8 @@ export default class StorageSettings extends AdminSettings {
|
|||||||
getStateFromConfig(config) {
|
getStateFromConfig(config) {
|
||||||
return {
|
return {
|
||||||
enableFileAttachments: config.FileSettings.EnableFileAttachments,
|
enableFileAttachments: config.FileSettings.EnableFileAttachments,
|
||||||
|
enableMobileUpload: config.FileSettings.EnableMobileUpload,
|
||||||
|
enableMobileDownload: config.FileSettings.EnableMobileDownload,
|
||||||
maxFileSize: config.FileSettings.MaxFileSize / 1024 / 1024,
|
maxFileSize: config.FileSettings.MaxFileSize / 1024 / 1024,
|
||||||
driverName: config.FileSettings.DriverName,
|
driverName: config.FileSettings.DriverName,
|
||||||
directory: config.FileSettings.Directory,
|
directory: config.FileSettings.Directory,
|
||||||
@@ -206,18 +210,54 @@ export default class StorageSettings extends AdminSettings {
|
|||||||
label={
|
label={
|
||||||
<FormattedMessage
|
<FormattedMessage
|
||||||
id='admin.file.enableFileAttachments'
|
id='admin.file.enableFileAttachments'
|
||||||
defaultMessage='Enable File Attachments:'
|
defaultMessage='Allow File Sharing:'
|
||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
helpText={
|
helpText={
|
||||||
<FormattedMessage
|
<FormattedMessage
|
||||||
id='admin.file.enableFileAttachmentsDesc'
|
id='admin.file.enableFileAttachmentsDesc'
|
||||||
defaultMessage='When false, disable file and image uploads on messages.'
|
defaultMessage='When false, disables file sharing on the server. All file and image uploads on messages are forbidden across clients and devices, including mobile.'
|
||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
value={this.state.enableFileAttachments}
|
value={this.state.enableFileAttachments}
|
||||||
onChange={this.handleChange}
|
onChange={this.handleChange}
|
||||||
/>
|
/>
|
||||||
|
<BooleanSetting
|
||||||
|
id='enableMobileUpload'
|
||||||
|
label={
|
||||||
|
<FormattedMessage
|
||||||
|
id='admin.file.enableMobileUploadTitle'
|
||||||
|
defaultMessage='Allow File Uploads on Mobile:'
|
||||||
|
/>
|
||||||
|
}
|
||||||
|
helpText={
|
||||||
|
<FormattedMessage
|
||||||
|
id='admin.file.enableMobileUploadDesc'
|
||||||
|
defaultMessage='When false, disables file uploads on mobile apps. If Allow File Sharing is set to true, users can still upload files from a mobile web browser.'
|
||||||
|
/>
|
||||||
|
}
|
||||||
|
value={this.state.enableMobileUpload}
|
||||||
|
onChange={this.handleChange}
|
||||||
|
disabled={!this.state.enableFileAttachments}
|
||||||
|
/>
|
||||||
|
<BooleanSetting
|
||||||
|
id='enableMobileDownload'
|
||||||
|
label={
|
||||||
|
<FormattedMessage
|
||||||
|
id='admin.file.enableMobileDownloadTitle'
|
||||||
|
defaultMessage='Allow File Downloads on Mobile:'
|
||||||
|
/>
|
||||||
|
}
|
||||||
|
helpText={
|
||||||
|
<FormattedMessage
|
||||||
|
id='admin.file.enableMobileDownloadDesc'
|
||||||
|
defaultMessage='When false, disables file downloads on mobile apps. Users can still download files from a mobile web browser.'
|
||||||
|
/>
|
||||||
|
}
|
||||||
|
value={this.state.enableMobileDownload}
|
||||||
|
onChange={this.handleChange}
|
||||||
|
disabled={!this.state.enableFileAttachments}
|
||||||
|
/>
|
||||||
<TextSetting
|
<TextSetting
|
||||||
id='maxFileSize'
|
id='maxFileSize'
|
||||||
label={
|
label={
|
||||||
|
|||||||
@@ -323,8 +323,12 @@
|
|||||||
"admin.email.smtpUsernameTitle": "SMTP Server Username:",
|
"admin.email.smtpUsernameTitle": "SMTP Server Username:",
|
||||||
"admin.email.testing": "Testing...",
|
"admin.email.testing": "Testing...",
|
||||||
"admin.false": "false",
|
"admin.false": "false",
|
||||||
"admin.file.enableFileAttachments": "Enable File Attachments:",
|
"admin.file.enableFileAttachments": "Allow File Sharing:",
|
||||||
"admin.file.enableFileAttachmentsDesc": "When false, disable file and image uploads on messages.",
|
"admin.file.enableFileAttachmentsDesc": "When false, disables file sharing on the server. All file and image uploads on messages are forbidden across clients and devices, including mobile.",
|
||||||
|
"admin.file.enableMobileDownloadDesc": "When false, disables file downloads on mobile apps. Users can still download files from a mobile web browser.",
|
||||||
|
"admin.file.enableMobileDownloadTitle": "Allow File Downloads on Mobile:",
|
||||||
|
"admin.file.enableMobileUploadDesc": "When false, disables file uploads on mobile apps. If Allow File Sharing is set to true, users can still upload files from a mobile web browser.",
|
||||||
|
"admin.file.enableMobileUploadTitle": "Allow File Uploads on Mobile:",
|
||||||
"admin.file_upload.chooseFile": "Choose File",
|
"admin.file_upload.chooseFile": "Choose File",
|
||||||
"admin.file_upload.noFile": "No file uploaded",
|
"admin.file_upload.noFile": "No file uploaded",
|
||||||
"admin.file_upload.uploadFile": "Upload",
|
"admin.file_upload.uploadFile": "Upload",
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user