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

Error: invalid "mortyhash" parameter #112

Open
gkkulik opened this issue May 8, 2022 · 2 comments
Open

Error: invalid "mortyhash" parameter #112

gkkulik opened this issue May 8, 2022 · 2 comments

Comments

@gkkulik
Copy link

gkkulik commented May 8, 2022

Hi, sorry to bother you but I can't figure this out. I installed Morty but I get empty images results when searching. When try to open image placeholders, Morty show up with the information:

Error: invalid "mortyhash" parameter

Could you point me in the right direction to sort this?

@harryssecret
Copy link

Bump, I have the same problem. I have no error when i run everything, and i think my config file is correct.
My instance is SearxNG one but i don't think it's a problem.

@Zepmann
Copy link

Zepmann commented May 27, 2022

Not affiliated with this project, but recently performed an installation (SearXNG with Morty).

For security, Morty and SearXNG share a secret key to process HMAC hashes, which SearXNG appends to Morty request URLs for the user's browser to follow and for Morty to verify. This prevents abuse of Morty as a full free proxy, since only URLs generated by SearXNG can be proxied.

Of course, the shared secret key must be the same for Morty and SearXNG. I do not know how you start either, so cannot give exact examples on how to configure this. The gist of it is:

  1. Generate a key: openssl rand -base64 33

  2. Append the key to Morty's startup parameters. An example: /usr/bin/morty -listen 127.0.0.1:3000 -key $KEY. Note that this is a bad practice, since the parameters will likely be logged (e.g. by systemd), and therefore the key as well. It is fine in most situations where Morty and SearXNG run on a system dedicated to them.

  3. Add the key to SearXNG's settings.yml:

result_proxy:
    url : $URL # Enter the URL to Morty here from the perspective of the user's browser, not from the perspective of the server)
    key : !!binary "$KEY" # Only enter the key here. Do not replace anything else.

Restart both Morty and the process under which SearXNG runs (e.g. uWSGI), and the proxy should work without issue from SearXNG.

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

No branches or pull requests

3 participants