Skip to content

Commit

Permalink
Keep Proxied as legacy option, add warning and compatiablity
Browse files Browse the repository at this point in the history
  • Loading branch information
NHAS committed Dec 15, 2023
1 parent 8cdb429 commit 01e6762
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ type Config struct {
GID *int `json:",omitempty"`
CheckUpdates bool `json:",omitempty"`
NumberProxies int
Proxied bool
ExposePorts []string `json:",omitempty"`
NAT *bool

Expand Down Expand Up @@ -442,6 +443,13 @@ func load(path string) (c Config, err error) {
c.DownloadConfigFileName = "wg0.conf"
}

if c.Proxied {
log.Println("WARNING, Proxied setting is depreciated as it does not indicate how many reverse proxies we're behind (thus we cannot parse x-forwarded-for correctly), this will be removed in the next release")
log.Println("For no, setting NumberProxies = 1 and hoping that just works for you. Change your config!")

c.NumberProxies = 1
}

i, err := net.InterfaceByName(c.Wireguard.DevName)
if err == nil {
//A device already exists, so we're assuming it was externally set up (with something like wg-quick)
Expand Down

0 comments on commit 01e6762

Please sign in to comment.