diff --git a/go.mod b/go.mod index 493355c9b..b31d67c50 100644 --- a/go.mod +++ b/go.mod @@ -12,7 +12,7 @@ require ( require ( github.com/Masterminds/semver v1.5.0 - github.com/go-sql-driver/mysql v1.7.1 + github.com/go-sql-driver/mysql v1.8.1 github.com/gorilla/mux v1.8.1 github.com/grafana/pyroscope-go/godeltaprof v0.1.8 github.com/jmoiron/sqlx v1.3.5 @@ -22,7 +22,7 @@ require ( github.com/mattermost/calls-transcriber v0.4.1-0.20240925183146-a4131b656fa5 github.com/mattermost/logr/v2 v2.0.21 github.com/mattermost/mattermost-plugin-calls/server/public v0.0.3 - github.com/mattermost/mattermost/server/public v0.1.5-0.20240613070149-4b0ae20ef7b4 + github.com/mattermost/mattermost/server/public v0.1.9 github.com/mattermost/morph v1.1.0 github.com/mattermost/rtcd v0.18.1-0.20241122194949-fc76bf6a2f16 github.com/mattermost/squirrel v0.2.0 @@ -32,6 +32,7 @@ require ( github.com/testcontainers/testcontainers-go/modules/mysql v0.34.0 github.com/testcontainers/testcontainers-go/modules/postgres v0.34.0 golang.org/x/time v0.3.0 + gopkg.in/yaml.v3 v3.0.1 ) replace github.com/pion/interceptor v0.1.29 => github.com/streamer45/interceptor v0.0.0-20240411210059-c7d42d2dafc1 @@ -40,6 +41,7 @@ replace github.com/mattermost/mattermost-plugin-calls/server/public => ./server/ require ( dario.cat/mergo v1.0.1 // indirect + filippo.io/edwards25519 v1.1.0 // indirect git.mills.io/prologic/bitcask v1.0.2 // indirect github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24 // indirect github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect @@ -52,13 +54,13 @@ require ( github.com/containerd/log v0.1.0 // indirect github.com/containerd/platforms v0.2.1 // indirect github.com/cpuguy83/dockercfg v0.3.2 // indirect - github.com/davecgh/go-spew v1.1.1 // indirect + github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/distribution/reference v0.6.0 // indirect github.com/docker/docker v27.3.1+incompatible // indirect github.com/docker/go-connections v0.5.0 // indirect github.com/docker/go-units v0.5.0 // indirect github.com/dyatlov/go-opengraph/opengraph v0.0.0-20220524092352-606d7b1e5f8a // indirect - github.com/fatih/color v1.16.0 // indirect + github.com/fatih/color v1.17.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect github.com/francoispqt/gojay v1.2.13 // indirect github.com/go-logr/logr v1.4.2 // indirect @@ -68,11 +70,11 @@ require ( github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/protobuf v1.5.4 // indirect github.com/google/uuid v1.6.0 // indirect - github.com/gorilla/websocket v1.5.1 // indirect + github.com/gorilla/websocket v1.5.3 // indirect github.com/hashicorp/errwrap v1.1.0 // indirect - github.com/hashicorp/go-hclog v1.6.2 // indirect + github.com/hashicorp/go-hclog v1.6.3 // indirect github.com/hashicorp/go-multierror v1.1.1 // indirect - github.com/hashicorp/go-plugin v1.6.0 // indirect + github.com/hashicorp/go-plugin v1.6.1 // indirect github.com/hashicorp/yamux v0.1.1 // indirect github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect github.com/klauspost/compress v1.17.11 // indirect @@ -98,7 +100,7 @@ require ( github.com/opencontainers/image-spec v1.1.0 // indirect github.com/pborman/uuid v1.2.1 // indirect github.com/pelletier/go-toml v1.9.5 // indirect - github.com/philhofer/fwd v1.1.2 // indirect + github.com/philhofer/fwd v1.1.3-0.20240612014219-fbbf4953d986 // indirect github.com/pion/datachannel v1.5.6 // indirect github.com/pion/dtls/v2 v2.2.11 // indirect github.com/pion/interceptor v0.1.29 // indirect @@ -113,13 +115,13 @@ require ( github.com/pion/transport/v2 v2.2.5 // indirect github.com/pion/turn/v2 v2.1.6 // indirect github.com/plar/go-adaptive-radix-tree v1.0.4 // indirect - github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 // indirect github.com/prometheus/client_model v0.4.0 // indirect github.com/prometheus/common v0.44.0 // indirect github.com/prometheus/procfs v0.11.0 // indirect github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0 // indirect - github.com/segmentio/backo-go v1.0.1 // indirect + github.com/segmentio/backo-go v1.1.0 // indirect github.com/shirou/gopsutil/v3 v3.24.5 // indirect github.com/shoenig/go-m1cpu v0.1.6 // indirect github.com/sirupsen/logrus v1.9.3 // indirect @@ -127,7 +129,7 @@ require ( github.com/tidwall/gjson v1.17.1 // indirect github.com/tidwall/match v1.1.1 // indirect github.com/tidwall/pretty v1.2.1 // indirect - github.com/tinylib/msgp v1.1.9 // indirect + github.com/tinylib/msgp v1.2.0 // indirect github.com/tklauser/go-sysconf v0.3.14 // indirect github.com/tklauser/numcpus v0.9.0 // indirect github.com/vmihailenco/msgpack/v5 v5.4.1 // indirect @@ -144,12 +146,12 @@ require ( go.opentelemetry.io/otel/trace v1.31.0 // indirect golang.org/x/crypto v0.28.0 // indirect golang.org/x/exp v0.0.0-20231006140011-7918f672742d // indirect - golang.org/x/mod v0.17.0 // indirect - golang.org/x/net v0.26.0 // indirect + golang.org/x/mod v0.19.0 // indirect + golang.org/x/net v0.27.0 // indirect golang.org/x/sync v0.8.0 // indirect golang.org/x/sys v0.26.0 // indirect golang.org/x/text v0.19.0 // indirect - golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d // indirect + golang.org/x/tools v0.23.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20240528184218-531527333157 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240805194559-2c9e96a0b5d4 // indirect google.golang.org/grpc v1.65.0 // indirect @@ -157,7 +159,6 @@ require ( gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d // indirect gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect - gopkg.in/yaml.v3 v3.0.1 // indirect lukechampine.com/uint128 v1.1.1 // indirect modernc.org/cc/v3 v3.36.0 // indirect modernc.org/ccgo/v3 v3.16.6 // indirect diff --git a/go.sum b/go.sum index 968621eb9..d7a3a0dbc 100644 --- a/go.sum +++ b/go.sum @@ -45,6 +45,8 @@ dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7 dmitri.shuralyov.com/html/belt v0.0.0-20180602232347-f7d459c86be0/go.mod h1:JLBrvjyP0v+ecvNYvCpyZgu5/xkfAUhi6wJj28eUfSU= dmitri.shuralyov.com/service/change v0.0.0-20181023043359-a85b471d5412/go.mod h1:a1inKt/atXimZ4Mv927x+r7UpyzRUf4emIoiiSC2TN4= dmitri.shuralyov.com/state v0.0.0-20180228185332-28bcc343414c/go.mod h1:0PRwlb0D6DFvNNtx+9ybjezNCa8XF0xaYcETyp6rHWU= +filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= +filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= git.apache.org/thrift.git v0.0.0-20180902110319-2566ecd5d999/go.mod h1:fPE2ZNJGynbRyZ4dJvy6G277gSllfV2HJqblrnkyeyg= git.mills.io/prologic/bitcask v1.0.2 h1:Iy9x3mVVd1fB+SWY0LTmsSDPGbzMrd7zCZPKbsb/tDA= git.mills.io/prologic/bitcask v1.0.2/go.mod h1:ppXpR3haeYrijyJDleAkSGH3p90w6sIHxEA/7UHMxH4= @@ -77,8 +79,6 @@ github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kB github.com/bketelsen/crypt v0.0.4/go.mod h1:aI6NrJ0pMGgvZKL1iVgXLnfIFJtfV+bKCoqOes/6LfM= github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM= github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ= -github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 h1:DDGfHa7BWjL4YnC6+E63dPcxHo2sUxDIu8g3QgEJdRY= -github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4= github.com/bradfitz/go-smtpd v0.0.0-20170404230938-deb6d6237625/go.mod h1:HYsPBTaaSFSlLx/70C2HPIMNZpVV8+vt/A+FMnYP11g= github.com/bufbuild/protocompile v0.4.0 h1:LbFKd2XowZvQ/kajzguUp2DC9UEIQhIq77fZZlaQsNA= github.com/bufbuild/protocompile v0.4.0/go.mod h1:3v93+mbWn/v3xzN+31nwkJfrEpAUwp+BagBSZWx+TP8= @@ -114,8 +114,9 @@ github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsr github.com/creack/pty v1.1.18 h1:n56/Zwd5o6whRC5PMGretI4IdRLlmBXYNjScPaBgsbY= github.com/creack/pty v1.1.18/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= github.com/distribution/reference v0.6.0 h1:0IXCQ5g4/QMHHkarYzh5l+u8T3t73zM5QvfrDyIgxBk= @@ -139,8 +140,8 @@ github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.m github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= -github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM= -github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE= +github.com/fatih/color v1.17.0 h1:GlRw1BRJxkpqUCBKzKOw098ed57fEsKeNjpTe3cSjK4= +github.com/fatih/color v1.17.0/go.mod h1:YZ7TlrGPkiz6ku9fK3TLD/pl3CpsiFyu8N92HLgmosI= github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc= @@ -166,8 +167,8 @@ github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiU github.com/go-ole/go-ole v1.3.0 h1:Dt6ye7+vXGIKZ7Xtk4s6/xVdGDQynvom7xCFEdWr6uE= github.com/go-ole/go-ole v1.3.0/go.mod h1:5LS6F96DhAwUc7C+1HLexzMXY1xGRSryjyPPKW6zv78= github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= -github.com/go-sql-driver/mysql v1.7.1 h1:lUIinVbN1DY0xBg0eMOzmmtGoHwWBbvnWubQUrtU8EI= -github.com/go-sql-driver/mysql v1.7.1/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI= +github.com/go-sql-driver/mysql v1.8.1 h1:LedoTUt/eveggdHS9qUFC1EFSa8bU2+1pZjSRpvNJ1Y= +github.com/go-sql-driver/mysql v1.8.1/go.mod h1:wEBSXgmK//2ZFJyE+qWnIsVGmvmEKlqwuVSjsCm7DZg= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/gofrs/flock v0.8.0 h1:MSdYClljsF3PbENUUEx85nkWfJSGfzYI9yEBZOJz6CY= @@ -259,8 +260,8 @@ github.com/gopherjs/gopherjs v1.17.2/go.mod h1:pRRIvn/QzFLrKfvEz3qUuEhtE/zLCWfre github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY= github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ= github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= -github.com/gorilla/websocket v1.5.1 h1:gmztn0JnHVt9JZquRuzLw3g4wouNVzKL15iLr/zn/QY= -github.com/gorilla/websocket v1.5.1/go.mod h1:x3kM2JMyaluk02fnUJpQuwD2dCS5NDG2ZHL0uE0tcaY= +github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg= +github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/grafana/pyroscope-go/godeltaprof v0.1.8 h1:iwOtYXeeVSAeYefJNaxDytgjKtUuKQbJqgAIjlnicKg= github.com/grafana/pyroscope-go/godeltaprof v0.1.8/go.mod h1:2+l7K7twW49Ct4wFluZD3tZ6e0SjanjcUUBPVD/UuGU= github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= @@ -278,15 +279,15 @@ github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brv github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I= github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= -github.com/hashicorp/go-hclog v1.6.2 h1:NOtoftovWkDheyUM/8JW3QMiXyxJK3uHRK7wV04nD2I= -github.com/hashicorp/go-hclog v1.6.2/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= +github.com/hashicorp/go-hclog v1.6.3 h1:Qr2kF+eVWjTiYmU7Y31tYlP1h0q/X3Nl3tPGdaB11/k= +github.com/hashicorp/go-hclog v1.6.3/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= -github.com/hashicorp/go-plugin v1.6.0 h1:wgd4KxHJTVGGqWBq4QPB1i5BZNEx9BR8+OFmHDmTk8A= -github.com/hashicorp/go-plugin v1.6.0/go.mod h1:lBS5MtSSBZk0SHc66KACcjjlU6WzEVP/8pwz68aMkCI= +github.com/hashicorp/go-plugin v1.6.1 h1:P7MR2UP6gNKGPp+y7EZw2kOiq4IR9WiqLvp0XOsVdwI= +github.com/hashicorp/go-plugin v1.6.1/go.mod h1:XPHFku2tFo3o3QKFgSYo+cghcUhw1NA1hZyMK0PWAw0= github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= @@ -371,8 +372,8 @@ github.com/mattermost/ldap v3.0.4+incompatible h1:SOeNnz+JNR+foQ3yHkYqijb9MLPhXN github.com/mattermost/ldap v3.0.4+incompatible/go.mod h1:b4reDCcGpBxJ4WX0f224KFY+OR0npin7or7EFpeIko4= github.com/mattermost/logr/v2 v2.0.21 h1:CMHsP+nrbRlEC4g7BwOk1GAnMtHkniFhlSQPXy52be4= github.com/mattermost/logr/v2 v2.0.21/go.mod h1:kZkB/zqKL9e+RY5gB3vGpsyenC+TpuiOenjMkvJJbzc= -github.com/mattermost/mattermost/server/public v0.1.5-0.20240613070149-4b0ae20ef7b4 h1:2E0BAcaECdrHpx7dBW3lJy+H7htqX6jesWBlBg8LH3k= -github.com/mattermost/mattermost/server/public v0.1.5-0.20240613070149-4b0ae20ef7b4/go.mod h1:PDPb/iqzJJ5ZvK/m70oDF55AXN/cOvVFj96Yu4e6j+Q= +github.com/mattermost/mattermost/server/public v0.1.9 h1:l/OKPRVuFeqL0yqRVC/JpveG5sLNKcT9llxqMkO9e+s= +github.com/mattermost/mattermost/server/public v0.1.9/go.mod h1:SkTKbMul91Rq0v2dIxe8mqzUOY+3KwlwwLmAlxDfGCk= github.com/mattermost/morph v1.1.0 h1:Q9vrJbeM3s2jfweGheq12EFIzdNp9a/6IovcbvOQ6Cw= github.com/mattermost/morph v1.1.0/go.mod h1:gD+EaqX2UMyyuzmF4PFh4r33XneQ8Nzi+0E8nXjMa3A= github.com/mattermost/rtcd v0.18.1-0.20241122194949-fc76bf6a2f16 h1:3LonE6UDF+GT4LjC1hqPL1xLBORoHdxeid1VNmmZkIE= @@ -445,8 +446,8 @@ github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/9 github.com/pelletier/go-toml v1.9.3/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3ve8= github.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= -github.com/philhofer/fwd v1.1.2 h1:bnDivRJ1EWPjUIRXV5KfORO897HTbpFAQddBdE8t7Gw= -github.com/philhofer/fwd v1.1.2/go.mod h1:qkPdfjR2SIEbspLqpe1tO4n5yICnr2DY7mqEx2tUTP0= +github.com/philhofer/fwd v1.1.3-0.20240612014219-fbbf4953d986 h1:jYi87L8j62qkXzaYHAQAhEapgukhenIMZRBKTNRLHJ4= +github.com/philhofer/fwd v1.1.3-0.20240612014219-fbbf4953d986/go.mod h1:RqIHx9QI14HlwKwm98g9Re5prTQ6LdeRQn+gXJFxsJM= github.com/pion/datachannel v1.5.6 h1:1IxKJntfSlYkpUj8LlYRSWpYiTTC02nUrOE8T3DqGeg= github.com/pion/datachannel v1.5.6/go.mod h1:1eKT6Q85pRnr2mHiWHxJwO50SfZRtWHTsNIVb/NfGW4= github.com/pion/dtls/v2 v2.2.7/go.mod h1:8WiMkebSHFD0T+dIU+UeBaoV7kDhOW5oDCzZ7WZ/F9s= @@ -496,8 +497,9 @@ github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI= github.com/plar/go-adaptive-radix-tree v1.0.4 h1:Ucd8R6RH2E7RW8ZtDKrsWyOD3paG2qqJO0I20WQ8oWQ= github.com/plar/go-adaptive-radix-tree v1.0.4/go.mod h1:Ot8d28EII3i7Lv4PSvBlF8ejiD/CtRYDuPsySJbSaK8= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 h1:o4JXh1EVt9k/+g42oCprj/FisM4qX9L3sZB3upGN2ZU= github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= @@ -535,8 +537,8 @@ github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= -github.com/segmentio/backo-go v1.0.1 h1:68RQccglxZeyURy93ASB/2kc9QudzgIDexJ927N++y4= -github.com/segmentio/backo-go v1.0.1/go.mod h1:9/Rh6yILuLysoQnZ2oNooD2g7aBnvM7r/fNVxRNWfBc= +github.com/segmentio/backo-go v1.1.0 h1:cJIfHQUdmLsd8t9IXqf5J8SdrOMn9vMa7cIvOavHAhc= +github.com/segmentio/backo-go v1.1.0/go.mod h1:ckenwdf+v/qbyhVdNPWHnqh2YdJBED1O9cidYyM5J18= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= github.com/shirou/gopsutil/v3 v3.24.5 h1:i0t8kL+kQTvpAYToeuiVk3TgDeKOFioZO3Ztz/iZ9pI= github.com/shirou/gopsutil/v3 v3.24.5/go.mod h1:bsoOS1aStSs9ErQ1WWfxllSeS1K5D+U30r2NfcubMVk= @@ -631,8 +633,8 @@ github.com/tidwall/pretty v1.2.0/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhso github.com/tidwall/pretty v1.2.1 h1:qjsOFOWWQl+N3RsoF5/ssm1pHmJJwhjlSbZ51I6wMl4= github.com/tidwall/pretty v1.2.1/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= github.com/tidwall/redcon v1.4.1/go.mod h1:XwNPFbJ4ShWNNSA2Jazhbdje6jegTCcwFR6mfaADvHA= -github.com/tinylib/msgp v1.1.9 h1:SHf3yoO2sGA0veCJeCBYLHuttAVFHGm2RHgNodW7wQU= -github.com/tinylib/msgp v1.1.9/go.mod h1:BCXGB54lDD8qUEPmiG0cQQUANC4IUQyB2ItS2UDlO/k= +github.com/tinylib/msgp v1.2.0 h1:0uKB/662twsVBpYUPbokj4sTSKhWFKB7LopO2kWK8lY= +github.com/tinylib/msgp v1.2.0/go.mod h1:2vIGs3lcUo8izAATNobrCHevYZC/LMsJtw4JPiYPHro= github.com/tklauser/go-sysconf v0.3.14 h1:g5vzr9iPFFz24v2KZXs/pvpvh8/V9Fw6vQK5ZZb78yU= github.com/tklauser/go-sysconf v0.3.14/go.mod h1:1ym4lWMLUOhuBOPGtRcJm7tEGX4SCYNEEEtghGG/8uY= github.com/tklauser/numcpus v0.9.0 h1:lmyCHtANi8aRUgkckBgoDk1nHCux3n2cgkJLXdQGPDo= @@ -757,8 +759,8 @@ golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA= -golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.19.0 h1:fEdghXQSo20giMthA7cd28ZC+jts4amQ3YMXiP5oMQ8= +golang.org/x/mod v0.19.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -812,8 +814,8 @@ golang.org/x/net v0.14.0/go.mod h1:PpSgVXXLK0OxS0F31C1/tv6XNguvCrnXIDrFMspZIUI= golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY= golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= golang.org/x/net v0.22.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= -golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ= -golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE= +golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys= +golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181017192945-9dcd33a902f4/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181203162652-d668ce993890/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -1009,8 +1011,8 @@ golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d h1:vU5i/LfpvrRCpgM/VPfJLg5KjxD3E+hfT1SH+d9zLwg= -golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= +golang.org/x/tools v0.23.0 h1:SGsXPZ+2l4JsgaCKkx+FQ9YZ5XEtA1GZYuoDjenLjvg= +golang.org/x/tools v0.23.0/go.mod h1:pnu6ufv6vQkll6szChhK3C3L/ruaIv5eBeztNG8wtsI= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/server/configuration.go b/server/configuration.go index 195d02149..860b62d7a 100644 --- a/server/configuration.go +++ b/server/configuration.go @@ -196,52 +196,52 @@ func (is *ICEServers) UnmarshalJSON(data []byte) error { func (c *configuration) SetDefaults() { if c.UDPServerPort == nil { - c.UDPServerPort = model.NewInt(8443) + c.UDPServerPort = model.NewPointer(8443) } if c.TCPServerPort == nil { - c.TCPServerPort = model.NewInt(8443) + c.TCPServerPort = model.NewPointer(8443) } - c.AllowEnableCalls = model.NewBool(true) + c.AllowEnableCalls = model.NewPointer(true) if c.DefaultEnabled == nil { - c.DefaultEnabled = model.NewBool(false) + c.DefaultEnabled = model.NewPointer(false) } if c.MaxCallParticipants == nil { - c.MaxCallParticipants = model.NewInt(0) // unlimited + c.MaxCallParticipants = model.NewPointer(0) // unlimited } if c.TURNCredentialsExpirationMinutes == nil { - c.TURNCredentialsExpirationMinutes = model.NewInt(1440) + c.TURNCredentialsExpirationMinutes = model.NewPointer(1440) } if c.ServerSideTURN == nil { - c.ServerSideTURN = model.NewBool(false) + c.ServerSideTURN = model.NewPointer(false) } if c.AllowScreenSharing == nil { - c.AllowScreenSharing = model.NewBool(true) + c.AllowScreenSharing = model.NewPointer(true) } if c.EnableRecordings == nil { - c.EnableRecordings = model.NewBool(false) + c.EnableRecordings = model.NewPointer(false) } if c.EnableTranscriptions == nil { - c.EnableTranscriptions = model.NewBool(false) + c.EnableTranscriptions = model.NewPointer(false) } if c.TranscriberNumThreads == nil { - c.TranscriberNumThreads = model.NewInt(transcriber.NumThreadsDefault) + c.TranscriberNumThreads = model.NewPointer(transcriber.NumThreadsDefault) } if c.MaxRecordingDuration == nil { - c.MaxRecordingDuration = model.NewInt(defaultRecDurationMinutes) + c.MaxRecordingDuration = model.NewPointer(defaultRecDurationMinutes) } if c.RecordingQuality == "" { c.RecordingQuality = "medium" } if c.EnableSimulcast == nil { - c.EnableSimulcast = model.NewBool(false) + c.EnableSimulcast = model.NewPointer(false) } if c.EnableIPv6 == nil { - c.EnableIPv6 = model.NewBool(false) + c.EnableIPv6 = model.NewPointer(false) } if c.EnableRinging == nil { - c.EnableRinging = model.NewBool(false) + c.EnableRinging = model.NewPointer(false) } if c.TranscriberModelSize == "" { c.TranscriberModelSize = transcriber.ModelSizeDefault @@ -250,25 +250,25 @@ func (c *configuration) SetDefaults() { c.TranscribeAPI = transcriber.TranscribeAPIDefault } if c.EnableLiveCaptions == nil { - c.EnableLiveCaptions = model.NewBool(false) + c.EnableLiveCaptions = model.NewPointer(false) } if c.LiveCaptionsModelSize == "" { c.LiveCaptionsModelSize = transcriber.LiveCaptionsModelSizeDefault } if c.LiveCaptionsNumTranscribers == nil { - c.LiveCaptionsNumTranscribers = model.NewInt(transcriber.LiveCaptionsNumTranscribersDefault) + c.LiveCaptionsNumTranscribers = model.NewPointer(transcriber.LiveCaptionsNumTranscribersDefault) } if c.LiveCaptionsNumThreadsPerTranscriber == nil { - c.LiveCaptionsNumThreadsPerTranscriber = model.NewInt(transcriber.LiveCaptionsNumThreadsPerTranscriberDefault) + c.LiveCaptionsNumThreadsPerTranscriber = model.NewPointer(transcriber.LiveCaptionsNumThreadsPerTranscriberDefault) } if c.LiveCaptionsLanguage == "" { c.LiveCaptionsLanguage = transcriber.LiveCaptionsLanguageDefault } if c.EnableAV1 == nil { - c.EnableAV1 = model.NewBool(false) + c.EnableAV1 = model.NewPointer(false) } if c.EnableDCSignaling == nil { - c.EnableDCSignaling = model.NewBool(false) + c.EnableDCSignaling = model.NewPointer(false) } } @@ -370,18 +370,18 @@ func (c *configuration) Clone() *configuration { cfg.LiveCaptionsLanguage = c.LiveCaptionsLanguage if c.UDPServerPort != nil { - cfg.UDPServerPort = model.NewInt(*c.UDPServerPort) + cfg.UDPServerPort = model.NewPointer(*c.UDPServerPort) } if c.TCPServerPort != nil { - cfg.TCPServerPort = model.NewInt(*c.TCPServerPort) + cfg.TCPServerPort = model.NewPointer(*c.TCPServerPort) } // AllowEnableCalls is always true - cfg.AllowEnableCalls = model.NewBool(true) + cfg.AllowEnableCalls = model.NewPointer(true) if c.DefaultEnabled != nil { - cfg.DefaultEnabled = model.NewBool(*c.DefaultEnabled) + cfg.DefaultEnabled = model.NewPointer(*c.DefaultEnabled) } if c.ICEServers != nil { @@ -395,71 +395,71 @@ func (c *configuration) Clone() *configuration { } if c.MaxCallParticipants != nil { - cfg.MaxCallParticipants = model.NewInt(*c.MaxCallParticipants) + cfg.MaxCallParticipants = model.NewPointer(*c.MaxCallParticipants) } if c.TURNCredentialsExpirationMinutes != nil { - cfg.TURNCredentialsExpirationMinutes = model.NewInt(*c.TURNCredentialsExpirationMinutes) + cfg.TURNCredentialsExpirationMinutes = model.NewPointer(*c.TURNCredentialsExpirationMinutes) } if c.ServerSideTURN != nil { - cfg.ServerSideTURN = model.NewBool(*c.ServerSideTURN) + cfg.ServerSideTURN = model.NewPointer(*c.ServerSideTURN) } if c.AllowScreenSharing != nil { - cfg.AllowScreenSharing = model.NewBool(*c.AllowScreenSharing) + cfg.AllowScreenSharing = model.NewPointer(*c.AllowScreenSharing) } if c.EnableRecordings != nil { - cfg.EnableRecordings = model.NewBool(*c.EnableRecordings) + cfg.EnableRecordings = model.NewPointer(*c.EnableRecordings) } if c.EnableTranscriptions != nil { - cfg.EnableTranscriptions = model.NewBool(*c.EnableTranscriptions) + cfg.EnableTranscriptions = model.NewPointer(*c.EnableTranscriptions) } if c.TranscriberNumThreads != nil { - cfg.TranscriberNumThreads = model.NewInt(*c.TranscriberNumThreads) + cfg.TranscriberNumThreads = model.NewPointer(*c.TranscriberNumThreads) } if c.EnableLiveCaptions != nil { - cfg.EnableLiveCaptions = model.NewBool(*c.EnableLiveCaptions) + cfg.EnableLiveCaptions = model.NewPointer(*c.EnableLiveCaptions) } if c.MaxRecordingDuration != nil { - cfg.MaxRecordingDuration = model.NewInt(*c.MaxRecordingDuration) + cfg.MaxRecordingDuration = model.NewPointer(*c.MaxRecordingDuration) } if c.EnableSimulcast != nil { - cfg.EnableSimulcast = model.NewBool(*c.EnableSimulcast) + cfg.EnableSimulcast = model.NewPointer(*c.EnableSimulcast) } if c.EnableIPv6 != nil { - cfg.EnableIPv6 = model.NewBool(*c.EnableIPv6) + cfg.EnableIPv6 = model.NewPointer(*c.EnableIPv6) } if c.EnableRinging != nil { - cfg.EnableRinging = model.NewBool(*c.EnableRinging) + cfg.EnableRinging = model.NewPointer(*c.EnableRinging) } if c.ICEHostPortOverride != nil { - cfg.ICEHostPortOverride = model.NewInt(*c.ICEHostPortOverride) + cfg.ICEHostPortOverride = model.NewPointer(*c.ICEHostPortOverride) } if c.LiveCaptionsNumTranscribers != nil { - cfg.LiveCaptionsNumTranscribers = model.NewInt(*c.LiveCaptionsNumTranscribers) + cfg.LiveCaptionsNumTranscribers = model.NewPointer(*c.LiveCaptionsNumTranscribers) } if c.LiveCaptionsNumThreadsPerTranscriber != nil { - cfg.LiveCaptionsNumThreadsPerTranscriber = model.NewInt(*c.LiveCaptionsNumThreadsPerTranscriber) + cfg.LiveCaptionsNumThreadsPerTranscriber = model.NewPointer(*c.LiveCaptionsNumThreadsPerTranscriber) } if c.EnableAV1 != nil { - cfg.EnableAV1 = model.NewBool(*c.EnableAV1) + cfg.EnableAV1 = model.NewPointer(*c.EnableAV1) } if c.EnableDCSignaling != nil { - cfg.EnableDCSignaling = model.NewBool(*c.EnableDCSignaling) + cfg.EnableDCSignaling = model.NewPointer(*c.EnableDCSignaling) } return &cfg @@ -509,12 +509,12 @@ func (p *Plugin) getClientConfig(c *configuration) clientConfig { } return clientConfig{ - AllowEnableCalls: model.NewBool(true), // always true + AllowEnableCalls: model.NewPointer(true), // always true DefaultEnabled: c.DefaultEnabled, ICEServers: c.ICEServers, ICEServersConfigs: c.getICEServers(true), MaxCallParticipants: c.MaxCallParticipants, - NeedsTURNCredentials: model.NewBool(c.TURNStaticAuthSecret != "" && len(c.ICEServersConfigs.getTURNConfigsForCredentials()) > 0), + NeedsTURNCredentials: model.NewPointer(c.TURNStaticAuthSecret != "" && len(c.ICEServersConfigs.getTURNConfigsForCredentials()) > 0), AllowScreenSharing: c.AllowScreenSharing, EnableRecordings: c.EnableRecordings, EnableTranscriptions: c.EnableTranscriptions, @@ -666,7 +666,7 @@ func (p *Plugin) ConfigurationWillBeSaved(newCfg *model.Config) (*model.Config, } func (p *Plugin) setOverrides(cfg *configuration) { - cfg.AllowEnableCalls = model.NewBool(true) + cfg.AllowEnableCalls = model.NewPointer(true) if l := p.API.GetLicense(); l != nil && license.IsCloud(l) { // On Cloud installations we want calls enabled in all channels so we diff --git a/server/configuration_test.go b/server/configuration_test.go index b6dc531da..2eb1a6fb6 100644 --- a/server/configuration_test.go +++ b/server/configuration_test.go @@ -54,7 +54,7 @@ func TestConfigurationIsValid(t *testing.T) { input: func() configuration { var cfg configuration cfg.SetDefaults() - cfg.UDPServerPort = model.NewInt(45) + cfg.UDPServerPort = model.NewPointer(45) return cfg }(), err: "UDPServerPort is not valid: 45 is not in allowed range [80, 49151]", @@ -64,7 +64,7 @@ func TestConfigurationIsValid(t *testing.T) { input: func() configuration { var cfg configuration cfg.SetDefaults() - cfg.UDPServerPort = model.NewInt(443) + cfg.UDPServerPort = model.NewPointer(443) return cfg }(), }, @@ -73,7 +73,7 @@ func TestConfigurationIsValid(t *testing.T) { input: func() configuration { var cfg configuration cfg.SetDefaults() - cfg.MaxCallParticipants = model.NewInt(-1) + cfg.MaxCallParticipants = model.NewPointer(-1) return cfg }(), err: "MaxCallParticipants is not valid", @@ -83,7 +83,7 @@ func TestConfigurationIsValid(t *testing.T) { input: func() configuration { var cfg configuration cfg.SetDefaults() - cfg.TURNCredentialsExpirationMinutes = model.NewInt(-1) + cfg.TURNCredentialsExpirationMinutes = model.NewPointer(-1) return cfg }(), err: "TURNCredentialsExpirationMinutes is not valid", @@ -93,7 +93,7 @@ func TestConfigurationIsValid(t *testing.T) { input: func() configuration { var cfg configuration cfg.SetDefaults() - cfg.MaxRecordingDuration = model.NewInt(1) + cfg.MaxRecordingDuration = model.NewPointer(1) return cfg }(), err: "MaxRecordingDuration is not valid: range should be [15, 180]", @@ -113,7 +113,7 @@ func TestConfigurationIsValid(t *testing.T) { input: func() configuration { var cfg configuration cfg.SetDefaults() - cfg.ICEHostPortOverride = model.NewInt(45) + cfg.ICEHostPortOverride = model.NewPointer(45) return cfg }(), err: "ICEHostPortOverride is not valid: 45 is not in allowed range [80, 49151]", @@ -123,9 +123,9 @@ func TestConfigurationIsValid(t *testing.T) { input: func() configuration { var cfg configuration cfg.SetDefaults() - cfg.EnableRecordings = model.NewBool(true) - cfg.EnableTranscriptions = model.NewBool(true) - cfg.EnableLiveCaptions = model.NewBool(true) + cfg.EnableRecordings = model.NewPointer(true) + cfg.EnableTranscriptions = model.NewPointer(true) + cfg.EnableLiveCaptions = model.NewPointer(true) cfg.LiveCaptionsModelSize = "" return cfg }(), @@ -136,10 +136,10 @@ func TestConfigurationIsValid(t *testing.T) { input: func() configuration { var cfg configuration cfg.SetDefaults() - cfg.EnableRecordings = model.NewBool(true) - cfg.EnableTranscriptions = model.NewBool(true) - cfg.EnableLiveCaptions = model.NewBool(true) - cfg.LiveCaptionsNumTranscribers = model.NewInt(0) + cfg.EnableRecordings = model.NewPointer(true) + cfg.EnableTranscriptions = model.NewPointer(true) + cfg.EnableLiveCaptions = model.NewPointer(true) + cfg.LiveCaptionsNumTranscribers = model.NewPointer(0) return cfg }(), err: "LiveCaptionsNumTranscribers is not valid: should be greater than 0", @@ -149,10 +149,10 @@ func TestConfigurationIsValid(t *testing.T) { input: func() configuration { var cfg configuration cfg.SetDefaults() - cfg.EnableRecordings = model.NewBool(true) - cfg.EnableTranscriptions = model.NewBool(true) - cfg.EnableLiveCaptions = model.NewBool(true) - cfg.LiveCaptionsNumThreadsPerTranscriber = model.NewInt(0) + cfg.EnableRecordings = model.NewPointer(true) + cfg.EnableTranscriptions = model.NewPointer(true) + cfg.EnableLiveCaptions = model.NewPointer(true) + cfg.LiveCaptionsNumThreadsPerTranscriber = model.NewPointer(0) return cfg }(), err: "LiveCaptionsNumThreadsPerTranscriber is not valid: should be greater than 0", @@ -162,9 +162,9 @@ func TestConfigurationIsValid(t *testing.T) { input: func() configuration { var cfg configuration cfg.SetDefaults() - cfg.EnableRecordings = model.NewBool(true) - cfg.EnableTranscriptions = model.NewBool(true) - cfg.EnableLiveCaptions = model.NewBool(true) + cfg.EnableRecordings = model.NewPointer(true) + cfg.EnableTranscriptions = model.NewPointer(true) + cfg.EnableLiveCaptions = model.NewPointer(true) cfg.LiveCaptionsLanguage = "" return cfg }(), @@ -174,9 +174,9 @@ func TestConfigurationIsValid(t *testing.T) { input: func() configuration { var cfg configuration cfg.SetDefaults() - cfg.EnableRecordings = model.NewBool(true) - cfg.EnableTranscriptions = model.NewBool(true) - cfg.EnableLiveCaptions = model.NewBool(true) + cfg.EnableRecordings = model.NewPointer(true) + cfg.EnableTranscriptions = model.NewPointer(true) + cfg.EnableLiveCaptions = model.NewPointer(true) cfg.LiveCaptionsLanguage = "inv" return cfg }(), @@ -187,9 +187,9 @@ func TestConfigurationIsValid(t *testing.T) { input: func() configuration { var cfg configuration cfg.SetDefaults() - cfg.EnableRecordings = model.NewBool(true) - cfg.EnableTranscriptions = model.NewBool(true) - cfg.TranscriberNumThreads = model.NewInt(0) + cfg.EnableRecordings = model.NewPointer(true) + cfg.EnableTranscriptions = model.NewPointer(true) + cfg.TranscriberNumThreads = model.NewPointer(0) return cfg }(), err: "TranscriberNumThreads is not valid: should be greater than 0", @@ -232,9 +232,9 @@ func TestGetClientConfig(t *testing.T) { clientCfg := p.getClientConfig(p.getConfiguration()) // defaults - require.Equal(t, model.NewBool(true), clientCfg.AllowEnableCalls) + require.Equal(t, model.NewPointer(true), clientCfg.AllowEnableCalls) require.Equal(t, p.getConfiguration().AllowEnableCalls, clientCfg.AllowEnableCalls) - require.Equal(t, model.NewBool(false), clientCfg.DefaultEnabled) + require.Equal(t, model.NewPointer(false), clientCfg.DefaultEnabled) require.Equal(t, p.getConfiguration().DefaultEnabled, clientCfg.DefaultEnabled) *p.configuration.AllowEnableCalls = false diff --git a/server/db/helper_test.go b/server/db/helper_test.go index 0a166105c..137e3fb2a 100644 --- a/server/db/helper_test.go +++ b/server/db/helper_test.go @@ -127,8 +127,8 @@ func newPostgresStore(t *testing.T, binaryParams bool) (*Store, func()) { u.RawQuery = values.Encode() dsn = u.String() } - settings.DataSource = model.NewString(dsn) - settings.DriverName = model.NewString(model.DatabaseDriverPostgres) + settings.DataSource = model.NewPointer(dsn) + settings.DriverName = model.NewPointer(model.DatabaseDriverPostgres) mockLogger.On("Info", mock.Anything).Run(func(args mock.Arguments) { log.Print(args.Get(0).(string)) @@ -162,8 +162,8 @@ func newMySQLStore(t *testing.T) (*Store, func()) { var settings model.SqlSettings settings.SetDefaults(false) - settings.DataSource = model.NewString(dsn) - settings.DriverName = model.NewString(model.DatabaseDriverMysql) + settings.DataSource = model.NewPointer(dsn) + settings.DriverName = model.NewPointer(model.DatabaseDriverMysql) config, err := mysql.ParseDSN(dsn) require.NoError(t, err) diff --git a/server/db/store_test.go b/server/db/store_test.go index ec9d37ead..a2206550c 100644 --- a/server/db/store_test.go +++ b/server/db/store_test.go @@ -30,8 +30,8 @@ func TestNewStore(t *testing.T) { var settings model.SqlSettings settings.SetDefaults(false) - settings.DataSource = model.NewString(dsn) - settings.DriverName = model.NewString(model.DatabaseDriverPostgres) + settings.DataSource = model.NewPointer(dsn) + settings.DriverName = model.NewPointer(model.DatabaseDriverPostgres) t.Run("writer only", func(t *testing.T) { mockLogger.On("Info", "store: no reader connector passed, using writer").Once() @@ -67,8 +67,8 @@ func TestNewStore(t *testing.T) { var settings model.SqlSettings settings.SetDefaults(false) - settings.DataSource = model.NewString(dsn) - settings.DriverName = model.NewString(model.DatabaseDriverMysql) + settings.DataSource = model.NewPointer(dsn) + settings.DriverName = model.NewPointer(model.DatabaseDriverMysql) t.Run("writer only", func(t *testing.T) { mockLogger.On("Info", "store: no reader connector passed, using writer").Once() diff --git a/server/db/utils_test.go b/server/db/utils_test.go index bad13274b..e8fd675da 100644 --- a/server/db/utils_test.go +++ b/server/db/utils_test.go @@ -44,8 +44,8 @@ func TestSetupConn(t *testing.T) { t.Run("defaults", func(t *testing.T) { var settings model.SqlSettings settings.SetDefaults(false) - settings.DataSource = model.NewString(dsn) - settings.DriverName = model.NewString(driverName) + settings.DataSource = model.NewPointer(dsn) + settings.DriverName = model.NewPointer(driverName) s := &Store{ driverName: driverName, settings: settings, @@ -68,8 +68,8 @@ func TestSetupConn(t *testing.T) { var settings model.SqlSettings settings.SetDefaults(false) - settings.DataSource = model.NewString(dsn) - settings.DriverName = model.NewString(driverName) + settings.DataSource = model.NewPointer(dsn) + settings.DriverName = model.NewPointer(driverName) s := &Store{ driverName: driverName, settings: settings, diff --git a/server/helper_test.go b/server/helper_test.go index 26f314b10..683b6d803 100644 --- a/server/helper_test.go +++ b/server/helper_test.go @@ -86,8 +86,8 @@ func NewTestStore(t *testing.T) (*db.Store, func()) { values.Set("binary_parameters", "yes") u.RawQuery = values.Encode() dsn = u.String() - settings.DataSource = model.NewString(dsn) - settings.DriverName = model.NewString(model.DatabaseDriverPostgres) + settings.DataSource = model.NewPointer(dsn) + settings.DriverName = model.NewPointer(model.DatabaseDriverPostgres) mockLogger.On("Info", mock.Anything).Run(func(args mock.Arguments) { log.Print(args.Get(0).(string)) diff --git a/server/limits_test.go b/server/limits_test.go index f55de3d58..b9968f441 100644 --- a/server/limits_test.go +++ b/server/limits_test.go @@ -186,7 +186,7 @@ func TestSendConcurrentSessionsWarning(t *testing.T) { mockAPI.On("GetLicense").Return(&model.License{ Features: &model.Features{ - Cloud: model.NewBool(true), + Cloud: model.NewPointer(true), }, }, nil).Once() diff --git a/server/mocks/github.com/mattermost/mattermost/server/public/plugin/mock_API.go b/server/mocks/github.com/mattermost/mattermost/server/public/plugin/mock_API.go index 1affe2222..b56b255b1 100644 --- a/server/mocks/github.com/mattermost/mattermost/server/public/plugin/mock_API.go +++ b/server/mocks/github.com/mattermost/mattermost/server/public/plugin/mock_API.go @@ -3962,6 +3962,51 @@ func (_c *MockAPI_GetPluginConfig_Call) RunAndReturn(run func() map[string]inter return _c } +// GetPluginID provides a mock function with given fields: +func (_m *MockAPI) GetPluginID() string { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetPluginID") + } + + var r0 string + if rf, ok := ret.Get(0).(func() string); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(string) + } + + return r0 +} + +// MockAPI_GetPluginID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetPluginID' +type MockAPI_GetPluginID_Call struct { + *mock.Call +} + +// GetPluginID is a helper method to define mock.On call +func (_e *MockAPI_Expecter) GetPluginID() *MockAPI_GetPluginID_Call { + return &MockAPI_GetPluginID_Call{Call: _e.mock.On("GetPluginID")} +} + +func (_c *MockAPI_GetPluginID_Call) Run(run func()) *MockAPI_GetPluginID_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockAPI_GetPluginID_Call) Return(_a0 string) *MockAPI_GetPluginID_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockAPI_GetPluginID_Call) RunAndReturn(run func() string) *MockAPI_GetPluginID_Call { + _c.Call.Return(run) + return _c +} + // GetPluginStatus provides a mock function with given fields: id func (_m *MockAPI) GetPluginStatus(id string) (*model.PluginStatus, *model.AppError) { ret := _m.Called(id) diff --git a/server/public/stats.go b/server/public/stats.go index cc17649ce..6f25d3636 100644 --- a/server/public/stats.go +++ b/server/public/stats.go @@ -2,23 +2,23 @@ package public type CallsStats struct { // The total number calls. - TotalCalls int64 `json:"total_calls"` + TotalCalls int64 `json:"total_calls" yaml:"total_calls"` // The total number of active calls. - TotalActiveCalls int64 `json:"total_active_calls"` + TotalActiveCalls int64 `json:"total_active_calls" yaml:"total_active_calls"` // The total number of active sessions. - TotalActiveSessions int64 `json:"total_active_sessions"` + TotalActiveSessions int64 `json:"total_active_sessions" yaml:"total_active_sessions"` // The number of daily calls in the last 30 days. - CallsByDay map[string]int64 `json:"calls_by_day"` + CallsByDay map[string]int64 `json:"calls_by_day" yaml:"-"` // The number of monthly calls in the last 12 months. - CallsByMonth map[string]int64 `json:"calls_by_month"` + CallsByMonth map[string]int64 `json:"calls_by_month" yaml:"-"` // The distribution of calls in different channel types. - CallsByChannelType map[string]int64 `json:"calls_by_channel_type"` + CallsByChannelType map[string]int64 `json:"calls_by_channel_type" yaml:"-"` // The average calls duration in seconds. - AvgDuration int64 `json:"avg_duration"` + AvgDuration int64 `json:"avg_duration" yaml:"avg_duration"` // The average peak number of participants in calls. - AvgParticipants int64 `json:"avg_participants"` + AvgParticipants int64 `json:"avg_participants" yaml:"avg_participants"` // The number of daily recording jobs in the last 30 days. - RecordingJobsByDay map[string]int64 `json:"recording_jobs_by_day"` + RecordingJobsByDay map[string]int64 `json:"recording_jobs_by_day" yaml:"-"` // The number of monthly recording jobs in the last 12 months. - RecordingJobsByMonth map[string]int64 `json:"recording_jobs_by_month"` + RecordingJobsByMonth map[string]int64 `json:"recording_jobs_by_month" yaml:"-"` } diff --git a/server/session_test.go b/server/session_test.go index e0f8410d1..702e4dfb3 100644 --- a/server/session_test.go +++ b/server/session_test.go @@ -33,7 +33,7 @@ func TestAddUserSession(t *testing.T) { metrics: mockMetrics, configuration: &configuration{ clientConfig: clientConfig{ - DefaultEnabled: model.NewBool(true), + DefaultEnabled: model.NewPointer(true), }, }, sessions: map[string]*session{}, @@ -57,7 +57,7 @@ func TestAddUserSession(t *testing.T) { }, nil).Once() var cs *callState - state, err := p.addUserSession(cs, model.NewBool(false), "userID", "connID", "channelID", "", model.ChannelTypeOpen) + state, err := p.addUserSession(cs, model.NewPointer(false), "userID", "connID", "channelID", "", model.ChannelTypeOpen) require.Nil(t, state) require.EqualError(t, err, "calls are disabled in the channel") }) @@ -78,7 +78,7 @@ func TestAddUserSession(t *testing.T) { &model.WebsocketBroadcast{UserId: "userA", ChannelId: "channelID", ReliableClusterSend: true}).Once() // Start call - retState, err := p.addUserSession(nil, model.NewBool(true), "userA", "connA", "channelID", "", model.ChannelTypeOpen) + retState, err := p.addUserSession(nil, model.NewPointer(true), "userA", "connA", "channelID", "", model.ChannelTypeOpen) require.NoError(t, err) require.NotNil(t, retState) require.Equal(t, map[string]struct{}{"userA": {}}, retState.Props.Participants) @@ -94,7 +94,7 @@ func TestAddUserSession(t *testing.T) { }) require.NoError(t, err) - retState2, err := p.addUserSession(retState, model.NewBool(true), "userB", "connB", "channelID", "", model.ChannelTypeOpen) + retState2, err := p.addUserSession(retState, model.NewPointer(true), "userB", "connB", "channelID", "", model.ChannelTypeOpen) require.NotNil(t, retState2) require.EqualError(t, err, "failed to create call session: failed to run query: pq: duplicate key value violates unique constraint \"calls_sessions_pkey\"") @@ -120,7 +120,7 @@ func TestAddUserSession(t *testing.T) { Message: "app.add_user_session.group_calls_not_allowed_error", }).Return(nil).Once() - retState, err := p.addUserSession(nil, model.NewBool(true), "userA", "connA", "channelID", "", model.ChannelTypeOpen) + retState, err := p.addUserSession(nil, model.NewPointer(true), "userA", "connA", "channelID", "", model.ChannelTypeOpen) require.Equal(t, errGroupCallsNotAllowed, err) require.Nil(t, retState) }) @@ -131,7 +131,7 @@ func TestAddUserSession(t *testing.T) { Message: "app.add_user_session.group_calls_not_allowed_error", }).Return(nil).Once() - retState, err := p.addUserSession(nil, model.NewBool(true), "userA", "connA", "channelID", "", model.ChannelTypePrivate) + retState, err := p.addUserSession(nil, model.NewPointer(true), "userA", "connA", "channelID", "", model.ChannelTypePrivate) require.Equal(t, errGroupCallsNotAllowed, err) require.Nil(t, retState) }) @@ -142,7 +142,7 @@ func TestAddUserSession(t *testing.T) { Message: "app.add_user_session.group_calls_not_allowed_error", }).Return(nil).Once() - retState, err := p.addUserSession(nil, model.NewBool(true), "userA", "connA", "channelID", "", model.ChannelTypeGroup) + retState, err := p.addUserSession(nil, model.NewPointer(true), "userA", "connA", "channelID", "", model.ChannelTypeGroup) require.Equal(t, errGroupCallsNotAllowed, err) require.Nil(t, retState) }) @@ -152,7 +152,7 @@ func TestAddUserSession(t *testing.T) { mockAPI.On("PublishWebSocketEvent", wsEventCallHostChanged, mock.Anything, &model.WebsocketBroadcast{UserId: "userA", ChannelId: "channelID", ReliableClusterSend: true}).Once() - retState, err := p.addUserSession(nil, model.NewBool(true), "userA", "connA", "channelID", "", model.ChannelTypeDirect) + retState, err := p.addUserSession(nil, model.NewPointer(true), "userA", "connA", "channelID", "", model.ChannelTypeDirect) require.NoError(t, err) require.NotNil(t, retState) require.Equal(t, map[string]struct{}{"userA": {}}, retState.Props.Participants) diff --git a/server/support_packet.go b/server/support_packet.go new file mode 100644 index 000000000..8039823d2 --- /dev/null +++ b/server/support_packet.go @@ -0,0 +1,42 @@ +// Copyright (c) 2022-present Mattermost, Inc. All Rights Reserved. +// See LICENSE.txt for license information. + +package main + +import ( + "path/filepath" + + "github.com/pkg/errors" + "gopkg.in/yaml.v3" + + "github.com/mattermost/mattermost-plugin-calls/server/public" + "github.com/mattermost/mattermost/server/public/model" + "github.com/mattermost/mattermost/server/public/plugin" +) + +type SupportPacket struct { + Version string `yaml:"version"` + + *public.CallsStats +} + +func (p *Plugin) GenerateSupportData(_ *plugin.Context) ([]*model.FileData, error) { + stats, err := p.store.GetCallsStats() + if err != nil { + return nil, errors.Wrap(err, "failed to get calls stats") + } + + diagnostics := SupportPacket{ + Version: manifest.Version, + CallsStats: stats, + } + body, err := yaml.Marshal(diagnostics) + if err != nil { + return nil, errors.Wrap(err, "failed to marshal diagnostics") + } + + return []*model.FileData{{ + Filename: filepath.Join(manifest.Id, "diagnostics.yaml"), + Body: body, + }}, nil +} diff --git a/server/utils_test.go b/server/utils_test.go index 93a5d2f6d..a16881fd5 100644 --- a/server/utils_test.go +++ b/server/utils_test.go @@ -166,13 +166,13 @@ func TestTruncateString(t *testing.T) { func TestPlugin_canSendPushNotifications(t *testing.T) { config := &model.Config{ EmailSettings: model.EmailSettings{ - SendPushNotifications: model.NewBool(true), - PushNotificationServer: model.NewString(model.MHPNS), + SendPushNotifications: model.NewPointer(true), + PushNotificationServer: model.NewPointer(model.MHPNS), }, } license := &model.License{ Features: &model.Features{ - MHPNS: model.NewBool(true), + MHPNS: model.NewPointer(true), }, } tests := []struct { @@ -191,7 +191,7 @@ func TestPlugin_canSendPushNotifications(t *testing.T) { name: "no push notification server", config: &model.Config{ EmailSettings: model.EmailSettings{ - SendPushNotifications: model.NewBool(true), + SendPushNotifications: model.NewPointer(true), PushNotificationServer: nil, }}, license: nil, @@ -201,8 +201,8 @@ func TestPlugin_canSendPushNotifications(t *testing.T) { name: "push notification server blank", config: &model.Config{ EmailSettings: model.EmailSettings{ - SendPushNotifications: model.NewBool(true), - PushNotificationServer: model.NewString(""), + SendPushNotifications: model.NewPointer(true), + PushNotificationServer: model.NewPointer(""), }}, license: nil, want: nil, @@ -211,8 +211,8 @@ func TestPlugin_canSendPushNotifications(t *testing.T) { name: "push notifications set to false", config: &model.Config{ EmailSettings: model.EmailSettings{ - SendPushNotifications: model.NewBool(false), - PushNotificationServer: model.NewString(model.MHPNS), + SendPushNotifications: model.NewPointer(false), + PushNotificationServer: model.NewPointer(model.MHPNS), }}, license: nil, want: nil, @@ -228,7 +228,7 @@ func TestPlugin_canSendPushNotifications(t *testing.T) { config: config, license: &model.License{ Features: &model.Features{ - MHPNS: model.NewBool(false), + MHPNS: model.NewPointer(false), }, }, want: errors.New("push notifications have been disabled. Update your license or go to System Console > Environment > Push Notification Server to use a different server"), diff --git a/server/websocket.go b/server/websocket.go index e5474b1af..f926c64e8 100644 --- a/server/websocket.go +++ b/server/websocket.go @@ -700,7 +700,7 @@ func (p *Plugin) handleJoin(userID, connID, authSessionID string, joinData calls } var callsEnabled *bool if callsChannel != nil { - callsEnabled = model.NewBool(callsChannel.Enabled) + callsEnabled = model.NewPointer(callsChannel.Enabled) } addSessionToCall := func(state *callState) *callState { diff --git a/server/websocket_test.go b/server/websocket_test.go index 77c42c425..791bf7903 100644 --- a/server/websocket_test.go +++ b/server/websocket_test.go @@ -649,7 +649,7 @@ func TestHandleJoin(t *testing.T) { metrics: mockMetrics, configuration: &configuration{ clientConfig: clientConfig{ - DefaultEnabled: model.NewBool(true), + DefaultEnabled: model.NewPointer(true), }, }, sessions: map[string]*session{},