[client] Add block lan access flag for routers (#3171)

This commit is contained in:
Viktor Liu
2025-01-15 17:39:47 +01:00
committed by GitHub
parent 5a82477d48
commit 78795a4a73
9 changed files with 475 additions and 343 deletions

View File

@ -66,6 +66,8 @@ type ConfigInput struct {
DisableServerRoutes *bool
DisableDNS *bool
DisableFirewall *bool
BlockLANAccess *bool
}
// Config Configuration type
@ -89,6 +91,8 @@ type Config struct {
DisableDNS bool
DisableFirewall bool
BlockLANAccess bool
// SSHKey is a private SSH key in a PEM format
SSHKey string
@ -455,6 +459,16 @@ func (config *Config) apply(input ConfigInput) (updated bool, err error) {
updated = true
}
if input.BlockLANAccess != nil && *input.BlockLANAccess != config.BlockLANAccess {
if *input.BlockLANAccess {
log.Infof("blocking LAN access")
} else {
log.Infof("allowing LAN access")
}
config.BlockLANAccess = *input.BlockLANAccess
updated = true
}
if input.ClientCertKeyPath != "" {
config.ClientCertKeyPath = input.ClientCertKeyPath
updated = true