mirror of
https://github.com/ngoduykhanh/wireguard-ui.git
synced 2025-05-23 00:15:19 +03:00
Add ForwardMark to global settings (#173)
This commit is contained in:
parent
100c4ee1f4
commit
a5fdb1ad1d
7 changed files with 30 additions and 4 deletions
|
@ -27,6 +27,7 @@ const (
|
|||
DefaultDNS = "1.1.1.1"
|
||||
DefaultMTU = 1450
|
||||
DefaultPersistentKeepalive = 15
|
||||
DefaultForwardMark = "0xca6c"
|
||||
DefaultConfigFilePath = "/etc/wireguard/wg0.conf"
|
||||
UsernameEnvVar = "WGUI_USERNAME"
|
||||
PasswordEnvVar = "WGUI_PASSWORD"
|
||||
|
|
|
@ -56,11 +56,17 @@ func BuildClientConfig(client model.Client, server model.Server, setting model.G
|
|||
peerPersistentKeepalive = fmt.Sprintf("PersistentKeepalive = %d\n", setting.PersistentKeepalive)
|
||||
}
|
||||
|
||||
forwardMark := ""
|
||||
if setting.ForwardMark != DefaultForwardMark {
|
||||
forwardMark = fmt.Sprintf("FwMark = %s\n", setting.ForwardMark)
|
||||
}
|
||||
|
||||
// build the config as string
|
||||
strConfig := "[Interface]\n" +
|
||||
clientAddress +
|
||||
clientPrivateKey +
|
||||
clientDNS +
|
||||
forwardMark +
|
||||
"\n[Peer]\n" +
|
||||
peerPublicKey +
|
||||
peerPresharedKey +
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue