Skip to content

Commit

Permalink
remove migrating port from legacy casaos (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
tigerinus authored Sep 7, 2022
1 parent 59c5dd7 commit 17220e3
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 16 deletions.
13 changes: 0 additions & 13 deletions cmd/migration-tool/migration_035_and_older.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
Expand Down Expand Up @@ -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
}
3 changes: 0 additions & 3 deletions common/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ const (
ConfigKeyGatewayPort = "gateway.Port"
ConfigKeyWWWPath = "gateway.WWWPath"
ConfigKeyRuntimePath = "common.RuntimePath"

DefaultGatewayPort = "80"
)

func LoadConfig() (*viper.Viper, error) {
Expand All @@ -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

Expand Down

0 comments on commit 17220e3

Please sign in to comment.