wg-portal icon indicating copy to clipboard operation
wg-portal copied to clipboard

Invalid PrivateKey when user self-provisions via GUI

Open kennethdhau opened this issue 2 years ago • 1 comments

Configurations which non-admin users generate (via the GUI, clicking the button in "Open My Profile > [.../peer/create]") have their PrivateKey set to "".

image

image

Configurations generated through the GUI by an admin user and configurations generated by any user via Swagger are unaffected and valid.

This is present on the latest version published on DockerHub (h44z/wg-portal:latest)

kennethdhau avatar Aug 07 '22 19:08 kennethdhau

I just recently stumbled over this issue too. Thought I did something wrong. Unfortunately the self provisioning function did not go away, when setting the corresponding ENV variable.

l4b4r4b4b4 avatar Aug 07 '22 20:08 l4b4r4b4b4

CONFIRMED! remove line https://github.com/h44z/wg-portal/blob/e6a8e2f2cfe15dcf7d7102510fa7b08572c81f18/internal/server/handlers_peer.go#L426

philippderdiedas avatar Oct 16 '22 00:10 philippderdiedas

Fixed now. If a user overrides the pre-set public key, the private-key will be removed (as it is not known). Otherwise the private key will stay in the configuration.

h44z avatar Oct 28 '22 16:10 h44z