config: drop multi-upstream-mode

This commit is contained in:
Simon Ser 2022-08-05 19:58:22 +02:00
parent 085f5c17a4
commit dde4ee9518
4 changed files with 0 additions and 19 deletions

View file

@ -90,7 +90,6 @@ func loadConfig() (*config.Server, *soju.Config, error) {
HTTPOrigins: raw.HTTPOrigins, HTTPOrigins: raw.HTTPOrigins,
AcceptProxyIPs: raw.AcceptProxyIPs, AcceptProxyIPs: raw.AcceptProxyIPs,
MaxUserNetworks: raw.MaxUserNetworks, MaxUserNetworks: raw.MaxUserNetworks,
MultiUpstream: raw.MultiUpstream,
UpstreamUserIPs: raw.UpstreamUserIPs, UpstreamUserIPs: raw.UpstreamUserIPs,
MOTD: motd, MOTD: motd,
} }

View file

@ -58,7 +58,6 @@ type Server struct {
AcceptProxyIPs IPSet AcceptProxyIPs IPSet
MaxUserNetworks int MaxUserNetworks int
MultiUpstream bool
UpstreamUserIPs []*net.IPNet UpstreamUserIPs []*net.IPNet
} }
@ -77,7 +76,6 @@ func Defaults() *Server {
Driver: "memory", Driver: "memory",
}, },
MaxUserNetworks: -1, MaxUserNetworks: -1,
MultiUpstream: true,
} }
} }
@ -159,16 +157,6 @@ func parse(cfg scfg.Block) (*Server, error) {
if srv.MaxUserNetworks, err = strconv.Atoi(max); err != nil { if srv.MaxUserNetworks, err = strconv.Atoi(max); err != nil {
return nil, fmt.Errorf("directive %q: %v", d.Name, err) return nil, fmt.Errorf("directive %q: %v", d.Name, err)
} }
case "multi-upstream-mode":
var str string
if err := d.ParseParams(&str); err != nil {
return nil, err
}
v, err := strconv.ParseBool(str)
if err != nil {
return nil, fmt.Errorf("directive %q: %v", d.Name, err)
}
srv.MultiUpstream = v
case "upstream-user-ip": case "upstream-user-ip":
if len(srv.UpstreamUserIPs) > 0 { if len(srv.UpstreamUserIPs) > 0 {
return nil, fmt.Errorf("directive %q: can only be specified once", d.Name) return nil, fmt.Errorf("directive %q: can only be specified once", d.Name)

View file

@ -161,10 +161,6 @@ The following directives are supported:
Path to the MOTD file. The bouncer MOTD is sent to clients which aren't Path to the MOTD file. The bouncer MOTD is sent to clients which aren't
bound to a specific network. By default, no MOTD is sent. bound to a specific network. By default, no MOTD is sent.
*multi-upstream-mode* true|false
Globally enable or disable multi-upstream mode. By default, multi-upstream
mode is enabled.
*upstream-user-ip* <cidr...> *upstream-user-ip* <cidr...>
Enable per-user IP addresses. One IPv4 range and/or one IPv6 range can be Enable per-user IP addresses. One IPv4 range and/or one IPv6 range can be
specified in CIDR notation. One IP address per range will be assigned to specified in CIDR notation. One IP address per range will be assigned to

View file

@ -139,7 +139,6 @@ type Config struct {
HTTPOrigins []string HTTPOrigins []string
AcceptProxyIPs config.IPSet AcceptProxyIPs config.IPSet
MaxUserNetworks int MaxUserNetworks int
MultiUpstream bool
MOTD string MOTD string
UpstreamUserIPs []*net.IPNet UpstreamUserIPs []*net.IPNet
} }
@ -183,7 +182,6 @@ func NewServer(db database.Database) *Server {
srv.config.Store(&Config{ srv.config.Store(&Config{
Hostname: "localhost", Hostname: "localhost",
MaxUserNetworks: -1, MaxUserNetworks: -1,
MultiUpstream: true,
}) })
return srv return srv
} }