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

webserver/ui: Generate QR codes for deposit address #1483

Merged
merged 2 commits into from
Feb 22, 2022

Conversation

martonp
Copy link
Contributor

@martonp martonp commented Feb 21, 2022

Closes #1449

@martonp
Copy link
Contributor Author

martonp commented Feb 21, 2022

Screen Shot 2022-02-21 at 2 56 32 PM

Screen Shot 2022-02-21 at 2 56 52 PM

Copy link
Member

@JoeGruffins JoeGruffins left a comment

Choose a reason for hiding this comment

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

Working great.

I had a comment that disappeared.

Comment on lines 233 to 239
if darkMode {
qr.BackgroundColor = color.Black
qr.ForegroundColor = color.White
} else {
qr.BackgroundColor = color.White
qr.ForegroundColor = color.Black
}
Copy link
Member

Choose a reason for hiding this comment

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

I have tried this with two scanners, and one is fine, but one cannot pick up the white qr code on black background. Can they always be white background with black foreground?

Copy link
Contributor

@ukane-philemon ukane-philemon Feb 22, 2022

Choose a reason for hiding this comment

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

Well, I tried both qr code on two scanners and they work well. Maybe scanner related issue?

Copy link
Member

Choose a reason for hiding this comment

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

They both work for me too. If it turns out to be a more widespread issue, we can have the light mode version always displayed by using a white/light patch behind it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

They both work fine for me too. In the QR code library's docs there was an example with a black background and white foreground so I thought it would be fine, but now I'm doing some research and it's recommended that the foreground should be darker than the background.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Screen Shot 2022-02-22 at 9 53 50 AM

Actually it might even look better.

@martonp
Copy link
Contributor Author

martonp commented Feb 22, 2022

An error unrelated to the PR is causing the failed checks.

@chappjc
Copy link
Member

chappjc commented Feb 22, 2022

Restarted the CI run. It was having trouble fetching the linter itself. :P

Copy link
Member

@chappjc chappjc left a comment

Choose a reason for hiding this comment

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

LGTM.

I have some slight concerns about potential abuse of the route if the service or it's host are not secured properly. e.g. With the /generateqrcode page not in a requireLogin router group, it could be called by anyone with network access to the listening port. There's no sensitive info as with the wallets page, but it consumes cpu and memory resources to do the qr and png encoding.

A related concern is a max length of the address string. A long enough string could be trouble for the qr encoder. Not tested though.

Given the default to listen only on a loopback address, I'm not requesting any changes though. Just something we should keep in mind.

@chappjc chappjc merged commit e4c1272 into decred:master Feb 22, 2022
@chappjc chappjc added this to the 0.5 milestone Apr 21, 2022
@martonp martonp deleted the qrCode branch December 20, 2022 22:08
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.

QR codes for deposit addresses
4 participants