GithubHelp home page GithubHelp logo

bndw / wifi-card Goto Github PK

View Code? Open in Web Editor NEW
6.5K 40.0 457.0 2.63 MB

πŸ“Ά Print a QR code for connecting to your WiFi (wificard.io)

Home Page: https://wificard.io

License: MIT License

Dockerfile 0.28% Makefile 0.66% HTML 2.69% JavaScript 94.53% CSS 1.74% Shell 0.11%
wifi react wificard dogs-over-cats qrcode

wifi-card's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

wifi-card's Issues

When scanned with different software, passwords can be compromised

When I scan a QR code using a mobile app, most of the results I get are a string:
WIFI:T:WEP;S:loadingf;P:dfdfdfdfffdfdf;;

Only some phones's cameras that can directly scan out wifi and can connect.

Most app systems come with a native browser that can scan the QR code and connect

Issue With Device Compatibility?

Howdy, I've tried to create one of these and print them out on sheets of stickers, however the QR scan doesn't appear to work on Android devices! Yet, iPhone devices can scan these and connect right up without any hindrance.

My settings on https://wificard.io/ were simply inputting my SSID, password, WPA2 security, and selecting that this would indeed be a hidden network.

I attempted QR scans with the camera apps on both an original Pixel (2016) sporting Android 9 (PQ3A.190801.002) as well as Pixel 4a sporting Android 11 (RQ2A.210505.002). Both devices do immediately recognize that this QR code is a wifi network to join, and upon clicking on the option to connect, I'm brought to the Wi-Fi settings/available networks screen where the loading lines just scroll across the top bar for about 2 seconds and then nothing happens! Repeated attempts yield same result, devices never find/connect to the network.

A friend and also my sister, who both have iPhones, can scan this, press the join link, and boom, immediately finds/connects to the network. What gives!? This is the worst because iPhone normies love to talk smack on Android users an this just adds insult to injury! (not that serious just joking)

Attached is my same card used throughout all this. Printed my card from the web app linked above on Aug 19 @ 4 PM EST.

Do Android devices have a different specification or protocol for interpreting QR codes or something?
WiFi Card - The Wolf of Emerald Street.pdf

Feature request: Option to select encryption mode

Hi,

There're some cases people create public networks and manage them with another way/device (like hotspots in hotels). Keeping password field mandatory basically prevents creating passwordless network cards.

It'd be nicer if there's an option to choose encryption, so based on selection password can be optional/ignored etc.

Here's the line that creates the qr value: https://github.com/bndw/wifi-card/blob/master/src/components/Card.js#L45
And here's more info about possible encryption values: https://en.wikipedia.org/wiki/QR_code#Joining_a_Wi%E2%80%91Fi_network

          β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ ssid
          β”‚           β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ encryption mode
          β”‚           β”‚                β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ password
          β”‚           β”‚                β”‚               β”Œβ”€β”€β”€β”€β”€ hidden/visible flag
          β”‚           β”‚                β”‚               β”‚
WIFI:S:<SSID>;T:<WEP|WPA|blank>;P:<PASSWORD>;H:<true|false|blank>;

Select how many cards are printed

It can be nice to have an input to select how many cards should be printed.

So you dont have to print mutlipe time to get more than 1 card

Docs: Language contribution guide

It would be helpful to document the process of contributing a translation. Off the top of my head, the steps are roughly:

  1. Add a translation to ./src/i18n.js
  2. Add the language option to ./src/app.js. Use the format e.g. French (Français)
  3. Run make fmt.write to format your changes with Prettier

Please use a seriffed font for password field

My wifi password has a capital "i" in it. Would be great if a seriffed font was used to display the password, since it is virtually indistinguishable from a lowercase "L" with a sans-serif font.

I understand the goal of this project is to NOT type the wifi password, but I'm going to assume that there will be cases when people type it in manually.

Check for non-empty Network Name on Print

There is currently no check for a valid network name when the user prints the card. A valid Network Name would simply be a non-empty string in this case. Not that anyone would print a card without inputting a network name πŸ˜† , but this check should be added for completeness.

EDIT: An alert should also be added in the event that a Network Name is not supplied by the user.

Rotate doesn't seem to work

I click rotate on the card, it returns a blank screen. Tested in Firefox and Chrome.

Returns an error message in the JS console:

Error: Minified React error #62; visit https://reactjs.org/docs/error-decoder.html?invariant=62&args[]= for the full message or use the non-minified dev environment for full errors and additional helpful warnings.
    React 8
    unstable_runWithPriority scheduler.production.min.js:19
    React 5
react-dom.production.min.js:209:194

Uncaught Error: Minified React error #62; visit https://reactjs.org/docs/error-decoder.html?invariant=62&args[]= for the full message or use the non-minified dev environment for full errors and additional helpful warnings.
    React 8
    unstable_runWithPriority scheduler.production.min.js:19
    React 5
react-dom.production.min.js:74:343

In development, another error message is returned:

Error: The `style` prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + 'em'}} when using JSX.
    in svg (created by QRCodeSVG)
    in QRCodeSVG (created by QRCode)
    in QRCode (at Card.js:96)
    in div (at Card.js:92)
    in fieldset (at Card.js:84)
    in div (at Card.js:83)
    in Card (at App.js:69)
    in div (at App.js:25)
    in App (at src/index.js:8)
    in StrictMode (at src/index.js:7)

[Feature Request] Support multiple languages

Maybe we can support more languages when printing the card. For example, translate the interface texts like these:

WiFi Login -> WiFi 登录俑息
Network name -> η½‘η»œεη§°
Password -> 密码
Point your phone's camera at the QR Code to connect automatically -> 扫码θ‡ͺ动连ζŽ₯

Generating PDF vertically

Generating PDF vertically is useful. Currently, there is an option to only generate PDF horizontally.

Incorrect language in the language drop-down list if a language other than English

The website detects the Polish language and presents the version of the website in this language. However, in the drop-down list, the currently indicated language is English instead of Polish in this case.

Web browser: Chrome 92.0.4515.131
Android 10
dev.wificard.io (because I can't open on mobile Chrome wificard.io):
1628372454589

Web browser: built into Android 10 MIUI Global 12.0.4, browser V12.11.4-gn
Android 10
wificard.io (because I can open here wificard.io)
1628372454604

Support TypeScript for the application

Do we have any plan to support TypeScript for the entire application?

As we all know, this makes the entire project easier to maintain, especially the current project code is increasing.

Make the language names consistent

Right now the dropdown languages are written in three different ways:

  1. Locale name
  2. Full name in that language
  3. Language code
    image

My suggestion is to have the names show like in Ventoy:
image
The full name in English, and the translated name in brackets.

For i18n, the international locale codes should be used, as found here.

'en-US': {
    translation: {
...

Back-port changes across translations

Add/Update the following translation keys

'wifi.password.hide': 'Hide password',
'wifi.name.hiddenSSID': 'Hidden SSID,
'wifi.alert.password.length.5':
    'Password must be at least 5 characters, or change the encryption to "None"',
'wifi.alert.password.length.8':
    'Password must be at least 8 characters, or change the encryption to "None"',

If the below language authors would kindly translate the above 4 keys, either as a comment or pull request
to this branch, it would be greatly appreciated ❀️

German translation

Hi there :)

I did a German translation for the app. Feel free to implement it.

English <=> German

WiFi Login <=> WLAN Zugangsdaten:

Network name <=> Netzwerkname:

WiFi Network name <=> WLAN Netzwerkname

Password <=> Passwort:

Hide password field before printing <=> Passwortfeld vor dem Drucken ausblenden

Encryption: <=> VerschlΓΌsselung:

None <=> Keine

Point your phone's camera at the QR Code to connect automatically <=> Richten Sie die Kamera Ihres Telefons auf den QR-Code um automatisch eine Verbindung herzustellen.

Translations for Encryption Option(s)

Currently the texts/translations of the encryption options are fixed. But at least for None it would be nice to have a translation.
Maybe some locales treat the names of the algorithms specially but i think those would be ok as they are for most locales.

image

Error in Incognito/Private browser

When viewing in an incognito or private browser a blank page is returned, with the following console error. This does not occur in a non-private browser window.

Uncaught TypeError: v.filter(...)[0] is undefined
    F App.js:33
    R App.js:117

image

The minimum length of the WiFi password to prevent confusion

WPA-PSK minimum WPA length is 8 characters. For a 40 bit WEP (probably very rare case) network the password is 5 characters.
To prevent someone forgot to enter the minimum number of characters by mistake, it may be worth adding a warning.

Do we support Internet Explorer?

I know that hardly anyone uses this browser and Microsoft itself recommends Edge. In any case, the tool does not work in this browser (there is a white page) and an error in the console:

SCRIPT5009: 'Promise' is undefined
i18next.js (169,7)

Undefined identifier

On July 16 there was another problem and after typing a letter in the network name field or in the password field I got a blank page with this error in the console:
ie_wifi-card

IE Version 20H2 (OS Build 19042.1083)

SonarLint - issues on master branch

Maybe it's worth noting:

Refactor this function to reduce its Cognitive Complexity from 34 to the 15 allowed. [+27 locations]sonarlint(javascript:S3776)
Cognitive Complexity of functions should not be too high (javascript:S3776)
Cognitive Complexity is a measure of how hard the control flow of a function is to understand. Functions with high Cognitive Complexity will be difficult to maintain.
Expected a `for-of` loop instead of a `for` loop with this simple iteration.sonarlint(javascript:S4138)
"for of" should be used with Iterables (javascript:S4138)
If you have an iterable, such as an array, set, or list, your best option for looping through its values is the for of syntax. Use a counter, and ... well you'll get the right behavior, but your code just isn't as clean or clear.

Dockerfile can't copy "build"

Trying to build this repo from Docker, but I get an error of the type

"COPY failed: stat /var/lib/docker/tmp/docker-builderXXXXXXX/... no such file or directory"

This seems to stem from the copy instruction "COPY build /usr/share/nginx/html" as there is no file or directory called "build" in the repository.

Maybe I'm doing something wrong? What would you expect to happen as per this instruction?

Kind regards, and thanks for your commitment.

Long SSIDs and passwords cropped on generated document

Max length input network name is 32 characters and I inserted value with 32 characters: abcdefghijklmnopqrstuwxyzabcdefg
Max length input for password is 64 characters and I inserted value with 64 characters: abcdefghijklmnopqrstuwxyzabcdefghijklmnopqrstuwxyzabcdefghijklmn

Generated PDF (πŸ“‘ WiFi Card.pdf) shows only abcdefghijklmnopqrst for network name and password. So it's only 20 characters, it means that 12 characters are missing for the network name and 44 characters are missing for the password.

Escape special characters

The format of the encoded string is:

WIFI:S:;T:<WPA|WEP|>;P:;H:<true|false|>;

Order of fields does not matter. Special characters """ (quotation mark), ";" (semicolon), "," (comma), ":" (colon) and "" (backslash) should be escaped with a backslash ("") as in MECARD encoding. For example, if an SSID were "foo;bar\baz", with quotation marks part of the literal SSID name itself, this would be encoded as: WIFI:S:"foo;bar\baz";;[38]

https://en.wikipedia.org/wiki/QR_code#Joining_a_Wi%E2%80%91Fi_network

Clear network.password when "None" encryption mode is selected

When selecting "None" encryption, the network.password field remains unchanged. In my testing, the password will actually change the QR code that is generated for None encryption. So assuming that we want to have no password for None encryption, we will need to clear network.password when upon selection of None encryption. Something like this:

setNetwork({ ...network, password: '' })

Originally posted by @noahhefner in #44 (comment)

Unable ro run in Docker

Hello,

I am having a difficult time understanding from the README how to run this from Docker. I'm relatively new to Docker and this seemed like a fun project to explore with.

Based on the read me I should be able to run

make run

And It would run but I'm sure that there is more to it than that.

White page on mobile view in mobile Chrome

If ❌ it means that I see white page.

Not incognito Incognito
https://wificard.io/ ❌ ❌
https://dev.wificard.io/ πŸ†— ❌

I have no logs because it is a mobile version of the browser, so I can't see it. I checked in the browser on the PC, I selected the option that I use smartphone, but in this case the problem does not occur.
When testing in mobile Chrome and selecting the desktop view option, the page loads correctly. So the problem is with loading the mobile version.

Web browser: Chrome 92.0.4515.131
Android 10

1628372454599

Not incognito, on left wificard.io, on right dev.wificard.io:
1628372454594

Translations not working on first visit

The translation keys are shown when first visiting the website instead of the actual translation text.
This issue can be reproduced by visiting the website in an incognito browser window.

Remove settings from card

With the growing number of controls and features, the card is beginning to feel pretty busy. One way to solve this would be to pull these sort of options into an "Advanced" section that's outside of the card border. This section should be collapsible and default to closed. Advanced controls could include:

  • Rotate
  • Font Size
  • Hidden SSID
  • Hide password

EDIT: The more accurate problem, I think, is that the card has controls on it that are not on the printed card. Keeping the card as a WYSIWYG would be a better approach. The natural place for these controls is below the card. They could be hidden behind a button by default but that's additional complexity that could always be added later.

Suggestion: Export to SVG

Hi, great project.

What do you think about an option to export the QR Code to an SVG file? to be able to use it in any resolution.

New user may see wrong language !

The i18next-browser-languagedetector plugin detects my browser language as en-US
but that's not present in selector so it shows me the first option Arabic but the language is set to en
This can confuse a new user !

To reproduce this bug i clean my browser storage and all cache
so that i am like a new user on the site.

Preview

ps

"Unable to join the network" error on iOS 13.5

I really wanted this to work, but for my friends on iOS (including me) it doesn't. You can hit "join network", but it will always throw the error "Unable to join the network '[name]'"

Have double checked for typos, and tried various times on various devices

Change behavior of "hide password" checkbox

Change the behavior of the Hide password checkbox as follows:

  1. Hide password checkbox hides the password textarea with display: none. This would make is immediately invisible to the user (expected) as well as the printout.
  2. Selecting "None" encryption automatically checks hide password. This will trigger (1) and hide the password textarea
  3. Changing the encryption mode from "None" to something else automatically unchecks hide password

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.