]> git.immae.eu Git - github/bastienwirtz/homer.git/blame - docs/troubleshooting.md
Prepped the rest of the documentation for launch
[github/bastienwirtz/homer.git] / docs / troubleshooting.md
CommitLineData
7129af3b
BW
1# Troubleshooting
2
3## My custom service card doesn't work, nothing appears or offline status is displayed (pi-hole, sonarr, ping, ...)
4
1d6d20e7
ES
5You might by facing a [CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS)
6(Cross Origin Request Sharing) issue. It happens when the targeted service is
7hosted on a different domain or port. Web browsers will not allow to fetch
8information from a different site without explicit permissions (the targeted
9service must include a special `Access-Control-Allow-Origin: *` HTTP headers).
10If this happens your web console (`ctrl+shift+i` or `F12`) will be filled with
11this kind of errors:
7129af3b
BW
12
13```text
1d6d20e7
ES
14Access to fetch at 'https://<target-service>' from origin 'https://<homer>' has
15been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present
16on the requested resource. If an opaque response serves your needs, set the
17request's mode to 'no-cors' to fetch the resource with CORS disabled.
7129af3b
BW
18```
19
20To resolve this, you can either:
21
22* Host all your target service under the same domain & port.
1d6d20e7
ES
23* Modify the target server configuration so that the response of the server
24included following header- `Access-Control-Allow-Origin: *`
25(<https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#simple_requests>). It
26might be an option in the targeted service, otherwise depending on how the
27service is hosted, the proxy or web server can seamlessly add it.
28* Use a cors proxy server like
29[`cors-container`](https://github.com/imjacobclark/cors-container),
30[`cors-anywhere`](https://github.com/Rob--W/cors-anywhere) or many others.