ajnart / homarr

Customizable browser's home page to interact with your homeserver's Docker containers (e.g. Sonarr/Radarr)
https://homarr.dev
MIT License
6.22k stars 288 forks source link

NZBGet: ping only works with FormAuth true #559

Closed codezninja closed 1 year ago

codezninja commented 1 year ago

Environment

Docker

Version

0.10.4

Describe the problem

When using the nzb module. The ping fails if you are using the default auth setting with nzbget. Users have to use to set FormAuth: Yes.

image

  1. Can we add support for the basic auth on ping?
  2. If not, I can open a PR tp document that users must use FormAuth yes for ping to work correctly.

Additional info

No response

Please tick the boxes

manuel-rw commented 1 year ago

Hi @codezninja 👋, thank you for your issue.

codezninja commented 1 year ago

Thanks for the response. Love the product btw. Response to the first two bullet points

 url = app.url
 if(app.use_auth_for_ping):
   url = `${app.username}:${app.password}@${app.url}`

  const response = await fetch(`/api/modules/ping?url=${encodeURI(url)}`);

I'll open a PR in the meantime to document the current workaround for nzbget

ajnart commented 1 year ago

Thanks for the response. Love the product btw. Response to the first two bullet points

  • I have updated my image to the latest version 0.10.7 and confirmed the same behavior
  • So the current workaround I found is that in the Service Url if you add your basic auth information ping will work correctly. Looking through the code base the library being used supports that under the hood. So instead of http://localhost:6789 users can add http://{username}:{password}@localhost:6789 so my proposal is that we add a checkbox saying use the username and password field for auth.
 url = app.url
 if(app.use_auth_for_ping):
   url = `${app.username}:${app.password}@${app.url}`

  const response = await fetch(`/api/modules/ping?url=${encodeURI(url)}`);

I'll open a PR in the meantime to document the current workaround for nzbget

I think this is an extremely edge case and it doesn't need to be implemented in the code. If setting the internal address to http://{username}:{password}@localhost:6789 works, let's just add a mention about it in the docs. Adding a whole new set of conditional options isn't worth it for the number of people who will encounter the same issue. If you want to open a PR please do so on the ajnart/homarr-docs repository 😉 (you can browse the docs for a nice place to put it and press the "edit page" at the bottom)

manuel-rw commented 1 year ago

I think this is an extremely edge case and it doesn't need to be implemented in the code.

I agree. Feel free to document this though

whitespacecode commented 2 months ago

https://github.com/ajnart/homarr/issues/559#issue-1527939422

Thank you so much for this! I was going crazy why i was getting a 401 from nzbget