Skip to content

Commit 417e5db

Browse files
authored
Merge pull request #1063 from signal18/mattermost
Mattermost
2 parents ceca862 + f070344 commit 417e5db

File tree

44 files changed

+5669
-353
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+5669
-353
lines changed

cluster/cluster_set.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2000,6 +2000,14 @@ func (cluster *Cluster) SetLogGitLevel(value int) {
20002000
cluster.Conf.LogGit = false
20012001
}
20022002
}
2003+
func (cluster *Cluster) SetLogSupportLevel(value int) {
2004+
cluster.Conf.LogSupportLevel = value
2005+
if value > 0 {
2006+
cluster.Conf.LogSupport = true
2007+
} else {
2008+
cluster.Conf.LogSupport = false
2009+
}
2010+
}
20032011
func (cluster *Cluster) SetLogBackupStreamLevel(value int) {
20042012
cluster.Conf.LogBackupStreamLevel = value
20052013
if value > 0 {

cluster/cluster_tgl.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -519,6 +519,15 @@ func (cluster *Cluster) SwitchLogGit() {
519519
cluster.Conf.LogGit = !cluster.Conf.LogGit
520520
}
521521

522+
func (cluster *Cluster) SwitchLogSupport() {
523+
if cluster.Conf.LogSupport {
524+
cluster.Conf.LogSupportLevel = 0
525+
} else {
526+
cluster.Conf.LogSupportLevel = 1
527+
}
528+
cluster.Conf.LogSupport = !cluster.Conf.LogSupport
529+
}
530+
522531
func (cluster *Cluster) SwitchLogBackupStream() {
523532
if cluster.Conf.LogBackupStream {
524533
cluster.Conf.LogBackupStreamLevel = 0

config/config.go

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,8 @@ type Config struct {
144144
LogBinlogPurgeLevel int `mapstructure:"log-binlog-purge-level" toml:"log-binlog-purge-level" json:"logBinlogPurgeLevel"`
145145
LogArchiveLevel int `mapstructure:"log-archive-level" toml:"log-archive-level" json:"logArchiveLevel"`
146146
LogMailerLevel int `mapstructure:"log-mailer-level" toml:"log-mailer-level" json:"logMailerLevel"`
147+
LogSupport bool `scope:"server" mapstructure:"log-support" toml:"log-support" json:"logSupport"`
148+
LogSupportLevel int `scope:"server" mapstructure:"log-support-level" toml:"log-support-level" json:"logSupportLevel"`
147149
User string `mapstructure:"db-servers-credential" toml:"db-servers-credential" json:"dbServersCredential"`
148150
Hosts string `mapstructure:"db-servers-hosts" toml:"db-servers-hosts" json:"dbServersHosts"`
149151
DbServersChangeStateScript string `mapstructure:"db-servers-state-change-script" toml:"db-servers-state-change-script" json:"dbServersStateChangeScript"`
@@ -1193,6 +1195,7 @@ const (
11931195
ConstLogModTask = 17
11941196
ConstLogModArchive = 18
11951197
ConstLogModMailer = 19
1198+
ConstLogModSupport = 20
11961199
)
11971200

11981201
/*
@@ -1302,7 +1305,8 @@ func (conf *Config) DecryptSecretsFromConfig() {
13021305
"cloud18-dba-user-credentials": {"", ""},
13031306
"cloud18-sponsor-user-credentials": {"", ""},
13041307
"vault-token": {"", ""},
1305-
"api-oauth-client-secret": {"", ""}}
1308+
"api-oauth-client-secret": {"", ""},
1309+
"meet-token": {"", ""}}
13061310

13071311
for k := range conf.Secrets {
13081312

@@ -3046,6 +3050,8 @@ func (conf *Config) IsEligibleForPrinting(module int, level string) bool {
30463050
return conf.LogArchiveLevel >= lvl
30473051
case module == ConstLogModMailer:
30483052
return conf.LogMailerLevel >= lvl
3053+
case module == ConstLogModSupport:
3054+
return conf.LogSupportLevel >= lvl
30493055
}
30503056
}
30513057

@@ -3320,6 +3326,15 @@ func (conf *Config) SetLogGitLevel(value int) {
33203326
}
33213327
}
33223328

3329+
func (conf *Config) SetLogSupportLevel(value int) {
3330+
conf.LogSupportLevel = value
3331+
if value > 0 {
3332+
conf.LogSupport = true
3333+
} else {
3334+
conf.LogSupport = false
3335+
}
3336+
}
3337+
33233338
func (conf *Config) GetImmutableChecksum() (hash.Hash, error) {
33243339
new_h := md5.New()
33253340

go.mod

Lines changed: 55 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,23 @@ replace github.com/kahing/goofys => github.com/georgyo/goofys v0.21.0
99
replace github.com/siddontang/go-mysql-org/go-mysql => github.com/go-mysql-org/go-mysql v1.7.0
1010

1111
require (
12-
github.com/Azure/azure-pipeline-go v0.2.2
12+
github.com/Azure/azure-pipeline-go v0.2.3
1313
github.com/Azure/azure-sdk-for-go v44.0.0+incompatible
14-
github.com/Azure/azure-storage-blob-go v0.8.0
14+
github.com/Azure/azure-storage-blob-go v0.14.0
1515
github.com/Azure/go-autorest/autorest v0.11.1
16-
github.com/Azure/go-autorest/autorest/adal v0.9.5
16+
github.com/Azure/go-autorest/autorest/adal v0.9.14
1717
github.com/Azure/go-autorest/autorest/azure/auth v0.5.0
1818
github.com/Azure/go-autorest/autorest/azure/cli v0.4.0
1919
github.com/BurntSushi/toml v0.3.1
2020
github.com/JaderDias/movingmedian v0.0.0-20170611140316-de8c410559fa
2121
github.com/NYTimes/gziphandler v1.0.1
2222
github.com/alyu/configparser v0.0.0-20151125021232-26b2fe18bee1
2323
github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a
24-
github.com/aws/aws-sdk-go v1.34.0
24+
github.com/aws/aws-sdk-go v1.43.31
2525
github.com/bluele/logrus_slack v0.0.0-20170812021752-74aa3c9b7cc3
2626
github.com/bradfitz/gomemcache v0.0.0-20170208213004-1952afaa557d
2727
github.com/codegangsta/negroni v0.3.0
28+
github.com/creack/pty v1.1.24
2829
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc
2930
github.com/dgryski/carbonzipper v0.0.0-20170426152955-d1a3cec4169b
3031
github.com/dgryski/go-expirecache v0.0.0-20170314133854-743ef98b2adb
@@ -39,7 +40,7 @@ require (
3940
github.com/gogo/protobuf v1.3.2
4041
github.com/gonum/matrix v0.0.0-20180124231301-a41cc49d4c29
4142
github.com/google/uuid v1.6.0
42-
github.com/gorilla/handlers v1.3.0
43+
github.com/gorilla/handlers v1.5.1
4344
github.com/gorilla/mux v1.8.0
4445
github.com/gorilla/websocket v1.5.0
4546
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0
@@ -52,14 +53,16 @@ require (
5253
github.com/improbable-eng/grpc-web v0.14.0
5354
github.com/iu0v1/gelada v1.2.2
5455
github.com/jacobsa/fuse v0.0.0-20211125163655-ffd6c474e806
55-
github.com/jmoiron/sqlx v1.3.3
56+
github.com/jmoiron/sqlx v1.3.4
57+
github.com/jordan-wright/email v4.0.1-0.20210109023952-943e75fe5223+incompatible
5658
github.com/juju/errors v0.0.0-20220203013757-bd733f3c86b9
5759
github.com/kisielk/og-rek v0.0.0-20170425174049-dd41cde712de
5860
github.com/klauspost/compress v1.15.9
5961
github.com/lestrrat/go-file-rotatelogs v0.0.0-20171229092148-f984502973a0
6062
github.com/lestrrat/go-strftime v0.0.0-20170113112000-04ef93e28531
61-
github.com/lib/pq v1.3.0
63+
github.com/lib/pq v1.10.4
6264
github.com/magneticio/vamp-router v0.0.0-20151116102511-29379b621548
65+
github.com/mattermost/mattermost-server/v6 v6.7.2
6366
github.com/micro/go-micro v0.27.1
6467
github.com/mitchellh/go-homedir v1.1.0
6568
github.com/mjibson/go-dsp v0.0.0-20170104183934-49dba8372707
@@ -73,9 +76,9 @@ require (
7376
github.com/siddontang/go-mysql v0.0.0-20190311123328-7fc3b28d6104
7477
github.com/siddontang/go-mysql-elasticsearch v0.0.0-20180201161913-f34f371d4391
7578
github.com/sirupsen/logrus v1.9.0
76-
github.com/spf13/cobra v0.0.6
79+
github.com/spf13/cobra v1.4.0
7780
github.com/spf13/pflag v1.0.5
78-
github.com/spf13/viper v1.4.0
81+
github.com/spf13/viper v1.8.1
7982
github.com/stretchr/testify v1.10.0
8083
github.com/swaggo/http-swagger v1.3.4
8184
github.com/swaggo/swag v1.16.4
@@ -91,7 +94,7 @@ require (
9194
google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0
9295
google.golang.org/protobuf v1.34.2
9396
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c
94-
gopkg.in/ini.v1 v1.55.0
97+
gopkg.in/ini.v1 v1.66.4
9598
gopkg.in/natefinch/lumberjack.v2 v2.0.0
9699
k8s.io/api v0.31.3
97100
k8s.io/apimachinery v0.31.3
@@ -102,26 +105,31 @@ require (
102105
dario.cat/mergo v1.0.0 // indirect
103106
github.com/Azure/go-autorest v14.2.0+incompatible // indirect
104107
github.com/Azure/go-autorest/autorest/date v0.3.0 // indirect
105-
github.com/Azure/go-autorest/logger v0.2.0 // indirect
108+
github.com/Azure/go-autorest/logger v0.2.1 // indirect
106109
github.com/Azure/go-autorest/tracing v0.6.0 // indirect
107110
github.com/DATA-DOG/go-sqlmock v1.4.1 // indirect
108111
github.com/KyleBanks/depth v1.2.1 // indirect
109112
github.com/Microsoft/go-winio v0.6.1 // indirect
110113
github.com/ProtonMail/go-crypto v1.1.5 // indirect
114+
github.com/blang/semver v3.5.1+incompatible // indirect
111115
github.com/cenkalti/backoff/v3 v3.0.0 // indirect
112116
github.com/cloudflare/circl v1.3.7 // indirect
113117
github.com/coreos/go-semver v0.3.0 // indirect
114-
github.com/cpuguy83/go-md2man/v2 v2.0.0 // indirect
115-
github.com/creack/pty v1.1.24 // indirect
118+
github.com/cpuguy83/go-md2man/v2 v2.0.1 // indirect
116119
github.com/cyphar/filepath-securejoin v0.3.6 // indirect
120+
github.com/creack/pty v1.1.24 // indirect
117121
github.com/dimchansky/utfbom v1.1.0 // indirect
122+
github.com/dyatlov/go-opengraph v0.0.0-20210112100619-dae8665a5b09 // indirect
118123
github.com/emicklei/go-restful/v3 v3.11.0 // indirect
119124
github.com/emirpasic/gods v1.18.1 // indirect
120125
github.com/fatih/color v1.16.0 // indirect
121-
github.com/form3tech-oss/jwt-go v3.2.2+incompatible // indirect
122-
github.com/fsnotify/fsnotify v1.4.9 // indirect
126+
github.com/felixge/httpsnoop v1.0.2 // indirect
127+
github.com/form3tech-oss/jwt-go v3.2.5+incompatible // indirect
128+
github.com/francoispqt/gojay v1.2.13 // indirect
129+
github.com/fsnotify/fsnotify v1.5.1 // indirect
123130
github.com/fxamacker/cbor/v2 v2.7.0 // indirect
124131
github.com/gertd/go-pluralize v0.1.1 // indirect
132+
github.com/go-asn1-ber/asn1-ber v1.5.3 // indirect
125133
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect
126134
github.com/go-git/go-billy/v5 v5.6.2 // indirect
127135
github.com/go-jose/go-jose/v3 v3.0.3 // indirect
@@ -136,42 +144,50 @@ require (
136144
github.com/google/gnostic-models v0.6.8 // indirect
137145
github.com/google/go-cmp v0.6.0 // indirect
138146
github.com/google/gofuzz v1.2.0 // indirect
147+
github.com/graph-gophers/graphql-go v1.3.0 // indirect
139148
github.com/hashicorp/errwrap v1.1.0 // indirect
140149
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
141150
github.com/hashicorp/go-hclog v1.6.3 // indirect
142151
github.com/hashicorp/go-multierror v1.1.1 // indirect
143-
github.com/hashicorp/go-plugin v1.0.1 // indirect
152+
github.com/hashicorp/go-plugin v1.4.3 // indirect
144153
github.com/hashicorp/go-rootcerts v1.0.2 // indirect
145154
github.com/hashicorp/go-secure-stdlib/parseutil v0.1.6 // indirect
146155
github.com/hashicorp/go-secure-stdlib/strutil v0.1.2 // indirect
147156
github.com/hashicorp/go-sockaddr v1.0.2 // indirect
148157
github.com/hashicorp/hcl v1.0.0 // indirect
149-
github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb // indirect
158+
github.com/hashicorp/yamux v0.0.0-20211028200310-0bc27b27de87 // indirect
150159
github.com/inconshreveable/mousetrap v1.0.0 // indirect
151160
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
152-
github.com/jmespath/go-jmespath v0.3.0 // indirect
153-
github.com/jordan-wright/email v4.0.1-0.20210109023952-943e75fe5223+incompatible // indirect
161+
github.com/jmespath/go-jmespath v0.4.0 // indirect
154162
github.com/josharian/intern v1.0.0 // indirect
155163
github.com/json-iterator/go v1.1.12 // indirect
156164
github.com/kevinburke/ssh_config v1.2.0 // indirect
165+
github.com/klauspost/cpuid/v2 v2.2.4 // indirect
157166
github.com/kr/fs v0.1.0 // indirect
158167
github.com/kr/pretty v0.3.1 // indirect
159168
github.com/kr/text v0.2.0 // indirect
160-
github.com/magiconair/properties v1.8.0 // indirect
169+
github.com/magiconair/properties v1.8.5 // indirect
161170
github.com/mailru/easyjson v0.9.0 // indirect
171+
github.com/mattermost/go-i18n v1.11.1-0.20211013152124-5c415071e404 // indirect
172+
github.com/mattermost/ldap v0.0.0-20201202150706-ee0e6284187d // indirect
173+
github.com/mattermost/logr/v2 v2.0.15 // indirect
162174
github.com/mattn/go-colorable v0.1.13 // indirect
163-
github.com/mattn/go-ieproxy v0.0.0-20190702010315-6dee0af9227d // indirect
175+
github.com/mattn/go-ieproxy v0.0.1 // indirect
164176
github.com/mattn/go-isatty v0.0.20 // indirect
165-
github.com/mattn/go-sqlite3 v1.14.14 // indirect
166-
github.com/mattn/go-tty v0.0.7 // indirect
167177
github.com/micro/mdns v0.1.0 // indirect
168-
github.com/mitchellh/go-testing-interface v0.0.0-20171004221916-a61a99592b77 // indirect
178+
github.com/minio/md5-simd v1.1.2 // indirect
179+
github.com/minio/minio-go/v7 v7.0.24 // indirect
180+
github.com/minio/sha256-simd v1.0.0 // indirect
181+
github.com/mitchellh/go-testing-interface v1.14.1 // indirect
169182
github.com/mitchellh/hashstructure v1.0.0 // indirect
170183
github.com/mitchellh/mapstructure v1.5.0 // indirect
171184
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
172185
github.com/modern-go/reflect2 v1.0.2 // indirect
173186
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
174-
github.com/oklog/run v1.0.0 // indirect
187+
github.com/oklog/run v1.1.0 // indirect
188+
github.com/opentracing/opentracing-go v1.2.0 // indirect
189+
github.com/pborman/uuid v1.2.1 // indirect
190+
github.com/philhofer/fwd v1.1.1 // indirect
175191
github.com/pingcap/errors v0.11.5-0.20210425183316-da1aaba5fb63 // indirect
176192
github.com/pingcap/log v0.0.0-20210625125904-98ed8e2eb1c7 // indirect
177193
github.com/pingcap/tidb-tools v4.0.0-beta.1.0.20200306103835-530c669f7112+incompatible // indirect
@@ -180,21 +196,28 @@ require (
180196
github.com/pkg/sftp v1.13.5 // indirect
181197
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
182198
github.com/rogpeppe/go-internal v1.12.0 // indirect
183-
github.com/russross/blackfriday/v2 v2.0.1 // indirect
199+
github.com/rs/xid v1.4.0 // indirect
200+
github.com/russross/blackfriday/v2 v2.1.0 // indirect
184201
github.com/ryanuber/go-glob v1.0.0 // indirect
202+
github.com/shopspring/decimal v1.2.0 // indirect
185203
github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 // indirect
186-
github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24 // indirect
187204
github.com/shurcooL/sanitized_anchor_name v1.0.0 // indirect
188205
github.com/skeema/knownhosts v1.3.0 // indirect
189206
github.com/soheilhy/cmux v0.1.4 // indirect
190207
github.com/spf13/afero v1.9.2 // indirect
191-
github.com/spf13/cast v1.3.0 // indirect
192-
github.com/spf13/jwalterweatherman v1.0.0 // indirect
208+
github.com/spf13/cast v1.3.1 // indirect
209+
github.com/spf13/jwalterweatherman v1.1.0 // indirect
210+
github.com/subosito/gotenv v1.2.0 // indirect
193211
github.com/swaggo/files v1.0.1 // indirect
212+
github.com/tinylib/msgp v1.1.6 // indirect
213+
github.com/vmihailenco/msgpack/v5 v5.3.5 // indirect
214+
github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect
215+
github.com/wiggin77/merror v1.0.3 // indirect
216+
github.com/wiggin77/srslog v1.0.1 // indirect
194217
github.com/x448/float16 v0.8.4 // indirect
195218
github.com/xanzy/ssh-agent v0.3.3 // indirect
196219
github.com/yoheimuta/go-protoparser/v4 v4.3.0 // indirect
197-
go.uber.org/atomic v1.7.0 // indirect
220+
go.uber.org/atomic v1.9.0 // indirect
198221
go.uber.org/multierr v1.6.0 // indirect
199222
go.uber.org/zap v1.18.1 // indirect
200223
golang.org/x/mod v0.22.0 // indirect
@@ -264,13 +287,12 @@ require (
264287
github.com/klauspost/pgzip v1.2.6
265288
github.com/lestrrat/go-envload v0.0.0-20180220120943-6ed08b54a570 // indirect
266289
github.com/mattn/go-runewidth v0.0.16 // indirect
267-
github.com/miekg/dns v1.1.43 // indirect
290+
github.com/miekg/dns v1.1.48 // indirect
268291
github.com/pelletier/go-toml v1.9.5
269292
github.com/pkg/xattr v0.4.6
270293
github.com/rivo/uniseg v0.4.7 // indirect
271-
github.com/rs/cors v1.7.0 // indirect
294+
github.com/rs/cors v1.8.2 // indirect
272295
github.com/siddontang/go-log v0.0.0-20190221022429-1e957dd83bed
273-
github.com/smartystreets/goconvey v1.7.2 // indirect
274296
golang.org/x/oauth2 v0.21.0
275297
google.golang.org/grpc/examples v0.0.0-20220316190256-c4cabf78f4a2 // indirect
276298
nhooyr.io/websocket v1.8.7 // indirect

0 commit comments

Comments
 (0)