mirror of
https://github.com/ngoduykhanh/wireguard-ui.git
synced 2025-07-25 19:54:06 +03:00
Fix wg config template
This commit is contained in:
parent
58f1bd65bb
commit
d00d7bd8fe
4 changed files with 9 additions and 13 deletions
10
util/util.go
10
util/util.go
|
@ -313,15 +313,9 @@ func ValidateIPAllocation(serverAddresses []string, ipAllocatedList []string, ip
|
|||
}
|
||||
|
||||
// WriteWireGuardServerConfig to write Wireguard server config. e.g. wg0.conf
|
||||
func WriteWireGuardServerConfig(serverConfig model.Server, clientDataList []model.ClientData, globalSettings model.GlobalSetting) error {
|
||||
// create go rice box for wireguard config
|
||||
templateBox, err := rice.FindBox("../templates")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
func WriteWireGuardServerConfig(tmplBox *rice.Box, serverConfig model.Server, clientDataList []model.ClientData, globalSettings model.GlobalSetting) error {
|
||||
// read wg.conf template file to string
|
||||
tmplWireguardConf, err := templateBox.String("wg.conf")
|
||||
tmplWireguardConf, err := tmplBox.String("wg.conf")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue