Retrocompatiblity with EXTRA_SUBNETS key
This commit is contained in:
@@ -159,3 +159,10 @@ func (r *reader) GetVPNSP() (vpnServiceProvider models.VPNProvider, err error) {
|
||||
func (r *reader) GetVersionInformation() (enabled bool, err error) {
|
||||
return r.envParams.GetOnOff("VERSION_INFORMATION", libparams.Default("on"))
|
||||
}
|
||||
|
||||
func (r *reader) onRetroActive(oldKey, newKey string) {
|
||||
r.logger.Warn(
|
||||
"You are using the old environment variable %s, please consider changing it to %s",
|
||||
oldKey, newKey,
|
||||
)
|
||||
}
|
||||
|
||||
@@ -4,13 +4,19 @@ import (
|
||||
"fmt"
|
||||
"net"
|
||||
"strings"
|
||||
|
||||
libparams "github.com/qdm12/golibs/params"
|
||||
)
|
||||
|
||||
// GetOutboundSubnets obtains the CIDR subnets from the comma separated list of the
|
||||
// environment variable FIREWALL_OUTBOUND_SUBNETS.
|
||||
func (r *reader) GetOutboundSubnets() (outboundSubnets []net.IPNet, err error) {
|
||||
const key = "FIREWALL_OUTBOUND_SUBNETS"
|
||||
s, err := r.envParams.GetEnv(key)
|
||||
retroOption := libparams.RetroKeys(
|
||||
[]string{"EXTRA_SUBNETS"},
|
||||
r.onRetroActive,
|
||||
)
|
||||
s, err := r.envParams.GetEnv(key, retroOption)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
} else if s == "" {
|
||||
|
||||
Reference in New Issue
Block a user