saltyorg / Sandbox

Saltbox Sandbox
GNU General Public License v3.0
71 stars 98 forks source link

feat(role): add homeassistant #174

Closed RaneyDazed closed 1 year ago

RaneyDazed commented 1 year ago

Description

This PR is for Home assistant, it is open source home automation that puts local control and privacy first. Its powered by a worldwide community of tinkerers and DIY enthusiasts. Perfect to run on a Raspberry Pi or a local server. Docker compose:

version: '3'
services:
  homeassistant:
    container_name: homeassistant
    image: "lscr.io/linuxserver/homeassistant:stable"
    volumes:
      - /opt/homeassistant:/config
      - /etc/localtime:/etc/localtime:ro
    restart: unless-stopped
    privileged: true
    network_mode: host

It connects to LAN devices just fine, and is connectable after initial setup on lan IP, ie 192.168.1.xx:8123

Doccumentations

I will create the docs post haste!

How Has This Been Tested?

I tested it many times on my local server, removing files and the directory multiple times. Salty gave me a hand with it a few times, figuring out what would allow host mode. Requires newest update of sb and traefik. To allow for the role to work with docker network mode: host.

owine commented 1 year ago

Tag not added to sandbox.yml

RaneyDazed commented 1 year ago

Yup I'd realized that a second ago, fixing rn

RaneyDazed commented 1 year ago

Sorry I'd reverted back to master and didn't realize it. Should be set now.

RaneyDazed commented 1 year ago

If someone runs this role on a remote server in a datacenter, rather on a local LAN, do we introduce any issues?

I will run it on my hetzner and see. I don't forsee any issues, but it wont do you any good really. What issues did you have in mind?

JigSawFr commented 1 year ago

@owine suggested to have a global var like home-use: true/false in settings of saltbox and block some roles depending of the value to avoid an issue, same for homebridge, pi-hole, etc Another way is to not publish ports, and assume that user will use a vpn (like wireguard) container to consume them. (Or manually override to publish port).

RaneyDazed commented 1 year ago

Looks like I need to figure out this rebase thing before this will go anywhere

RaneyDazed commented 1 year ago

So where are we with homeassistant @JigSawFr @owine

Is there something I'm supposed to do to somehow set it local only? I haven't installed on my remote server yet. I can do that then what am I looking for? anything in particular?

RaneyDazed commented 1 year ago

We can always put it on hold if necessary if we are waiting for some kind of true false local thing?

owine commented 1 year ago

I don’t care about a toggle, just want to make sure this won’t cause issues on a remote servers.

RaneyDazed commented 1 year ago

Tested on my remote server and didn't have any trouble. Loaded up just fine, logged in made a user etc.