-
Notifications
You must be signed in to change notification settings - Fork 120
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
Add HUD #773
Add HUD #773
Conversation
It's been great coordinating chat make this possible! Thank you for your work on this as it's invaluable. Looking forward to testing! |
934db13
to
4142b85
Compare
68d2db9
to
6642785
Compare
This one isn't working for me with kaldi:
|
@kendonB this requires python3. |
@dmakarov is the idea here that we'd hold off on merging this until natlink is up and running with python 3? Or this would just be available for people with Kaldi setups? |
@kendonB as far as I know natlink works on python3. This PR is still WIP, but I should finish it soon. I didn’t intend HUD to be available only with kaldi engine, although I test it only with kaldi and test engines, and don’t know whether it would be useful with other setups. There’s nothing engine specific in HUD’s code though. Overall the idea was to consolidate all separate Caster’s GUI under one app and single RPC server. |
def closeEvent(self, event): | ||
event.accept() | ||
|
||
def setup_xmlrpc_server(self): |
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.
Apologies for the drive-by comment, but might this need a security token type of thing here, like what dragonfly & aenea use? https://github.com/dictation-toolbox/dragonfly/pull/61/files#diff-6219d462fba21473f0a2404097943f75R29
The danger case would be something like: user is tricked into browsing to evil website, evil website asks web browser to make xmlhttprequests to http://localhost:1338, evil website can now ask this server to execute any registered function. Obviously from a practical perspective this is only going to be a concern if a caster user is actively being targeted (and the blast radius in this server seems small right now - basically it'd be annoying to have the rules UI show up or have caster quit unexpectedly), but mentioning it here anyway.
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. I will consider adding the security token. Probably, not in this PR, however.
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.
Is adding the security token difficult? I wouldn't want any extra vulnerabilities introduced to master.
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.
It's actually a vulnerability that exists already with the current implementation.
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.
The current master you mean? Can we fix that?
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.
@kendonB That's correct and in the current master. Basically someone would have to set up a malicious website specifically for caster and a caster user would have to go to that website. In that case they then could control RPC commands that are defined. Mostly emulating mouse now this is none that I know of control keyboard input.
To protect against this a secret would be randomly generated and be used for authentication for the client/server to protect against such targeting.
dmakarov mentioned he would implement it in another pull request.
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.
Yes, sorry, I should have mentioned that this is an existing problem so it's not meaningfully worse than before (just a couple new commands available to an attacker - but none of them seem to allow arbitrary code execution).
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.
@caspark would you be able to open an issue on this (for the current vulnerabilities)?
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.
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. I will consider adding the security token. Probably, not in this PR, however.
Is this something you are willing to take on?
039874c
to
8145a6b
Compare
This comment has been minimized.
This comment has been minimized.
This will work with everything but Python 32-bit 2.7.x. This is a limitation of QT 5 via pyside2. Really only affects DNS with Natlink on 32-bit 2.7.x. |
- Redirect dragonfly observers and logging to printer.out The RPC timeout with the hud can interfere with the dragonfly speech recognition loop. This appears as a stutter recognition latency. Exceptions are tracked so this stutter only happens to end user once. An exception occurs if the hud is not available/python 2/running text engine. If an exception in handle_message, print is managed by SimplePrintMessageHandler
- Removed LoggingHandler - Re-factored RecognitionObserver to configure_engine.py
@dmakarov This is wonderful! FWIW, I made a couple of tweaks to help with when it was crashing caster.
I had this issue at first too. There was another error earlier from when the hud tried to start, but that was hitting a Shiboken error. I upgraded |
I've included some of your enhancements catching connection error. This PR will be merged Directly but will be included in a new all request combines most of dmakarov work and drop support for Python 2. |
- grammar should be loaded before registering observers - cleanup imports and pylint
commit a5303dd Author: Brian Vancil <[email protected]> Date: Wed Dec 21 16:40:34 2022 -0600 Added vscode terminal pane toggle commit 1de7195 Author: LexiconCode <[email protected]> Date: Sun Oct 30 08:25:03 2022 -0500 Hud use TK and multiprocessing and Queue commit 992fd88 Author: LexiconCode <[email protected]> Date: Tue Jul 5 13:50:08 2022 -0500 add missing extras and defaults `Your_First_Rule.md` and example rules commit e5f047f Author: LexiconCode <[email protected]> Date: Mon Feb 14 03:54:59 2022 -0600 Update collections import commit bca040d Author: LexiconCode <[email protected]> Date: Sat Feb 12 02:21:41 2022 -0600 Clean up hud state commit de91635 Author: LexiconCode <[email protected]> Date: Sat Feb 12 01:51:22 2022 -0600 Only find DPI/DNS if isNatSpeakRunningnatlink. commit 1ec2775 Author: LexiconCode <[email protected]> Date: Thu Feb 10 20:20:30 2022 -0600 remove settings window manual path handling commit d0c3cce Author: LexiconCode <[email protected]> Date: Thu Feb 10 20:10:51 2022 -0600 Rename WXTYPE_SETTINGS to QTTYPE_SETTINGS commit bf2be01 Author: LexiconCode <[email protected]> Date: Thu Feb 10 19:41:21 2022 -0600 removed availability_message function PIL is cross platform https://pillow.readthedocs.io/en/stable/installation.html commit 556e6dc Author: LexiconCode <[email protected]> Date: Thu Feb 10 19:27:35 2022 -0600 remove wxpython commit e821be9 Author: LexiconCode <[email protected]> Date: Thu Feb 10 19:05:28 2022 -0600 Clear hud when restarting Caster commit dd61366 Author: LexiconCode <[email protected]> Date: Tue Feb 8 15:23:04 2022 -0600 "clear caster hud" command clears the "Caster: Status Window" if hud is not available commit e0a5b1d Author: LexiconCode <[email protected]> Date: Tue Feb 8 15:21:32 2022 -0600 Rename and add hud commands to docs - rename hud commands to be less ambiguous commit d31fe8c Author: LexiconCode <[email protected]> Date: Mon Jan 31 23:02:33 2022 -0600 add PySide2 to windows os commit f868f01 Author: Brian Vancil <[email protected]> Date: Wed Dec 21 16:38:18 2022 -0600 dragonfly2 version bump to 0.34.0 - Fix various bugs with keyboard/text input actions on Windows - Fix problems caused by relative import statements in the library by using the absolute form instead. - edited by bvancil to resolve merge conflicts commit 9e07efd Author: LexiconCode <[email protected]> Date: Mon Jan 31 22:47:44 2022 -0600 rename work flow commit ec459fc Author: Kendon Bell <[email protected]> Date: Tue Jan 25 13:46:45 2022 +1300 PySide2 version I got this error with an old PySide2 codesardine/jak#67 commit bdf04ca Author: Kendon Bell <[email protected]> Date: Fri Jan 21 11:20:33 2022 +1300 update docs for keyboard Adding the "release modifier keys" command that replaced "release <keyname>" commit 31d1e89 Author: LexiconCode <[email protected]> Date: Wed Jan 19 12:29:47 2022 -0600 Remove API command grammars examples commit 9c67920 Author: Dmitri Makarov <[email protected]> Date: Tue Oct 19 06:15:45 2021 -0700 Convert HMC to QT on python 3 (dictation-toolbox#786) commit 2e573c7 Author: Dmitri Makarov <[email protected]> Date: Mon Oct 18 17:19:10 2021 -0700 Add HUD (dictation-toolbox#773) commit 5dd65fb Author: Brian Vancil <[email protected]> Date: Wed Dec 21 16:31:28 2022 -0600 utilized py launcher with explicit 3.8-32 python version -edited by bvancil to resolve merge conflicts commit ded7e05 Author: LexiconCode <[email protected]> Date: Sun Oct 3 01:09:27 2021 -0500 Miscellaneous cleanup commit 1530d58 Author: Brian Vancil <[email protected]> Date: Wed Dec 21 16:26:25 2022 -0600 remove py2 action -edited by bvancil to remove merge conflicts commit c4e0d28 Author: Brian Vancil <[email protected]> Date: Wed Dec 21 16:23:08 2022 -0600 remove imports for py2 - remove default encoding utf-8 for py2 - remove six code for py2 - fix natlink imports for py3 - edited by bvancil to resolve merge dependencies commit c041a90 Author: LexiconCode <[email protected]> Date: Fri Oct 1 19:46:17 2021 -0500 Drop py2 pathlib port commit 2ed2487 Author: LexiconCode <[email protected]> Date: Fri Oct 1 19:02:43 2021 -0500 Doc Natlink Py3
Title
HUD to display recognized utterances and corresponding actions
Description
This adds the HUD GUI. This is work in progress. Initial PR to reveal any possible issues.
Related Issue
Motivation and Context
It is hoped to improve the user experience.
How Has This Been Tested
Ran on macOS and Windows
Types of changes
Checklist
Maintainer/Reviewer Checklist