Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

µQR: introduce uqr js library, use for QR codes #7102

Merged
merged 2 commits into from
Jun 27, 2024

Conversation

systemcrash
Copy link
Contributor

original idea by @Ansuel in #7069
FAO also: @jow- @feckert @hnyman

µQR is ~13K, providing a light-weight option, outputting to only SVG for at least luci-proto-wireguard (example included).
Original library here.

I investigated doing this via ucode RPC calls to avoid a require, but this adds a conversion step from js to ucode, so no go. Depending on the 13K lib is acceptable.

@Ansuel also suggests QR codes for wifi. I could add those also.

Compare: On X86_64 23.05.3, to produce QR codes requires a lib and binary weighing ~ 70K today (>500% bigger).

root@OpenWrt:/# cat /etc/openwrt_release
DISTRIB_ID='OpenWrt'
DISTRIB_RELEASE='23.05.3'
DISTRIB_REVISION='r23809-234f1a2efa'
DISTRIB_TARGET='x86/64'
DISTRIB_ARCH='x86_64'
DISTRIB_DESCRIPTION='OpenWrt 23.05.3 r23809-234f1a2efa'
DISTRIB_TAINTS=''
root@OpenWrt:/# du -h /usr/lib/libqrencode.so* /usr/bin/qrencode
0	/usr/lib/libqrencode.so
0	/usr/lib/libqrencode.so.4
40.0K	/usr/lib/libqrencode.so.4.1.1
28.0K	/usr/bin/qrencode

On ath79 23.05.3, to produce QR codes requires a lib and binary weighing ~ 129K today (~1000% bigger).

root@OpenWrt:~# cat /etc/openwrt_release
DISTRIB_ID='OpenWrt'
DISTRIB_RELEASE='23.05.3'
DISTRIB_REVISION='r23809-234f1a2efa'
DISTRIB_TARGET='ath79/generic'
DISTRIB_ARCH='mips_24kc'
DISTRIB_DESCRIPTION='OpenWrt 23.05.3 r23809-234f1a2efa'
DISTRIB_TAINTS=''
root@OpenWrt:~# du -h /usr/lib/libqrencode.so* /usr/bin/qrencode
0	/usr/lib/libqrencode.so
0	/usr/lib/libqrencode.so.4
64.5K	/usr/lib/libqrencode.so.4.1.1
64.5K	/usr/bin/qrencode

qrencode is a decent tool and can output to a number of formats largely unused on openwrt.

  • This PR is not from my main or master branch 💩, but a separate branch ✅
  • Each commit has a valid ✒️ Signed-off-by: <[email protected]> row (via git commit --signoff)
  • Each commit and PR title has a valid 📝 <package name>: title first line subject for packages
  • Incremented 🆙 any PKG_VERSION in the Makefile
  • Tested on: (architecture, openwrt version, browser) ✅
  • Description: (describe the changes proposed in this PR)

@systemcrash
Copy link
Contributor Author

If there are no comments on this - esp from @Ansuel - I will merge and liberate wg from qr-encode dep.

Initial idea by Christian Marangi <[email protected]>

Signed-off-by: Paul Donald <[email protected]>
If for some reason luci-lib-uqr is absent, the GUI shows that the proto
handler needs installing (since it now has a dep which is missing).

Suitable action is to install the lib or remove/install wireguard again.

Signed-off-by: Paul Donald <[email protected]>
@systemcrash systemcrash merged commit 74f366a into openwrt:master Jun 27, 2024
4 checks passed
@stokito
Copy link
Contributor

stokito commented Jul 27, 2024

The ucr library can be minimized more. I see that it still has things like EccMap={L:LOW,M:MEDIUM,Q:QUARTILE,H:HIGH} that can be inlined to just L. But this is something to discuss with its authors.

@Neustradamus
Copy link

@systemcrash: Nice!

@Ansuel: What do you think?

Note: There is Free OTP which is very used on mobile phones (open source not like Google/MS applications):

@stokito
Copy link
Contributor

stokito commented Aug 16, 2024

@systemcrash this was merged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants