portainer/api/datastore/migrator/migrate_dbversion24.go

26 lines
600 B
Go
Raw Normal View History

2020-07-24 23:10:46 +00:00
package migrator
import (
portainer "github.com/portainer/portainer/api"
2020-07-24 23:10:46 +00:00
)
func (m *Migrator) updateSettingsToDB25() error {
migrateLog.Info("- updating settings")
2020-07-24 23:10:46 +00:00
legacySettings, err := m.settingsService.Settings()
if err != nil {
return err
}
if legacySettings.TemplatesURL == "" {
legacySettings.TemplatesURL = portainer.DefaultTemplatesURL
}
legacySettings.UserSessionTimeout = portainer.DefaultUserSessionTimeout
legacySettings.EnableTelemetry = true
2020-07-24 23:10:46 +00:00
legacySettings.AllowContainerCapabilitiesForRegularUsers = true
2020-07-24 23:10:46 +00:00
return m.settingsService.UpdateSettings(legacySettings)
}