beyondcode / expose

A beautiful, fully open-source, tunneling service - written in pure PHP
https://expose.dev
MIT License
4.21k stars 260 forks source link

Cannot auth and login Home assistant dashboard #88

Closed thangnd85 closed 8 months ago

thangnd85 commented 4 years ago

Hi. I'm trying to expose my own Home assistant (hass.io) dashboard with command expose share http://127.0.0.1:8123 --subdomain=homeassistant I can see login page, but after enter login information, it doesn't redirect to dashboard. Here is some log

GET | /?auth_callback=1&code=afc4b0d6fbc24d71a8b6c45baa770770&state=eyJoYXNzVXJsIjoiaHR0cHM6Ly90aGFuZy5oYXNzLmJpZCIsImNsaWVud ElkIjoiaHR0cHM6Ly90aGFuZy5oYXNzLmJpZC8ifQ%3D%3D | 200 OK | 2020-07-07 07:41:48 | 44ms | | POST | /auth/login_flow/1357ffbdaab8469fa40f60f6e898afe5
| 200 OK | 2020-07-07 07:41:46 | 850ms | | POST | /auth/login_flow
| 200 OK | 2020-07-07 07:41:39 | 47ms |

thangnd85 commented 4 years ago

| GET | /lovelace?auth_callback=1&code=285d86c327bd406096faa5864e34330e&state=eyJoYXNzVXJsIjoiaHR0cHM6Ly90aGFuZy5oYXNzLmJpZCIsImNsaWVudElkIjoiaHR0cHM6Ly90aGFuZy5oYXNzLmJpZC8ifQ%3D%3D | 200 OK | 2020-07-07 08:52:21 | 163ms | | POST | /auth/token | 400 Bad Request | 2020-07-07 08:52:21 | 136ms | | GET | /service_worker.js | 304 Not Modified | 2020-07-07 08:52:20 | 61ms | | GET | /manifest.json | 200 OK | 2020-07-07 08:52:19 | 104ms | | POST | /auth/token | 400 Bad Request | 2020-07-07 08:52:18 | 217ms | | GET | /lovelace?auth_callback=1&code=285d86c327bd406096faa5864e34330e&state=eyJoYXNzVXJsIjoiaHR0cHM6Ly90aGFuZy5oYXNzLmJpZCIsImNsaWVudElkIjoiaHR0cHM6Ly90aGFuZy5oYXNzLmJpZC8ifQ%3D%3D | 200 OK | 2020-07-07 08:52:18 | 209ms | | GET | /service_worker.js | 304 Not Modified | 2020-07-07 08:52:17 | 47ms | | GET | /manifest.json | 200 OK | 2020-07-07 08:52:16 | 49ms | | POST | /auth/token | 400 Bad Request | 2020-07-07 08:52:16 | 141ms | | GET | /lovelace?auth_callback=1&code=285d86c327bd406096faa5864e34330e&state=eyJoYXNzVXJsIjoiaHR0cHM6Ly90aGFuZy5oYXNzLmJpZCIsImNsaWVudElkIjoiaHR0cHM6Ly90aGFuZy5oYXNzLmJpZC8ifQ%3D%3D | 200 OK | 2020-07-07 08:52:16 | 96ms | | GET | /api/websocket | 101 Switching Protocols | 2020-07-07 08:51:43 | 44ms |

kgw4it commented 3 years ago

I'm having the same issue. To me it looks like it's related to the websocket-handling in expose.

bodiroga commented 2 years ago

Hi guys!

Have any of you solved the problem? I'm trying to do the same thing using Node-RED, but things do not work as they should, because the web ui its not able to establish the websockets connection with the app. In my case I'm using Traefik as the reverse proxy with the following configuration:

expose:
  container_name: expose-server
  image: beyondcodegmbh/expose-server:latest
  restart: unless-stopped
  volumes:
    - "${DOCKERDIR}/expose-server/database/expose.db:/root/.expose"
  environment:
    - port=8080
    - domain=${DOMAIN_URL}
    - username=<myusername>
    - password=<mypassword>
  labels:
    - traefik.enable=true
    - traefik.http.routers.expose.entrypoints=websecure
    - traefik.http.routers.expose.rule=HostRegexp(`expose.${DOMAIN_URL}`, `{subhost:[a-z]+}.expose.${DOMAIN_URL}`)
    - traefik.http.routers.expose.tls.certresolver=cloudflare
    - traefik.http.routers.expose.tls.domains[0].main=expose.${DOMAIN_URL}
    - traefik.http.routers.expose.tls.domains[0].sans=*.expose.${DOMAIN_URL}
    - traefik.http.services.expose.loadBalancer.server.port=8080

Does someone know which type of headers should I set to achieve my goal? Any clue will be very valuable, I'm a little bit lost right now.

Many thanks for your help and best regards!

ranrinc commented 2 years ago

Any update on this issue? Would like to implemented for my local environment

sschlein commented 8 months ago

Closing this issue because it's old 🙈