goose-ws / bash-scripts

A collection of bash scripts I've hacked together over time
MIT License
10 stars 3 forks source link

Missing / for base url #7

Closed Catvari closed 5 months ago

Catvari commented 6 months ago

The / is not added to the base url so every curl request are failing. To fix the problem, I just added it line 503: sonarrUrlBase="/${sonarrUrlBase%</UrlBase>}"

Thanks for your work

goose-ws commented 6 months ago

On an unrelated note, thanks for leading me to notice a copy/paste typo I made on line 504.

The / is added on line 514:

apiCheck="$(curl -skL "${containerIp}:${sonarrPort}${sonarrUrlBase}/api/v3/system/status" -H "X-api-key: ${sonarrApiKey}" -H "Content-Type: application/json" -H "Accept: application/json")"
                                                                   ^here

So you shouldn't need to edit line 503. What is your URL Base, from your Settings > General > Host > URL Base page?

goose-ws commented 6 months ago

Oh you mean the prefix /?

I assume your URL Base is something like sonarr instead of /sonarr. I was expecting the behavior that one would prefix their URL Base with a /, as described in the URL Base section of the config wiki:

URL Base - For reverse proxy support, default is empty
Note: If using a reverse proxy (example: mydomain.com/sonarr) you would enter '/sonarr' for URL Base.

I can add a safety/sanity check for padding with a prefix / if necessary, but I believe you should be prefixing your URL Base with / in the settings page.

Catvari commented 5 months ago

My URL base was appearing to be /sonarr in sonarr but the / wasn't in the config file. I've edited the base url and now it's saved properly in the config.