cheshire-cat-ai / admin-vue

Admin panel of the Cheshire Cat AI
GNU General Public License v3.0
32 stars 28 forks source link

[https only] LLM settings (PUT) fails in the admin #73

Closed pieroit closed 7 months ago

pieroit commented 8 months ago

How to replicate

Under https all endpoints work fine in the admin, with the exception of the endpoint to PUT the LLM configuration. When hitting "Save" on the config:

Observations:

zAlweNy26 commented 7 months ago

No idea about this, does the error still appear?

pieroit commented 7 months ago

Fixed on develop, coming as release in 1.4.8

PretzelVector commented 6 months ago

Hello,

Did the fix get released in 1.4.8? Using the 1.4.8 container, I am seeing the same behaviour described above (and in the PR) where the admin site is requesting https endpoints that end in a / and is being redirected to the stripped http endpoint resulting in a mixed content block.

While debugging, I verified empirically that X-Forwarded-Proto (and related) are set correctly in my setup.

Thanks, ~PV

PretzelVector commented 6 months ago

Hello,

The underlying issue is that uvicorn does not trust X-Forwarded-Proto by default. You can set the following variables in your chesire-cat-ai/core container to trust the origin proxy:

Env = [
  "UVICORN_PROXY_HEADERS=1"
  "FORWARDED_ALLOW_IPS=192.168.0.0/16"
];

With these environment variables set, the redirect from (for example) /llm/settings/ -> /llm/settings is still present, but the redirect target is using the correct scheme.

Thanks, ~PV

pieroit commented 6 months ago

@PretzelVector thanks