donaldzou / WGDashboard

Simple dashboard for WireGuard VPN written in Python & Vue.js
https://donaldzou.github.io/WGDashboard-Documentation/
Apache License 2.0
1.63k stars 248 forks source link

Error for default settings #490

Open qvipin opened 1 week ago

qvipin commented 1 week ago

Describe The Problem A suspected bug when trying to include all ipv6 ips in the default settings

Expected Error / Traceback

Please provide the error traceback here

Screenshot 2024-11-13 at 10 51 04 PM

To Reproduce enter what I had entered

OS Information:

DaanSelen commented 6 days ago

I tried this with the latest code. Could not reproduce.

image

Can you try again? Or how are you running this?

qvipin commented 6 days ago

On the sidebar when you go to the default settings for all configs not when you create a peer.

On Fri, Nov 15, 2024 at 7:12 AM dselen @.***> wrote:

I tried this with the latest code. Could not reproduce.

image.png (view on web) https://github.com/user-attachments/assets/2fdaa19a-0250-4431-94db-d7a90e4350dc

Can you try again? Or how are you running this?

— Reply to this email directly, view it on GitHub https://github.com/donaldzou/WGDashboard/issues/490#issuecomment-2478682492, or unsubscribe https://github.com/notifications/unsubscribe-auth/BC2GJXNNZX4GNAPXKM6TW5T2AXQMTAVCNFSM6AAAAABRX6HVX6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINZYGY4DENBZGI . You are receiving this because you authored the thread.Message ID: @.***>

DaanSelen commented 6 days ago

Can reproduce.

NOXCIS commented 22 hours ago

@donaldzou @DaanSelen

Broken Function

def __configValidation

Source of Problem

if key == "peer_endpoint_allowed_ip":
            value = value.split(",")
            for i in value:
                try:
                    ipaddress.ip_network(i, strict=False)
                except Exception as e:
                    return False, str(e)

Fix

if key == "peer_endpoint_allowed_ip":
            value = value.split(",")
            for i in value:
                i = i.strip()  # Remove leading/trailing whitespace
                try:
                    ipaddress.ip_network(i, strict=False)
                except Exception as e:
                    return False, str(e)

Tested Pass Cases

Tested Fail Cases

donaldzou commented 19 hours ago

Hi @NOXCIS, thanks for providing the fix. Will create a PR later to fix this :)