EmbarkStudios / wg-ui

WireGuard Web UI for self-serve client configurations, with optional auth.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Create clientConfig name at creation.

spetzreborn opened this issue · comments

Is your feature request related to a problem? Please describe.

We want our users to have good and descriptive names for their client configs. Mainly so it it intuitive for the users to use one config per device and not share between devices, but also as an easy way for administrators and support to locate correct client config for the user.

Describe the solution you'd like

From a user perspective:

  • Log into wg-ui
  • Click on add
  • An popup ask for the name of the config (perhaps defaulting to the device name?)
  • The config is created

On a technical level this could be done by changing the signature

From
config.go:
func NewClientConfig(ip net.IP) *ClientConfig {

To
config.go:
func NewClientConfig(ip net.IP, name string) *ClientConfig {

And allowing

server.go:
func (s *Server) CreateClient(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {

to take a parameter of "name".

Lastly letting the front end application handle the popup to ask the user for name of the config.

Additional context

We can spend time on this issue, but we want to do it in a way that can be merged upstream and not our local fork. So we would like feedback if this is a approved way forward.

This sounds like a very good feature. Would happily merge it to master. :)

Here you go! :)
Happy Easter!

I've introduced 2 bugs in the PR, but fixed them in 7d1c38b I did not want to amend or squash them as the PR was alive. But if you want to merge I suggest they be squashed together.

I have tried to fix the error checks, but I do not know that the docker build is failing on.
The file permission or bindata_assetfs I have not touched in this pull request.