mirror of https://github.com/portainer/portainer
26 lines
598 B
Go
26 lines
598 B
Go
package migrator
|
|
|
|
import (
|
|
portainer "github.com/portainer/portainer/api"
|
|
)
|
|
|
|
func (m *Migrator) updateSettingsToDB25() error {
|
|
migrateLog.Info("Updating settings")
|
|
|
|
legacySettings, err := m.settingsService.Settings()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
if legacySettings.TemplatesURL == "" {
|
|
legacySettings.TemplatesURL = portainer.DefaultTemplatesURL
|
|
}
|
|
|
|
legacySettings.UserSessionTimeout = portainer.DefaultUserSessionTimeout
|
|
legacySettings.EnableTelemetry = true
|
|
|
|
legacySettings.AllowContainerCapabilitiesForRegularUsers = true
|
|
|
|
return m.settingsService.UpdateSettings(legacySettings)
|
|
}
|