summaryrefslogtreecommitdiffstats
path: root/model/config.go
diff options
context:
space:
mode:
Diffstat (limited to 'model/config.go')
-rw-r--r--model/config.go21
1 files changed, 4 insertions, 17 deletions
diff --git a/model/config.go b/model/config.go
index ac1d034d4..544f9b33f 100644
--- a/model/config.go
+++ b/model/config.go
@@ -8,7 +8,6 @@ import (
"io"
"net/http"
"net/url"
- "path/filepath"
"strings"
"time"
)
@@ -25,6 +24,10 @@ const (
DATABASE_DRIVER_MYSQL = "mysql"
DATABASE_DRIVER_POSTGRES = "postgres"
+ MINIO_ACCESS_KEY = "minioaccesskey"
+ MINIO_SECRET_KEY = "miniosecretkey"
+ MINIO_BUCKET = "mattermost-test"
+
PASSWORD_MAXIMUM_LENGTH = 64
PASSWORD_MINIMUM_LENGTH = 5
@@ -1523,7 +1526,6 @@ type MessageExportSettings struct {
EnableExport *bool
DailyRunTime *string
ExportFromTimestamp *int64
- FileLocation *string
BatchSize *int
}
@@ -1532,10 +1534,6 @@ func (s *MessageExportSettings) SetDefaults() {
s.EnableExport = NewBool(false)
}
- if s.FileLocation == nil {
- s.FileLocation = NewString("export")
- }
-
if s.DailyRunTime == nil {
s.DailyRunTime = NewString("01:00")
}
@@ -2064,19 +2062,8 @@ func (mes *MessageExportSettings) isValid(fs FileSettings) *AppError {
return NewAppError("Config.IsValid", "model.config.is_valid.message_export.daily_runtime.app_error", nil, "", http.StatusBadRequest)
} else if _, err := time.Parse("15:04", *mes.DailyRunTime); err != nil {
return NewAppError("Config.IsValid", "model.config.is_valid.message_export.daily_runtime.app_error", nil, err.Error(), http.StatusBadRequest)
- } else if mes.FileLocation == nil {
- return NewAppError("Config.IsValid", "model.config.is_valid.message_export.file_location.app_error", nil, "", http.StatusBadRequest)
} else if mes.BatchSize == nil || *mes.BatchSize < 0 {
return NewAppError("Config.IsValid", "model.config.is_valid.message_export.batch_size.app_error", nil, "", http.StatusBadRequest)
- } else if *fs.DriverName != IMAGE_DRIVER_LOCAL {
- if absFileDir, err := filepath.Abs(fs.Directory); err != nil {
- return NewAppError("Config.IsValid", "model.config.is_valid.message_export.file_location.relative", nil, err.Error(), http.StatusBadRequest)
- } else if absMessageExportDir, err := filepath.Abs(*mes.FileLocation); err != nil {
- return NewAppError("Config.IsValid", "model.config.is_valid.message_export.file_location.relative", nil, err.Error(), http.StatusBadRequest)
- } else if !strings.HasPrefix(absMessageExportDir, absFileDir) {
- // configured export directory must be relative to data directory
- return NewAppError("Config.IsValid", "model.config.is_valid.message_export.file_location.relative", nil, "", http.StatusBadRequest)
- }
}
}
return nil