Coder Social home page Coder Social logo

haaska-tailscale's Introduction

Haaska with Tailscale

Haaska shipped in a docker image with Tailscale

It allows to use Alexa Smart Home Skill without exposing your Home Assistant instance to the internet (except during setup )

If you fork this repo and setup AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY as Github encrypted secrets, a Github workflow will build and publish a docker image to your AWS ECR own account on eu-west-1 that you then can use for your "HomeAssistant-SmartHome" Lambda function

Currently it uses a fork of haaska in order to use environnment variables instead of the config.json for the home assistant url and token

Requirement: The HA Tailscale Add-on installed and configured

The lambda function needs the 3 env vars:

I advise to limit the concurrency of the Lambda function (e.g. "5") in order not to reach the Tailscale machine limit depending on your plan

Account Linking

The only moment you need to expose your HA instance is during the setup when you do the Account Linking part, (Right before the Enable to use part)

However, the token that your Alexa Skill will receive is only valid for 30 minutes (see https://github.com/home-assistant/core/blob/master/homeassistant/auth/const.py#L4)

Dirty but working trick:

  • update the code for the server to store and respond with a 10 year valid token
  • restart HA
  • update your DNS to point HA instance, forward 443 port from the internet to it
  • do the Account Linking part
  • revert code modifications, restart HA
  • update your DNS to point to your HA Tailscale IP
  • remove port 443 forwarding
  • profit

Following is an example with Hass.io to get the 10 year token with ssh

docker exec -it homeassistant bash
sed -i  s/minutes=30/days=3650/   /usr/src/homeassistant/homeassistant/auth/const.py
exit
docker restart homeassistant

haaska-tailscale's People

Contributors

dbtdsilva avatar tieum avatar

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.