Closed kadaan closed 12 months ago
Hi @kadaan ,
I incorporated this PR into a local branch and been doing some testing. Backwards compatibility is passing. However, I'm facing some challenges with Cloudflare Zero Trust. It seems to be tunneling POST requests as GET requests for some reason. I saw a recent post from someone else that also saw this. Let me know if you know of a configuration that I missed. The other thing that it's still not working is websocket connection. I have not analyzed that one yet to know what is going on.
BTW, I noticed that you were expecting a "=" character in the header. I'm setting this format in the header
CF-Access-Client-Id: myblah.access, CF-Access-Client-Secret: mysecretblah
were you using something different? I changed the code to accept both = or : as a separator. Ideally we should fetch the JWT once we sent the client id/secret but except for seeing a big number of logins in Cloudflare's analytics I do not see any other side effect. BTW, I fixed a few minor things I found as I was testing.
Thanks for this great contribution. Gaston
@gdombiak Yeah, I expected Key1=Value1,...,KeyN=ValueN
. It is probably better to change the =
to :
.
@gdombiak No, I am not experiencing a POST -> GET issue.
A couple questions:
My configuration is as follows:
@gdombiak I checked the code and bed target temp setting seems to be a POST. That works perfectly for me.
Found it! I was using HTTP instead of HTTPS. Using HTTPS in the printer hostname I have no issues with websockets or with POST requests. The other thing I found is that connecting to my dev env worked fine but connecting to the real OctoPi required enabling CORS. I will create a wiki page with all settings so others can follow for future setups.
I will do some more testing before closing this PR and creating one from the branch I created.
Thanks, Gaston
@kadaan , I created this wiki page to help with the setup. Let me know if you see incorrect or missed things.
Thanks, Gaston
PR has been included in new PR https://github.com/gdombiak/OctoPod/pull/674
Support specifying headers for OctoPrint connections so that then can be secured behind a Cloudflare Zero Trust Service Token