[MM-48391] Store the server info in the export version line (#21709)

Этот коммит содержится в:
Tim Scheuermann
2022-11-28 17:35:47 +01:00
коммит произвёл GitHub
родитель 7c6d487cf3
Коммит 6965585aa8
2 изменённых файлов: 19 добавлений и 0 удалений

Просмотреть файл

@@ -7,11 +7,13 @@ import (
"archive/zip"
"context"
"encoding/json"
"fmt"
"io"
"net/http"
"os"
"path/filepath"
"strings"
"time"
"github.com/pkg/errors"
@@ -157,9 +159,17 @@ func (a *App) exportWriteLine(w io.Writer, line *imports.LineImportData) *model.
func (a *App) exportVersion(writer io.Writer) *model.AppError {
version := 1
info := &imports.VersionInfoImportData{
Generator: "mattermost-server",
Version: fmt.Sprintf("%s (%s, enterprise: %s)", model.CurrentVersion, model.BuildHash, model.BuildEnterpriseReady),
Created: time.Now().Format(time.RFC3339Nano),
}
versionLine := &imports.LineImportData{
Type: "version",
Version: &version,
Info: info,
}
return a.exportWriteLine(writer, versionLine)