diff --git a/cmd/migration-tool/migration_035_and_older.go b/cmd/migration-tool/migration_035_and_older.go index ea3f327..33d9723 100644 --- a/cmd/migration-tool/migration_035_and_older.go +++ b/cmd/migration-tool/migration_035_and_older.go @@ -106,10 +106,6 @@ func (u *migrationTool) Migrate() error { return err } - if err := migrateServerSection(legacyConfigFile, newConfigFile); err != nil { - return err - } - _logger.Info("Saving new config ...") return newConfigFile.WriteConfig() } @@ -143,12 +139,3 @@ func migrateAppSection(legacyConfigFile *ini.File, newConfigFile *viper.Viper) e return nil } - -func migrateServerSection(legacyConfigFile *ini.File, newConfigFile *viper.Viper) error { - if httpPort, err := legacyConfigFile.Section("server").GetKey("HttpPort"); err == nil { - _logger.Info("[server] HttpPort = %s", httpPort.Value()) - newConfigFile.Set(common.ConfigKeyGatewayPort, httpPort.Value()) - } - - return nil -} diff --git a/common/config.go b/common/config.go index 9b124f2..c46c6de 100644 --- a/common/config.go +++ b/common/config.go @@ -15,8 +15,6 @@ const ( ConfigKeyGatewayPort = "gateway.Port" ConfigKeyWWWPath = "gateway.WWWPath" ConfigKeyRuntimePath = "common.RuntimePath" - - DefaultGatewayPort = "80" ) func LoadConfig() (*viper.Viper, error) { @@ -26,7 +24,6 @@ func LoadConfig() (*viper.Viper, error) { config.SetDefault(ConfigKeyLogSaveName, "gateway") config.SetDefault(ConfigKeyLogFileExt, "log") - config.SetDefault(ConfigKeyGatewayPort, DefaultGatewayPort) config.SetDefault(ConfigKeyWWWPath, "/var/lib/casaos/www") config.SetDefault(ConfigKeyRuntimePath, "/var/run/casaos") // See https://refspecs.linuxfoundation.org/FHS_3.0/fhs/ch05s13.html