mirror of
https://github.com/ngoduykhanh/wireguard-ui.git
synced 2025-05-23 00:15:19 +03:00
Fix for fwmark (#279)
This commit is contained in:
parent
b8341dd36f
commit
b80c44af43
7 changed files with 17 additions and 37 deletions
|
@ -30,7 +30,7 @@ const (
|
|||
DefaultDNS = "1.1.1.1"
|
||||
DefaultMTU = 1450
|
||||
DefaultPersistentKeepalive = 15
|
||||
DefaultForwardMark = "0xca6c"
|
||||
DefaultFirewallMark = "0xca6c" // i.e. 51820
|
||||
DefaultConfigFilePath = "/etc/wireguard/wg0.conf"
|
||||
UsernameEnvVar = "WGUI_USERNAME"
|
||||
PasswordEnvVar = "WGUI_PASSWORD"
|
||||
|
@ -40,7 +40,7 @@ const (
|
|||
DNSEnvVar = "WGUI_DNS"
|
||||
MTUEnvVar = "WGUI_MTU"
|
||||
PersistentKeepaliveEnvVar = "WGUI_PERSISTENT_KEEPALIVE"
|
||||
ForwardMarkEnvVar = "WGUI_FORWARD_MARK"
|
||||
FirewallMarkEnvVar = "WGUI_FIREWALL_MARK"
|
||||
ConfigFilePathEnvVar = "WGUI_CONFIG_FILE_PATH"
|
||||
LogLevel = "WGUI_LOG_LEVEL"
|
||||
ServerAddressesEnvVar = "WGUI_SERVER_INTERFACE_ADDRESSES"
|
||||
|
|
|
@ -65,18 +65,12 @@ func BuildClientConfig(client model.Client, server model.Server, setting model.G
|
|||
peerPersistentKeepalive = fmt.Sprintf("PersistentKeepalive = %d\n", setting.PersistentKeepalive)
|
||||
}
|
||||
|
||||
forwardMark := ""
|
||||
if setting.ForwardMark != "" {
|
||||
forwardMark = fmt.Sprintf("FwMark = %s\n", setting.ForwardMark)
|
||||
}
|
||||
|
||||
// build the config as string
|
||||
strConfig := "[Interface]\n" +
|
||||
clientAddress +
|
||||
clientPrivateKey +
|
||||
clientDNS +
|
||||
clientMTU +
|
||||
forwardMark +
|
||||
"\n[Peer]\n" +
|
||||
peerPublicKey +
|
||||
peerPresharedKey +
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue