Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Homeassistant - Problem OPDS and "ValueError: No route found for path '/api/v3/ws'. #416

Open
gandolfi974 opened this issue Jul 22, 2024 · 6 comments

Comments

@gandolfi974
Copy link

gandolfi974 commented Jul 22, 2024

hello,

i have two problem on CODEX and home Assistant.

2024-07-22 13:45:48 CEST ERROR Error in ASGI Framework

thanks

@ajslater
Copy link
Owner

do you have this line in your /config/hypercorn.toml?

root_path = "/api/hassio_ingress/pEGeoOIlm1tpeAudrHRtnmeGFDavfaQjalwJXvX696Q"

@ajslater
Copy link
Owner

ajslater commented Jul 22, 2024

It occurs to me that the homeassistant installation might be able to automatically configure this for you. And that homeassistant users might be less familiar with configuring their individual docker based applications.
We may be able solve your individual issue with this or other config changes, but we may want to loop in @alexbelgium the author and maintainer of the homeassistant add on for codex.

@gandolfi974
Copy link
Author

do you have this line in your /config/hypercorn.toml?

root_path = "/api/hassio_ingress/pEGeoOIlm1tpeAudrHRtnmeGFDavfaQjalwJXvX696Q"

where i can find this file in my Ha directory ?

@ajslater
Copy link
Owner

I'm not really sure how HomeAssistant works. The instructions for HomeAssistant and the HomeAssistant config was provided by alexbelgium and I just stuck it in the docs.

I get the impression that it's a bunch of preconfigured docker containers and a nice web gui to help you configure and manage them.

/config/hypercorn.toml would be a file mounted by the Codex docker container. In a docker-compose.yaml config file it might be mounted similar to what I show below here:

services:
  codex:
      env_file: .env
      image: docker.io/ajslater/codex
      container_name: codex
      volumes:
          - /host/path/to/config:/config
          -/host/path/to/comics:/comics:ro
      ports:
          - 9810:9810
      restart: on-failure

from my docker container documentation.

Where exactly HA is mounting this from i'm not sure. If there's an HA directory and something like /HA/services/codex/config/ that' might be it but I'm out of my depth with HA and kind of hoping alex swoops in to rescue us.

I can see that he provides an nginx reverse proxy config for HA and a custom Dockerfile, but I'm a little lost as to where the mounting happens in the HA config.

I suggest you ask Alex on his github: https://github.com/alexbelgium/hassio-addons/issues

@alexbelgium
Copy link
Contributor

alexbelgium commented Jul 24, 2024

Hi! I'll look at it

Indeed HA is globally an os based on modular docker containers. For example, one for sound, one for supervisor, one for the different add-ons...

Ingress is quite tricky : there is a dual layer of nginx that sends (for example) homeassistant.local:8123/api/hassio_ingress/pEGeoOIlm1tpeAudrHRtnmeGFDavfaQjalwJXvX696Q to a ip internal within the add-on such as 127.0.0.1:8080. As such, I need to have a nignx reverse proxy to rewrite all paths so that the add-on exposes an external path homeassistant.local:8123/api/hassio_ingress/pEGeoOIlm1tpeAudrHRtnmeGFDavfaQjalwJXvX696Q different than the internal one... I'll see if I can add this path

@alexbelgium
Copy link
Contributor

alexbelgium commented Jul 24, 2024

After thinking I think the best for you is to use as endpoints http://debian.local:9810/opds/v2.0/r/0/1 where 9810 is a port that you can expose from the configuration page of the add-on in homeassistant.

To give a bit more details : ingress (and the weird long path) is used to access Codex from your HA app itself.

However if a port is configured in the appropriate HA section, you can access it using ip:port without any weird reverse proxy things that break stuff :)

Edit : just as reference, all your config files including the hypercorn.toml can be found in /homeassistant/addon_configs/db21ed7f_codex/. You'll need a specific add-on to access files, such as my Filebrowser or HA File Editor though

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants