PLT-2115 adding compliance interfaces
Этот коммит содержится в:
20
einterfaces/compliance.go
Обычный файл
20
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
|
||||
}
|
||||
16
i18n/en.json
16
i18n/en.json
@@ -1775,6 +1775,22 @@
|
||||
"id": "mattermost.security_bulletin_read.error",
|
||||
"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"
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Ссылка в новой задаче
Block a user