-
Notifications
You must be signed in to change notification settings - Fork 43
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
Automatically log into the client application #1188
base: main
Are you sure you want to change the base?
Conversation
Most of the time we're developing the client, we are not testing the login screen, and just want to quickly log in. With a combination of xdotool and oathtool, we can script typing the correct values and login. It's a bit fragile for two reasons. First, we're just blindly typing, so if some other window takes focus or switch, it'll be typed into that window. Second, we're kicking off a background process that sleeps, launching the window in the foreground, and then the background process will do the typing into the foreground. Adapted from work by @legoktm [1] [1]: freedomofpress/securedrop-client#2237
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is awesome \o/ left a suggestion!
Makefile
Outdated
@echo 'please install oathtool with "sudo qubes-dom0-update oathtool"' | ||
@false | ||
endif | ||
sdw-updater |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe qvm-run sd-app securedrop-client
so it doesn't accidentally trigger the updater and type into it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. How does d75911b sound? I preferred to run the desktop file like the launcher does instead of the client application itself.
Makefile
Outdated
@@ -7,6 +7,11 @@ CONTAINER := $(if $(shell grep "Thirty Seven" /etc/fedora-release),,./scripts/co | |||
|
|||
HOST=$(shell hostname) | |||
|
|||
# Client autologin variables | |||
CLIENT_TOTP=$(shell oathtool --totp --base32 JHCOGO7VCER3EJ4L --start-time "$(shell date -d "+5 seconds" +"%Y-%m-%d %H:%M:%S")") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would just inline this below instead of putting it at the top
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. Addressed in 9c97d7d
Starting the launcher could lead to autotyping into launcher application instead of the client login prompt.
@legoktm what shall we do regarding this one. Shall we close it, unmerged? |
@legoktm from a team meeting my understanding is that this is mergeable, actually. |
Status
Ready for review
Description of Changes
Most of the time we're developing the client, we are not testing the login screen, and just want to quickly log in. With a combination of xdotool and oathtool, we can script typing the correct values and login.
It's a bit fragile for two reasons. First, we're just blindly typing, so if some other window takes focus or switch, it'll be typed into that window. Second, we're kicking off a background process that sleeps, launching the window in the foreground, and then the background process will do the typing into the foreground.
Adapted from work by @legoktm: freedomofpress/securedrop-client#2237
Testing
make run-client
xdotool
andoathtool
)make run-client
Deployment
dev-facing - no deployment considerations
Checklist
If you have made changes to the provisioning logic
make test
) pass indom0
If documentation is required