EmbarkStudios / wg-ui

WireGuard Web UI for self-serve client configurations, with optional auth.
Apache License 2.0
1.5k stars 129 forks source link

Add wireguard client default MTU configuration #184

Closed phil535 closed 1 year ago

phil535 commented 1 year ago

This feature adds the ability to configure the default MTU of your wireguard client configurations using the default kingpin flags (ENV vars & CLI args).

Client MTU configuration was also implemented in the web API but not in the web UI.

A new MTU field was introduces in the ClientConfiguration struct.

The migration of old ServerConfiguration gets executed at startup and works as follows: If any client MTU has the value 0 (uninitialized default value), the client MTU get set to the MTU value introduced in this feature. If this MTU value of this feature is invalid, the client MTU gets set to 1420. If any MTU value was changed, the server configuration is saved.

The MTU entry in the wireguard client configuration (download/QR code) only gets added if the client configuration has a value different from 1420.

The feature was tested locally and successfully builds using docker.

This feature is acts as counterpart to the server MTU configuration pull request.