OVERVIEW
Support Packet Generation tool will allow users to grab information about their Mattermost instance to provide to the support team to save the trouble for support asking manually for this information. It is in the hopes of increasing productivity and making the process of getting information from a customer faster and easier.
UPDATE DECEMEBER 18 2020: After a meeting with Katie and Michael, it was decided that the code will be directly implemented in the codebase without a plugin. The people who will have access to it is anyone who access to the system console (or any Admin roles).
The reason it was decided that putting it directly in the code base rather than a plugin makes more sense is because
We wanted it somewhere in the system console. I’ve only ever seen plugins implement stuff in chat facing side whether as a slash command or UI component. I believe we don’t have the infrastructure setup such that plugins can inject code into the system console which could add extra work. Ask Integrations if we have this or not .
We noticed that we already have a
commercial support
link in the dropdown in the hamburger menu of the system console which leads you the a generic Mattermost support webpage. We decided that it makes most sense to take that and improve on it. This allows us to take something existing within Mattermost which isn’t all that helpful and improve and make it better. Phrase it in a more positive way, mention how you can take it and make more improvePersonally, only having done 1 plugin in the past which was server sided slash command, there will be some time spent learning how the injection of code into the webapp works and this may take time to learn and get familiar with. This is not valid as someone else could be writing it
GOALS
Make it easier for support to gather the information they need by providing an downloadable zip file that provides
API endpoint that responds with text file expand more
Ask support about the format they want since they do a lot of scripting. Text or Json? Verify with them
// Could have an api endpoint with json payload.
SCOPE
Mention phase 2 is out of scope
In:
Out:
High-level Architecture
Developers Perspective
Describe how it works, hit 1? hit 2? existing endpoint or not?
Permissions
Anyone who has access to system console (any admin role) should be allowed to do this.
Schema
No database changes required
REST API
GET /api4/system/generate_support_packet
Explain response , what files it will include, the format of the files, give an example of what the response is going to looks like. Make sure zip file name is unique and how to name it.
Server OS:
In golang, we can use runtime.GOOS
to get the operating system which the server is running on.
Although not mentioned in the MVP, we can use runtime.GOARCH
to get the architecture of the server. (ex. amd64)
Database Type:
In the store, we have a function available called DriverName()
which returns either mysql
or postgres
. This is what we use elsewhere to determine if our database is either mysql
or postgres
.
(*SqlChannelStore).DriverName()
Database Version:
In the database, we have a table called Systems
which we can query to get the version.
SELECT systems WHERE name == Version
List plugins installed (including versions) (JSON In text?? make this a separate file?? plugins.json):
We can do a
response, err := c.App.GetPlugins() if err != nil { c.Err = err return }
which when we convert to JSON
will return something like this
{ "active":[ ], "inactive":[ { "id":"antivirus", "name":"Antivirus", "description":"Antivirus plugin for scanning uploaded files.", "version":"0.1.2", "server":{ "executables":{ "linux-amd64":"server/dist/plugin-linux-amd64", "darwin-amd64":"server/dist/plugin-darwin-amd64", "windows-amd64":"server/dist/plugin-windows-amd64.exe" }, "executable":"" }, "settings_schema":{ "header":"Antivirus plugin for scanning uploaded files to Mattermost, uses ClamAV to scan files. See [documentation here](https://github.com/mattermost/mattermost-plugin-antivirus)", "footer":"", "settings":[ { "key":"ClamavHostPort", "display_name":"ClamAV - Host and Port", "type":"text", "help_text":"The hostname and port to connect to clamd", "placeholder":"localhost:3310", "default":"localhost:3310" }, { "key":"ScanTimeoutSeconds", "display_name":"Scan Timeout (seconds)", "type":"number", "help_text":"How long the virus scan can take before giving up.", "placeholder":"10", "default":10 } ] } } ] }
LDAP Vendor & LDAP Version:
Due to the limited support for retrieving these and complexities that arise when dealing with different vendors and their specific implementation, the best we can do is query for vendorName
and vendorVersion
and provide those if anything return.
Elastic Search Server Version:
In elasticsearch.go in enterprise, in the Start() function, we are already getting the version and storing it in a variable called version
. It would be a matter of storing that in a new field called fullVersion
and writing a function which returns that since currently version
field is only storing the major version instead of the full version.
Elastic Search Plugins:
The library we are using for Elastic Search (https://github.com/olivere/elastic )
already has this implemented (https://github.com/olivere/elastic/blob/v6.2.35/plugins.go#L24)
Log File:
Describe this is an example of how you retrieve the mattermost.log
file to be attached to the zip.
if *s.Config().LogSettings.EnableFile { logFile := utils.GetLogFileLocation(*s.Config().LogSettings.FileLocation) file, err := os.Open(logFile) // Write that file into the zip the user will download }
Active Config Setting (Sanitized Config.json or something, but make sure it is a separate file!!, have it in the example!)
A matter of calling c.App.GetSanitizedConfig()
as it already seems to scrub out all confidential information
Designs can be found at https://www.figma.com/file/ck3EfTynW7nrRlkJGCYKRL/Support-Packet-Request .
Regarding debug level, check to see if their out logs to file is enabled and if the file log levels is set to debug. If not, then let’s show the message in the design to encourage them to enable it and set it to debug and try to recreate their issue to provide us with the most amount of information.
Specify that this is simple modal with translated text
CLI
Zip file creation not accessible via CLI in any of the current phases.
Talk to Kaite / Support team and ask them about it.
Webapp only
Mobile and Webapp
Mobile does not have anything because it is only accessible in the system console
Performance
No performance impact expected as this is simple/request response that is retrieving information.
CREDITS
Big thanks to Scott Bishel and Martin Kraft for their help and support.