diff --git a/pkg/server/config.go b/pkg/server/config.go index f61877e..491c98e 100644 --- a/pkg/server/config.go +++ b/pkg/server/config.go @@ -24,9 +24,9 @@ type Config struct { Database string LogLevel string `yaml:"log_level"` Notice noticeConfig - rhttp.Config - DNS dns.Config - MySQL mysql.Config - RMI rmi.Config - FTP ftp.Config + HTTP rhttp.Config + DNS dns.Config + MySQL mysql.Config + RMI rmi.Config + FTP ftp.Config } diff --git a/pkg/server/server.go b/pkg/server/server.go index 87aa4d6..8f6b8c8 100644 --- a/pkg/server/server.go +++ b/pkg/server/server.go @@ -204,8 +204,8 @@ func New(c *Config) *Revsuit { if c.Token != "" { s.http.SetToken(c.Token) } - if c.IpHeader != "" { - s.http.SetIpHeader(c.IpHeader) + if c.HTTP.IpHeader != "" { + s.http.SetIpHeader(c.HTTP.IpHeader) } if c.Domain != "" { s.dns.SetServerDomain(c.Domain) diff --git a/pkg/server/settings.go b/pkg/server/settings.go index 7b97fc5..cb8503d 100644 --- a/pkg/server/settings.go +++ b/pkg/server/settings.go @@ -156,7 +156,7 @@ func (revsuit *Revsuit) getPlatformConfig(c *gin.Context) { res["ExternalIP"] = revsuit.config.ExternalIP res["Database"] = revsuit.config.Database res["LogLevel"] = revsuit.config.LogLevel - res["IpHeader"] = revsuit.config.IpHeader + res["IpHeader"] = revsuit.config.HTTP.IpHeader c.JSON(200, res) } @@ -194,8 +194,8 @@ func (revsuit *Revsuit) updatePlatformConfig(c *gin.Context) { log.Info("Update platform config [database] to %s", form["Database"]) } - if form["IpHeader"] != revsuit.config.IpHeader { - revsuit.config.IpHeader = form["IpHeader"] + if form["IpHeader"] != revsuit.config.HTTP.IpHeader { + revsuit.config.HTTP.IpHeader = form["IpHeader"] revsuit.http.SetIpHeader(form["IpHeader"]) log.Info("Update http config [ip_header] to %s", form["IpHeader"]) }