Telegram support, send config button

This commit is contained in:
0xCA 2023-11-13 16:49:05 +05:00
parent c691f0733d
commit 4c6080b3fa
8 changed files with 335 additions and 19 deletions

View file

@ -19,6 +19,7 @@ import (
"time"
"github.com/ngoduykhanh/wireguard-ui/store"
"github.com/ngoduykhanh/wireguard-ui/telegram"
"golang.org/x/mod/sumdb/dirhash"
externalip "github.com/glendc/go-external-ip"
@ -28,7 +29,7 @@ import (
)
// BuildClientConfig to create wireguard client config string
func BuildClientConfig(client model.Client, server model.Server, setting model.GlobalSetting) string {
var BuildClientConfig telegram.BuildClientConfig = func(client model.Client, server model.Server, setting model.GlobalSetting) string {
// Interface section
clientAddress := fmt.Sprintf("Address = %s\n", strings.Join(client.AllocatedIPs, ","))
clientPrivateKey := fmt.Sprintf("PrivateKey = %s\n", client.PrivateKey)