From 5fb4b1bc935bd273990779e1d4a680a563784df8 Mon Sep 17 00:00:00 2001 From: Joram Wilander Date: Fri, 23 Feb 2018 10:55:02 -0500 Subject: MM-8593 Default APIv3 to disabled for new installs (#8353) * Default APIv3 to disabled for new installs * Add EnableAPIv3 setting to client config * Enable APIv3 for needed tests --- api/apitestlib.go | 1 + config/default.json | 2 +- utils/config.go | 1 + web/web_test.go | 1 + 4 files changed, 4 insertions(+), 1 deletion(-) diff --git a/api/apitestlib.go b/api/apitestlib.go index 47691b2dd..92a7c0cc8 100644 --- a/api/apitestlib.go +++ b/api/apitestlib.go @@ -100,6 +100,7 @@ func setupTestHelper(enterprise bool) *TestHelper { *cfg.TeamSettings.MaxUsersPerTeam = 50 *cfg.RateLimitSettings.Enable = false cfg.EmailSettings.SendEmailNotifications = true + *cfg.ServiceSettings.EnableAPIv3 = true }) prevListenAddress := *th.App.Config().ServiceSettings.ListenAddress if testStore != nil { diff --git a/config/default.json b/config/default.json index 52413215e..cd170adef 100644 --- a/config/default.json +++ b/config/default.json @@ -22,7 +22,7 @@ "EnableOnlyAdminIntegrations": true, "EnablePostUsernameOverride": false, "EnablePostIconOverride": false, - "EnableAPIv3": true, + "EnableAPIv3": false, "EnableLinkPreviews": false, "EnableTesting": false, "EnableDeveloper": false, diff --git a/utils/config.go b/utils/config.go index afb2e758c..679e5f62c 100644 --- a/utils/config.go +++ b/utils/config.go @@ -346,6 +346,7 @@ func GenerateClientConfig(c *model.Config, diagnosticId string, license *model.L props["SiteURL"] = strings.TrimRight(*c.ServiceSettings.SiteURL, "/") props["WebsocketURL"] = strings.TrimRight(*c.ServiceSettings.WebsocketURL, "/") props["SiteName"] = c.TeamSettings.SiteName + props["EnableAPIv3"] = strconv.FormatBool(*c.ServiceSettings.EnableAPIv3) props["EnableTeamCreation"] = strconv.FormatBool(c.TeamSettings.EnableTeamCreation) props["EnableUserCreation"] = strconv.FormatBool(c.TeamSettings.EnableUserCreation) props["EnableOpenServer"] = strconv.FormatBool(*c.TeamSettings.EnableOpenServer) diff --git a/web/web_test.go b/web/web_test.go index 5bc69b697..373d47103 100644 --- a/web/web_test.go +++ b/web/web_test.go @@ -59,6 +59,7 @@ func Setup() *app.App { a.UpdateConfig(func(cfg *model.Config) { *cfg.TeamSettings.EnableOpenServer = true + *cfg.ServiceSettings.EnableAPIv3 = true }) return a -- cgit v1.2.3-1-g7c22