mikespub-org / seblucas-cops

Calibre OPDS (and HTML) PHP Server : web-based light alternative to Calibre content server / Calibre2OPDS to serve ebooks (epub, mobi, pdf, ...)
http://blog.slucas.fr/en/oss/calibre-opds-php-server
GNU General Public License v2.0
65 stars 7 forks source link

Client Side Rendering vs cloudflare tunnel #65

Closed itsalljustdata closed 11 months ago

itsalljustdata commented 11 months ago

I have a cloudflare tunnel set up to my homelab, and https://cops.my.tld is set to tunnel to the IP of my docker container running cops.

https://cops.my.tld/checkconfig.php always works

if I have "cops_server_side_render" set to "." (i.e. it always does server-side rendering), then everything displays as expected..

However, if i leave cops_server_side_render as the default (checkconfig.php reports that it's gonna client-side render), then index.php just returns me an HTML document with nothing in the section.

If i paste the URL from the initiateAjax call (http://cops.my.tld/getJSON.php?page=index&complete=1) then I get the JSON i'd expect.

needless to say, all this works fine if i access using http://localhost - so i'm thinking it's getting lost in the tunnel somewhere.

Any ideas?

itsalljustdata commented 11 months ago

Ignore me. I'm a moron....

When I looked at the console in edge, i saw the answer

Mixed Content: The page at '<URL>' was loaded over HTTPS, 
but requested an insecure XMLHttpRequest endpoint '<URL>'. 
This request has been blocked; the content must be served over HTTPS

I had cops_full_url = "http://cops.my.tld" as soon as i corrected it to cops_full_url = "https://cops.my.tld" then all was good in the world

mikespub commented 11 months ago

Thanks for the input - it's good to hear how different setups work out well (in the end) :-)