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

feat(live): Display QR codes at the console for easier accessing Agama with smartphones #1522

Merged
merged 1 commit into from
Aug 2, 2024

Conversation

lslezak
Copy link
Contributor

@lslezak lslezak commented Aug 1, 2024

Problem

  • Make accessing Agama easier for smartphones by scanning an QR code
  • And this is a pretty cool feature for advertising Agama! 😃

Solution

  • Use the qrencode tool for generating the QR codes as text (it uses special UTF-8 graphical symbols)
  • Display the codes side-by-side with URL below them
  • If there is not enough space the QR codes are displayed only for the subset of the URLs, the other URLs are displayed just as text without QR code. That means the QR codes always displayed in a single line.
  • When running on serial console or when on the VGA plain text console the QR codes are not displayed (the terminal width must be greater than 80 to display them)
  • The codes are refreshed whenever the network configuration is changed (see the video at the end)
  • Tested manually

Notes

The root password is randomly generated so the system actually knows the password. I was thinking about rendering URLs with embedded password (something like https://1.2.3.4?password=PASSWORD) so then using a smartphone would be even easier.

But that has some security drawbacks. The terminal already contains the root password, but you would need to be close to the screen to get it. On the other hand QR codes are designed for robustness, the QR code might be blurred, some part can be missing but the scanner will still be able to get the full content. That means you do not need to be next to the screen, the risk of eavesdropping for QR is higher than for a plain text password.

We could discuss that with the security team...

Screenshots

Standard resolution, 1 network device
qr_1dev
Standard resolution, 4 network devices Smaller resolution, 4 network devices, only 3 QR codes displayed
qr_4devs qr_4devs_800
Serial console (80x24), 4 network devices, no QR code displayed VGA text mode (80x25), 4 network devices, no QR code displayed
qr_4devs_serial qr_4devs_text

Dynamically adding network connections (activating 3 more network interfaces)

Agama-screen0.webm

Copy link
Contributor

@dgdavid dgdavid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome ❤️ , thanks a lot for both, the feature and the detailed description. It's useful for users and... to encourage us to have in mind a bit more the mobile version 😝

@lslezak lslezak merged commit 84ba304 into master Aug 2, 2024
@lslezak lslezak deleted the qr_code branch August 2, 2024 07:58
@lslezak lslezak mentioned this pull request Aug 2, 2024
lslezak added a commit that referenced this pull request Aug 2, 2024
- Just the changes for the previous PR #1522
@mvidner
Copy link
Contributor

mvidner commented Aug 2, 2024

@lslezak BTW I wondered how my phone would deal with multiple QR codes, and it turns out pretty well: when it picks the wrong one I just move it back and forth and it refocuses on the one in the middle. So multiple codes close together are not a problem.

@imobachgs imobachgs mentioned this pull request Sep 20, 2024
imobachgs added a commit that referenced this pull request Sep 20, 2024
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.

3 participants