add PersistentKeepalive config to server-side Peer config (#515)

This commit is contained in:
Khanh Ngo 2023-12-31 21:08:13 +01:00 committed by GitHub
parent 45849a2aee
commit 769883f020
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 7 deletions

View file

@ -8,8 +8,8 @@ A web user interface to manage your WireGuard setup.
- Friendly UI - Friendly UI
- Authentication - Authentication
- Manage extra client information (name, email, etc) - Manage extra client information (name, email, etc.)
- Retrieve client config using QR code / file / email - Retrieve client config using QR code / file / email / Telegram
![wireguard-ui 0.3.7](https://user-images.githubusercontent.com/37958026/177041280-e3e7ca16-d4cf-4e95-9920-68af15e780dd.png) ![wireguard-ui 0.3.7](https://user-images.githubusercontent.com/37958026/177041280-e3e7ca16-d4cf-4e95-9920-68af15e780dd.png)
@ -195,8 +195,7 @@ Set `WGUI_MANAGE_RESTART=true` to manage Wireguard interface restarts.
Using `WGUI_MANAGE_START=true` can also replace the function of `wg-quick@wg0` service, to start Wireguard at boot, by Using `WGUI_MANAGE_START=true` can also replace the function of `wg-quick@wg0` service, to start Wireguard at boot, by
running the container with `restart: unless-stopped`. These settings can also pick up changes to Wireguard Config File running the container with `restart: unless-stopped`. These settings can also pick up changes to Wireguard Config File
Path, after restarting the container. Please make sure you have `--cap-add=NET_ADMIN` in your container config to make Path, after restarting the container. Please make sure you have `--cap-add=NET_ADMIN` in your container config to make
this this feature work.
feature work.
## Build ## Build
@ -214,7 +213,9 @@ or
docker compose build --build-arg=GIT_COMMIT=$(git rev-parse --short HEAD) docker compose build --build-arg=GIT_COMMIT=$(git rev-parse --short HEAD)
``` ```
:information_source: A container image is avaialble on [Docker Hub](https://hub.docker.com/r/ngoduykhanh/wireguard-ui) which you can pull and use :information_source: A container image is available on [Docker Hub](https://hub.docker.com/r/ngoduykhanh/wireguard-ui)
which you can pull and use
``` ```
docker pull ngoduykhanh/wireguard-ui docker pull ngoduykhanh/wireguard-ui
```` ````
@ -228,6 +229,7 @@ Prepare the assets directory
``` ```
Then build your executable Then build your executable
```sh ```sh
go build -o wireguard-ui go build -o wireguard-ui
``` ```

View file

@ -22,7 +22,8 @@ Table = {{ .globalSettings.Table }}
# Update at: {{ .Client.UpdatedAt }} # Update at: {{ .Client.UpdatedAt }}
[Peer] [Peer]
PublicKey = {{ .Client.PublicKey }} PublicKey = {{ .Client.PublicKey }}
{{if .Client.PresharedKey }}PresharedKey = {{ .Client.PresharedKey }}{{end}} {{if .Client.PresharedKey}}PresharedKey = {{ .Client.PresharedKey }}{{end}}
AllowedIPs = {{$first :=true}}{{range .Client.AllocatedIPs }}{{if $first}}{{$first = false}}{{else}},{{end}}{{.}}{{end}}{{range .Client.ExtraAllowedIPs }},{{.}}{{end}} AllowedIPs = {{$first :=true}}{{range .Client.AllocatedIPs }}{{if $first}}{{$first = false}}{{else}},{{end}}{{.}}{{end}}{{range .Client.ExtraAllowedIPs }},{{.}}{{end}}
{{if .Client.Endpoint }}Endpoint = {{ .Client.Endpoint }}{{end}} {{if $.globalSettings.PersistentKeepalive}}PersistentKeepalive = {{ $.globalSettings.PersistentKeepalive }}{{end}}
{{if .Client.Endpoint}}Endpoint = {{ .Client.Endpoint }}{{end}}
{{end}}{{end}} {{end}}{{end}}