Adding Upgrade to Enterprise version feature (#14539)

* Adding Upgrade to Enterprise version feature

* Addressing PR review comments, and adding some minor improvements

* Add tests file

* Addressing PR comments

* fix linter checks

* Storing and exposing the upgraded from TE info

* Fix showing errors on mac

* A more appropiate status code for not-supported upgrade

* Fixing tests

* Handling permissions errors

* More server logging around upgrade failures

* Apply text changes suggested from code review

Co-authored-by: Eric Sadur <57730300+esadur@users.noreply.github.com>

* Address PR review comments

* Only allow to restart the system after an upgrade

* Verify file signature before upgrade

* Adding limit to the downloaded file

* Simplifying the upgrade binary process with backup in memory

* Fixing backup/restore mechanism for the binary file

* Improve file permissions handling

* Askin the permissions for the right place (the parent directory)

* Fixing tests

* Addressing PR review comments

* Fix license headers

* Fixing retry layer

* Making it work on windows builds

* Adding license header

* Fixing 2 tests

* Fixing tests that need UpgradeFromTE System key mock

* Extracting i18n translation

* Apply suggestions from code review

Co-authored-by: Eric Sadur <57730300+esadur@users.noreply.github.com>

* Improving how the errors are written

* Fixing another error text

* Removing unneeded translation

* Fixing upgrade status strings

* Update i18n/en.json

Co-authored-by: Eric Sadur <57730300+esadur@users.noreply.github.com>

* Fixing tests

Co-authored-by: Eric Sadur <57730300+esadur@users.noreply.github.com>
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
Jesús Espino
2020-08-21 20:23:04 +02:00
коммит произвёл GitHub
родитель e6c1d5f75b
Коммит 7fe6c94eda
19 изменённых файлов: 746 добавлений и 1 удалений

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

@@ -2622,6 +2622,46 @@
"id": "api.templates.welcome_subject",
"translation": "[{{ .SiteName }}] You joined {{ .ServerURL }}"
},
{
"id": "api.upgrade_to_enterprise.already-done.app_error",
"translation": "You have already upgraded to Mattermost Enterprise Edition. Please restart the server to finish the upgrade."
},
{
"id": "api.upgrade_to_enterprise.already-enterprise.app_error",
"translation": "You cannot upgrade because you are already running Mattermost Enterprise Edition."
},
{
"id": "api.upgrade_to_enterprise.app_error",
"translation": "An upgrade to Mattermost Enterprise Edition is already running."
},
{
"id": "api.upgrade_to_enterprise.generic_error.app_error",
"translation": "Mattermost was unable to upgrade to Enterprise Edition."
},
{
"id": "api.upgrade_to_enterprise.invalid-permission.app_error",
"translation": "Mattermost was unable to upgrade to Enterprise Edition. The Mattermost system user {{.MattermostUsername}} does not have write access to the necessary binary file. A system administrator can update the file permissions by executing the following command on the server where Mattermost is installed:\n\n```\nchmod +w \"{{.Path}}\"\n```\n\nAfter changing the file permissions, try to upgrade Mattermost again. When you have upgraded and restarted, remember to restore the original binary file permissions:\n\n```\nchmod -w \"{{.Path}}\"\n```"
},
{
"id": "api.upgrade_to_enterprise.invalid-user-and-permission.app_error",
"translation": "Mattermost was unable to upgrade to Enterprise Edition. The Mattermost system user {{.MattermostUsername}} does not have write access to the necessary binary file. A system administrator can update the file permissions by executing the following command on the server where Mattermost is installed:\n\n```\nchown {{.MattermostUsername}} \"{{.Path}}\"\nchmod +w \"{{.Path}}\"\n```\n\nAfter changing the file permissions, try to upgrade Mattermost again. When you have upgraded and restarted, remember to restore the original binary file permissions:\n\n```\nchown {{.FileUsername}} \"{{.Path}}\"\nchmod -w \"{{.Path}}\"\n```"
},
{
"id": "api.upgrade_to_enterprise.invalid-user.app_error",
"translation": "Mattermost was unable to upgrade to Enterprise Edition. The Mattermost system user {{.MattermostUsername}} does not have write access to the necessary binary file. A system administrator can update the file permissions by executing the following command on the server where Mattermost is installed:\n\n```\nchown {{.MattermostUsername}} \"{{.Path}}\"\n```\n\nAfter changing the file permissions, try to upgrade Mattermost again. When you have upgraded and restarted, remember to restore the original binary file permissions:\n\n```\nchown {{.FileUsername}} \"{{.Path}}\"\n```"
},
{
"id": "api.upgrade_to_enterprise.system_not_supported.app_error",
"translation": "Mattermost was unable to upgrade to Enterprise Edition. This feature will only work on Linux systems with x86-64 architecture."
},
{
"id": "api.upgrade_to_enterprise_status.app_error",
"translation": "Mattermost was unable to upgrade to Enterprise Edition."
},
{
"id": "api.upgrade_to_enterprise_status.signature.app_error",
"translation": "Mattermost was unable to upgrade to Enterprise Edition. The digital signature of the downloaded binary file could not be verified."
},
{
"id": "api.user.activate_mfa.email_and_ldap_only.app_error",
"translation": "MFA is not available for this account type."