package wireguard var ( emailTpl = ` Email Template
Hello
You probably requested VPN configuration. Here is {{.Client.Name}} configuration created {{.Client.Created.Format "Monday, 02 January 06 15:04:05 MST"}}. Scan the Qrcode or open attached configuration file in VPN client.
About WireGuard
WireGuard is an extremely simple yet fast and modern VPN that utilizes state-of-the-art cryptography. It aims to be faster, simpler, leaner, and more useful than IPsec, while avoiding the massive headache. It intends to be considerably more performant than OpenVPN.
Download WireGuard VPN Client
Wg Gen Web - Simple Web based configuration generator for WireGuard
More info on Github
` ClientCfgTpl = `[Interface] #{{ .Client.Identifier }} Address = {{ .Client.IPsStr }} PrivateKey = {{ .Client.PrivateKey }} {{ if ne (len .Server.DNS) 0 -}} DNS = {{ .Server.DNSStr }} {{- end }} {{ if ne .Server.Mtu 0 -}} MTU = {{.Server.Mtu}} {{- end}} [Peer] PublicKey = {{ .Server.PublicKey }} PresharedKey = {{ .Client.PresharedKey }} AllowedIPs = {{ .Client.AllowedIPsStr }} Endpoint = {{ .Server.Endpoint }} {{ if and (ne .Server.PersistentKeepalive 0) (not .Client.IgnorePersistentKeepalive) -}} PersistentKeepalive = {{.Server.PersistentKeepalive}} {{- end}} ` DeviceCfgTpl = `# Updated: {{ .Server.UpdatedAt }} / Created: {{ .Server.CreatedAt }} [Interface] {{- range .Server.IPs }} Address = {{ . }} {{- end }} ListenPort = {{ .Server.ListenPort }} PrivateKey = {{ .Server.PrivateKey }} {{ if ne .Server.Mtu 0 -}} MTU = {{.Server.Mtu}} {{- end}} PreUp = {{ .Server.PreUp }} PostUp = {{ .Server.PostUp }} PreDown = {{ .Server.PreDown }} PostDown = {{ .Server.PostDown }} {{ range .Clients }} {{ if not .DeactivatedAt -}} # {{.Identifier}} / {{.Email}} / Updated: {{.UpdatedAt}} / Created: {{.CreatedAt}} [Peer] PublicKey = {{ .PublicKey }} PresharedKey = {{ .PresharedKey }} AllowedIPs = {{ StringsJoin .IPs ", " }} {{- end }} {{ end }}` )