Open tuxpowered opened 2 months ago
I did a random test using the endpoint https://snippet.host/tvcw/raw
used in the documentation and the same errors happen.
So I am thinking there is nothing wrong with the proxy settings, and this is a dashy issue.
The error message from the browser console says it did not fetch the remote resource at all as the page that was requesting the resource and the resource are from different origins. Browsers check the Access-Control-Allow-Origin
header before requesting content.
While using https you need proper configuration of CORS.
@hockwill So dashy is behind Nginx Proxy Manager. What I do not understand is if you go to the URL with curl or a web browser it absolutely loads the conf.yml file for you. But when another dashy instance tries it it does not work, only Dashy complains but no other browser, curl, or wget has an issue.
Additionally I do not understand why testing with the sample https://dashy.to/docs/pages-and-sections/ using the https://snippet.host/tvcw/raw
again, dashy fails to load the page but browsers, curl and wget have no problem retrieving it.
If this was really a CORS issue, than shouldn't every browser and CLI tool be erroring out as well? It seems very poor to think that an application has to make the specific check but everyone else can access it.
I am getting different results with different browsers using the https://snippet.host/tvcw/raw
.
access-control-allow-origin: *
in the response. Excellent.After some searching about for why this was. I had Firefox clear the site data for my test Dashy and it worked.
CORS is handled in the browser when one site tries to include resources from another. Fetching a single item with curl does not trigger CORS.
Sorry for loonnnng time away. So if I understand you correctly this is a browser issue?
During this time I migrated services off nginx proxy manager and moved to Caddy. Yes the Access-Control-Allow-Origin is set in caddy
headers / {
Access-Control-Allow-Origin *
}
So while previously I checked with curl and things worked I checked again and still failure.
So I took the time and added the https://snippet.host/tvcw/raw
snippet as a remote page.
I get the same error, "Unable to load config from: https://snippet.host/tvcw/raw
I tried this in multiple browsers. (Chrome, Safari, Opera)
After some more testing, it appears that the issue may be related to Dashy's handling of authenticated pages. while passing HTTPBasic in the URL string works fine in a browsers, it seems to not work in dashy's remote pages.
I verified this by starting an incognito window with RAW working, and with the destination behind a basic auth page it fails.
Yes CORS is a browser/https thing. The https server hosting the config files it the one that needs to provide the headers.
I poked about to make my own instance load a config file from a basicauth https host.
I needed to provideAccess-Control-Allow-Origin $http_origin
, Access-Control-Allow-Methods 'GET, POST, OPTIONS'
, Access-Control-Allow-Credentials 'true'
.
If Allow-Origin is provided with '*'
while trying to perform basic authentication you will get a follow up error saying * cannot be used with authentication
and it needs to specify the allowed origin.
@hockwill ... So when using basicauth, the Access-Control-Allow-* methods need to be manually populated to specific hosts? Would you happen to have a copy of a caddy config to set the headers right?
This is super odd still because if I take the same URL string put into dashy with the basicauth added to the URL, and placed into ANY browser it instantly connects and gives the conf. No needing to modify anything in the server side or client side.
It only seems to fail when dashy makes the request specifically. If this was actually an HTTPS/browser thing as you suggest, then that failure should happen on any browser.
If you look at the headers from a chrome session using the same connection string, you can see it clearly loads without any issues. And NONE of those headers are required.
If in fact the "Browser" required the Access-Control-Access-* headers than it should have errored which it does not. It simply does as expected and is to load the content.
https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS
I do not use Caddy anywhere can cannot provide header setups for it.
Environment
Self-Hosted (Docker)
System
docker
Version
current
Describe the problem
Trying to add a page from a remote dashy install, unfortunately it errors out. with the dialog
Looking at the browser console, I get this error, however....
The remote dashy is protected by HTTP Basic handled by Nginx Proxy Manager (NPM). When I tried passing the credentials in the url
https://username:password@dashy.DOMAIN.COM/conf.yml
from an unauthenticated browser it works fine no problem.The above curl was ran from the local docker server running dashy.
Additional info
No response
Please tick the boxes