donaldzou / WGDashboard

Simple dashboard for WireGuard VPN written in Python w/ Flask
Apache License 2.0
1.4k stars 202 forks source link

Invalid QR code #166

Open Quintasan opened 2 years ago

Quintasan commented 2 years ago

Describe The Problem

Android WireGuard client refuses to import via QR code with

WireGuard/TunnelImporter: Couldn't import tunnel: unkown section in Config

I also tried scanning the QR code using https://play.google.com/store/apps/details?id=de.markusfisch.android.binaryeye&hl=pl&gl=US which yields 03048812 instead of the configuration file as one would expect

donaldzou commented 2 years ago

Huh.. this is weird, what is the output of the QR code?

donaldzou commented 2 years ago

Done

donaldzou commented 2 years ago

This is what I got when I scan it

Quintasan commented 2 years ago

Fascinating, I'm running official WireGuard client from Google Play, and it fails to decode this. Decoding also fails with Binary Eye which usually outputs the contents of QR codes as is.

donaldzou commented 2 years ago

This is interesting lol, I never had this problem since i'm using an iOS device. I will look into it.

donaldzou commented 2 years ago

Fascinating, I'm running official WireGuard client from Google Play, and it fails to decode this. Decoding also fails with Binary Eye which usually outputs the contents of QR codes as is.

What is the output of the qrcode when you use a normal scanner?

donaldzou commented 2 years ago

Hi I've noticed that there are some part of the QR code did not show, around the border, could you try right click and save the qrcode and scan it again with wireguard? I used an android device to scan my own qrcode and it worked.

Quintasan commented 2 years ago

No dice. Still the same issue. I think this is a problem with the library used by WireGuard client, ZXing which fails to recognize this as a QR code.

Binary Eye: UPC-E code ZXing: UPC-e code

@donaldzou what phone did you use, what Android version? what WireGuard application version?

donaldzou commented 2 years ago

I was using a XiaoMi phone, android 11 and the newest wireguard version (just downloaded from playstore)

donaldzou commented 2 years ago

Screen Shot 2022-03-25 at 2 49 10 PM

Can u try this?

Quintasan commented 2 years ago

I created another peer for my Galaxy S10, and it has the same problem when using the WireGuard application. There must be some kind of issue with the way it deals with QR code recognition...

Quintasan commented 2 years ago

Screen Shot 2022-03-25 at 2 49 10 PM

Can u try this?

Worked almost instantly. I guess it's those filled-in squares at the edges that made the difference

donaldzou commented 2 years ago

Yes, the the qrcode on your side should looks similar to mine, you mind telling me what browser your are using?

Quintasan commented 2 years ago

Yes, the the qrcode on your side should looks similar to mine, you mind telling me what browser your are using?

Firefox 98.0.2 under Windows 10

Quintasan commented 2 years ago

FYI Chrome does the same shit

obraz

donaldzou commented 2 years ago

I used my windows laptop with Firefox and it looks totally fine😂😂image

donaldzou commented 2 years ago

FYI Chrome does the same shit

obraz

What if is something related to your Windows setting? Could you try log onto the dashboard with your phone?

Quintasan commented 2 years ago

Exactly the same issue happens when I go to the dashboard using my phone. At this point I consider it a problem with my installation.

donaldzou commented 2 years ago

do you mind to do python3 -m pip list | grep Flask-QRcode on your server and let me know the version number?

Quintasan commented 2 years ago

Flask-QRCode 3.0.0

donaldzou commented 2 years ago

This is very interesting... Python should have a same output across all different OS, that's why I choose to use python on this project... I will look into this...

donaldzou commented 2 years ago

Or maybe do a fresh install? If you want to

anboch commented 1 year ago

I've encountered an issue with scanning a QR code on a dark theme. It appears that adding white margins around the QR code is necessary.