diff options
-rw-r--r-- | einterfaces/compliance.go | 20 | ||||
-rw-r--r-- | i18n/en.json | 16 | ||||
-rw-r--r-- | mattermost.go | 5 | ||||
-rw-r--r-- | model/system.go | 9 |
4 files changed, 46 insertions, 4 deletions
diff --git a/einterfaces/compliance.go b/einterfaces/compliance.go new file mode 100644 index 000000000..136f9a4d3 --- /dev/null +++ b/einterfaces/compliance.go @@ -0,0 +1,20 @@ +// Copyright (c) 2015 Mattermost, Inc. All Rights Reserved. +// See License.txt for license information. + +package einterfaces + +import () + +type ComplianceInterface interface { + StartComplianceJob() +} + +var theComplianceInterface ComplianceInterface + +func RegisterComplianceInterface(newInterface ComplianceInterface) { + theComplianceInterface = newInterface +} + +func GetComplianceInterface() ComplianceInterface { + return theComplianceInterface +} diff --git a/i18n/en.json b/i18n/en.json index 20d997af7..6eebb02c4 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -1776,6 +1776,22 @@ "translation": "Failed to read security bulletin details" }, { + "id": "mattermost.compliance_init.info", + "translation": "Compliance running for the first time initializing to yesterday" + }, + { + "id": "mattermost.compliance_run.info", + "translation": "Compliance export started for {{.Time}}" + }, + { + "id": "mattermost.compliance_run_fail.error", + "translation": "Compliance export failed for {{.Time}} with err='{{.Error}}'" + }, + { + "id": "mattermost.compliance_run_finish.info", + "translation": "Compliance export finished writing {{.Count}} items to {{.Filename}}" + }, + { "id": "mattermost.security_checks.debug", "translation": "Checking for security update from Mattermost" }, diff --git a/mattermost.go b/mattermost.go index 45ffcc88f..21620c539 100644 --- a/mattermost.go +++ b/mattermost.go @@ -19,6 +19,7 @@ import ( l4g "github.com/alecthomas/log4go" "github.com/mattermost/platform/api" + "github.com/mattermost/platform/einterfaces" "github.com/mattermost/platform/manualtesting" "github.com/mattermost/platform/model" "github.com/mattermost/platform/utils" @@ -91,6 +92,10 @@ func main() { setDiagnosticId() runSecurityAndDiagnosticsJobAndForget() + if einterfaces.GetComplianceInterface() != nil { + einterfaces.GetComplianceInterface().StartComplianceJob() + } + // wait for kill signal before attempting to gracefully shutdown // the running service c := make(chan os.Signal) diff --git a/model/system.go b/model/system.go index b387749f6..68d542c15 100644 --- a/model/system.go +++ b/model/system.go @@ -9,10 +9,11 @@ import ( ) const ( - SYSTEM_DIAGNOSTIC_ID = "DiagnosticId" - SYSTEM_RAN_UNIT_TESTS = "RanUnitTests" - SYSTEM_LAST_SECURITY_TIME = "LastSecurityTime" - SYSTEM_ACTIVE_LICENSE_ID = "ActiveLicenseId" + SYSTEM_DIAGNOSTIC_ID = "DiagnosticId" + SYSTEM_RAN_UNIT_TESTS = "RanUnitTests" + SYSTEM_LAST_SECURITY_TIME = "LastSecurityTime" + SYSTEM_ACTIVE_LICENSE_ID = "ActiveLicenseId" + SYSTEM_LAST_COMPLIANCE_TIME = "LastComplianceTime" ) type System struct { |