-
Notifications
You must be signed in to change notification settings - Fork 77
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
Sha256 value for each matched file #156
Conversation
src/daemon.py
Outdated
try: | ||
metadata.update(set_sha(file_path)) | ||
except Exception: | ||
logging.exception("Failed to set hash for %s", file_path) |
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.
Errors here are pretty severe and there's no good way to handle it - I'd just let this exception bubble up and fail.
try: | |
metadata.update(set_sha(file_path)) | |
except Exception: | |
logging.exception("Failed to set hash for %s", file_path) | |
metadata.update(set_sha(file_path)) |
Thoughts?
<span className="badge badge-pill badge-warning"> | ||
{v.display_text} | ||
</span> | ||
{!v.hidden && ( |
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.
if the element is hidden, you should hide the whole tag (so including a href
above)
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.
(or actually you should just filter it before the .map() )
</a> | ||
)); | ||
|
||
const hashes = Object.values(props.meta).map((v) => ( | ||
<span> |
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.
unnecessary span I think?
</a> | ||
)); | ||
|
||
const hashes = Object.values(props.meta).map((v) => ( | ||
<span> | ||
{v.hidden && ( |
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.
instead of relying on hidden
, find v
with key equal to sha256
@@ -206,6 +219,7 @@ class QueryResultsStatus extends Component { | |||
<thead> | |||
<tr> | |||
<th>Matches</th> | |||
<th style={{ width: "32%" }}>SHA256</th> |
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.
weirdly specific
Use bootstrap classes (probably something like col-md-4
). Bootstrap grid system will probably also allow to automatically hide/flow the columns on resize
src/setsha.py
Outdated
@@ -0,0 +1,13 @@ | |||
import hashlib | |||
|
|||
def set_sha(filename): |
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.
add type annotations
Closing issue: #16 |
Not really closing #16, because this feature won't work after removing physical samples after indexing. To do this we'd have to keep the hashes in ursadb somehow |
* Display hash value for each matched file * View improvments * Add copy to clipboard for sha256 * Update daemon.py remove unused import * Update QueryResultsStatus.js * Fix web serwer console warnings * Update repo to current master and add hashes filter behind map function * prettier QueryStatus * Small UI changes Co-authored-by: msm <[email protected]>
Your checklist for this pull request
What is the new behaviour?
Show sha256 hash along with matched samples.
Sha256 is calculated in daemon by external function for each sample file and then it is sent via metadata.
Closing issues
#34