perara / wg-manager

A easy to use WireGuard dashboard and management tool
MIT License
594 stars 74 forks source link

ipv4/ipv6 field validation, cannot untick ipv6, ... #66

Closed ethaniel86 closed 3 years ago

ethaniel86 commented 3 years ago

built wg-manager image from latest source today 5th Jan 2021. Few things won't work

  1. ip4/6 field validation is incorrect. I have to input 10.x.x.x/24 instead of 10.x.x.x, otherwise it won't let me proceed.
  2. cannot disable ipv6, if disabled container logs will throw error, then redirected to login page. Could be related to issue (1) Error: sqlalchemy.exc.IntegrityError: (sqlite3.IntegrityError) NOT NULL constraint failed: server.v6_subnet
AlexanderAllmendinger commented 3 years ago

I'm having the same issue. Because I need to put x.x.x.x/xx into the "IPv4 Address" and the "IPv6 Address" fields, while also specifying the Subnet in the Subnet dropdowns, it results in making calls while specifying the IP parameter like "x.x.x.x/xx/xx" e.g. in "ip link add wg0 .... -4 address add x.x.x.x/xx/xx ..." which makes the calls fail. Is there any work around how I can modify the stored addresses or subnet information to get it working?

perara commented 3 years ago

@AlexanderAllmendinger I've added a migration that should enable nullable on v6_subnet. Does this fix your problem? @ethaniel86 I suppose the latest version should fix your issue

AlexanderAllmendinger commented 3 years ago

man you're fast ... thanks for getting back that quick Unfortunately this didn't do the trick. I'm no web development expert but looking at your commit it looks like you are now allowing that the subnet fields are not set and therefore null. What I'm trying is creating a new configuration with default parameters (see screenshot). But even with default parameters the validation of the IP addresses for v4 and v6 are failing and therefore I cannot safe the configuration. Once I'm adding a /24 to the ip address fields, the validation works but the IP address is stored with 10.0.200.1/24/24 and therefore any follow up usage fails.

I hope this helps with understanding my issue. WireGuardScreenshot

perara commented 3 years ago

@AlexanderAllmendinger hopefully it is not working in the latest update

AlexanderAllmendinger commented 3 years ago

I just gave it another try, unfortunately still no luck... The validation still blocks entering only an IP Address. I hope I'm not missing a step. I basically pull your commits from the github project and then rebuild the frontend, backend and start the server. But I think that should work...

Anyway, when I'm entering only an IP, the validation is still failing and the field is marked red:

_AddWireGuardOnlyIp

The result of this failed validation is that the "Add Server" button is blocked:

_AddWireGuardBlockedAddServer

When I then add the /24 to the IP Address the validation succeeds:

_AddWireGuardIpAndSubnet

Then I can add the server:

_AddWireGuardAllowedAddServer

But still the stored address is wrong as it has the Subnet mask twice:

_AddWireGuardIpAndSubnetBadAddress
perara commented 3 years ago

I'm not able to replicate this. Are you building master branch?

a

then clicking "add server" works fine here: b

perara commented 3 years ago

Worth mentioning that it is indeed a bug that you can add subnet in that field.

AlexanderAllmendinger commented 3 years ago

Yes, I'm building the master branch and I can see you latest update in the history of my local repository ... but still to me the behavior didn't change yet. Are there any cache files I need to delete?

perara commented 3 years ago

That may very well be. there is an option for disabling cache in chrome (F12) and the cogwhell. if not you could try opening it in incognito mode and see if that works.

fre. 22. jan. 2021 kl. 14:13 skrev AlexanderAllmendinger < notifications@github.com>:

Yes, I'm building the master branch and I can see you latest update in the history of my local repository ... but still to me the behavior didn't change yet. Are there any cache files I need to delete?

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/perara/wg-manager/issues/66#issuecomment-765387261, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA4ZS7XKETY5I66YVV7IYSLS3F2VXANCNFSM4VOBMQAA .

-- [image: photo] Per-Arne Andersen PhD Candidate in Artificial Intelligence, University of Agder

+47 905 315 06 <+47+905+315+06> | per@sysx.no | per.andersen@uia.no

https://www.sysx.no | : dryper11 https://mail.google.com/mail/u/0/#SignatureSanitizer_SafeHtmlFilter_ Spikkelia 28 4821 Rykene, Norway http://scholar.google.no/citations?user=oPth46oAAAAJ&hl=no http://github.com/perara http://www.facebook.com/pereher http://www.linkedin.com/in/perara http://twitter.com/PerArneAndersen

AlexanderAllmendinger commented 3 years ago

Ok, I don't know what is being cached but there was something cached. I created a new system and now it works fine. Thanks for the fast responses and fix! You take care and stay well!