Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions e2e-tests/playwright/lib/src/server/default_config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -844,17 +844,12 @@ const defaultServerConfig: AdminConfig = {
AutoTranslationSettings: {
Enable: false,
Provider: '',
TargetLanguages: ['en'],
TimeoutsMs: {
Short: 1200,
Medium: 2500,
Long: 6000,
Notification: 300,
},
LibreTranslate: {
URL: '',
APIKey: '',
},
TargetLanguages: ['en'],
TimeoutMs: 5000,
Agents: {
LLMServiceID: '',
},
Expand Down
8 changes: 7 additions & 1 deletion server/channels/api4/apitestlib.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,13 @@ func setupTestHelper(tb testing.TB, dbStore store.Store, sqlSettings *model.SqlS
consoleLevel = mlog.LvlStdLog.Name
}
*memoryConfig.LogSettings.ConsoleLevel = consoleLevel
*memoryConfig.LogSettings.FileLocation = filepath.Join(tempWorkspace, "logs", "mattermost.log")
// Use a subdirectory within the logging root (from MM_LOG_PATH or default)
// to ensure the path is within the allowed logging root for security validation.
// Each test gets its own subdirectory based on the tempWorkspace name for isolation.
testLogsDir := filepath.Join(config.GetLogRootPath(), filepath.Base(tempWorkspace))
err = os.MkdirAll(testLogsDir, 0700)
require.NoError(tb, err, "failed to create test logs directory")
*memoryConfig.LogSettings.FileLocation = testLogsDir
*memoryConfig.AnnouncementSettings.AdminNoticesEnabled = false
*memoryConfig.AnnouncementSettings.UserNoticesEnabled = false
*memoryConfig.PluginSettings.AutomaticPrepackagedPlugins = false
Expand Down
9 changes: 9 additions & 0 deletions server/channels/api4/system.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ func generateSupportPacket(c *Context, w http.ResponseWriter, r *http.Request) {
return
}

auditRec := c.MakeAuditRecord(model.AuditEventGenerateSupportPacket, model.AuditStatusFail)
defer c.LogAuditRec(auditRec)

// We support the existing API hence the logs are always included
// if nothing specified.
includeLogs := true
Expand All @@ -98,6 +101,9 @@ func generateSupportPacket(c *Context, w http.ResponseWriter, r *http.Request) {
PluginPackets: r.Form["plugin_packets"],
}

auditRec.AddMeta("include_logs", supportPacketOptions.IncludeLogs)
auditRec.AddMeta("plugin_packets", supportPacketOptions.PluginPackets)

// Checking to see if the server has a e10 or e20 license (this feature is only permitted for servers with licenses)
if c.App.Channels().License() == nil {
c.Err = model.NewAppError("Api4.generateSupportPacket", "api.no_license", nil, "", http.StatusForbidden)
Expand All @@ -117,6 +123,9 @@ func generateSupportPacket(c *Context, w http.ResponseWriter, r *http.Request) {
return
}

auditRec.Success()
auditRec.AddMeta("filename", outputZipFilename)

// Prevent caching so support packets are always fresh
w.Header().Set("Cache-Control", "no-cache, no-store, must-revalidate")

Expand Down
Loading
Loading