8000 fix: [modules] Gracefully accept no hashlookup fixes #916 by cvandeplas · Pull Request #917 · Lookyloo/lookyloo · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fix: [modules] Gracefully accept no hashlookup fixes #916 #917

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

Merged
merged 3 commits into from
May 21, 2024

Conversation

cvandeplas
Copy link
Contributor

Type of change

Description:
Fixes bug #916 - accept hashlookup being disabled

Select the type of change(s) made in this pull request:

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Documentation (change or fix to documentation)

Fixes #916

Proposed changes

  • cleanly show the message to the user instead of throwing an error in the code.

@cvandeplas
Copy link
Contributor Author

Note: the PR also contains minor changes in the redis script.
Note2: commenting out the following lines in indexing.conf and cache.conf is needed for redis 7.0.x to start properly.

  • # locale-collate ""
  • # set-max-listpack-entries 128
  • # set-max-listpack-value 64

@cvandeplas
Copy link
Contributor Author

I added the message for both cases. Also (tried) to fix the python test raising the variable type. @Rafiot Can you approve test workflows again to see if the python fix is OK now?

for sha1, entries in merged.items():
entries['nodes'] = {node.name for node in entries['nodes']}
except Exception: # error or module not enabled
merged = []
Copy link
Member

Choose a reason for hiding this comment

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

Now that I'm thinking about it, no need to render the hashlookup.html template there, you can simply render the tree flash an error message like that:

except Exception:
flash('Unable to find the rendered node in this capture, cannot get the URLs.', 'error')
return redirect(url_for('tree', tree_uuid=tree_uuid))

@cvandeplas
Copy link
Contributor Author

Thanks for the pointer, I originally did it using yet another error method, however that resulted in something not visually clean. I finally ran mypy locally and fixed the type issue. I should have tested it manually the first time...

@Rafiot Rafiot merged commit ac2c5b1 into Lookyloo:main May 21, 2024
11 of 12 checks passed
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.

[Bug]: Lookyloo throws LookylooException when hashlookup is not enabled in config
2 participants
0