Coder Social home page Coder Social logo

hass-panel-proxy's Introduction

Panel Proxy

This Home Assistant component creates a panel that performs a reverse proxy to any specified URL, with websockets support. For example, this allows you to add a sidebar entry that embeds an ESPHome dashboard.

This similar to the built-in proxy_iframe, except instead of having the client web browser directly access the resource, Home Assistant will request the resource on your behalf and return it to the browser, which avoids the need for additional SSL termination, authentication, or VPN setup in order to access internal resources.

Security

When you open the panel, this component will fetch a temporary authentication token, then create an iframe with a URL that includes this token. When proxying requests, Home Assistant will check the token before allowing access.

When the authentication token expires, a new token will be generated, which will change the iframe URL and cause the target page to reload. See token_refresh option to control this expiration.

Usage

Put this folder in your custom_components directory.

Add configuration to configuration.yaml:

panel_proxy:
  esphome:
    title: 'ESPHome Dashboard'
    icon: mdi:chip
    url: 'http://esphome:6052/'
    require_admin: true

Supported options:

Option Description Default
title Title to display in sidebar
icon Icon to display in sidebar mdi:bookmark
url The target URL, to which to proxy requests
token_refresh How many seconds each authentication token is valid for 3600
verify_ssl If false, skip SSL verification when accessing url true
require_admin Whether to make available to administrators only false

Caveats

This rewrites absolute URLs in HTTP headers, like Apache's ProxyPassReverse feature, but we don't rewrite URLs inside HTML. This means that pages that expect to be able to use absolute paths will fail.

Inspiration

hass-panel-proxy's People

Contributors

jimparis avatar

Watchers

 avatar

Forkers

mecanisoft

hass-panel-proxy's Issues

500 Internal Server Error Server got itself in trouble

Hi @jimparis,

I wanted to evaluate this custom component. I would like to access my valetudo vaccum cleaner via Home Assistant Panel (over internet), and your custom component sounds like it would do the job. But no matter what I do I can't get it to work and I am getting:

500 Internal Server Error
Server got itself in trouble

panel_proxy:
  valetudo:
    title: 'Valetudo'
    icon: mdi:chip
    url: "http://10.1.3.50/#"
    require_admin: false

I tried to get some log messages for this but so far I was unable to find anything relevant. Is this custom component compatible with HA 2024.2.2? What could I do to get this working?

Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.