getumbrel / umbrel-apps

The official app repository of the Umbrel App Store. Submit apps and updates here. Learn how → https://github.com/getumbrel/umbrel-apps#readme
https://apps.umbrel.com
486 stars 363 forks source link

[App Request] - TeslaMate #481

Open sashazykov opened 1 year ago

sashazykov commented 1 year ago

https://docs.teslamate.org/docs/installation/docker

mroxso commented 1 year ago

I like that! I think I will work on trying to integrate it.

You can see the status (and test it) here: https://github.com/mroxso/pluto-umbrel-community-app-store

mroxso commented 1 year ago

But it is my first Umbrel App. And as far as I can see TeslaMate uses 2 Frontends:

anybody an idea how to realize that for umbrel?

also: currently there are hardcoded strings for the secret and db password. use it at your own risk at the moment!

p.s. i did not test it yet on my umbrel.

sashazykov commented 1 year ago

Thank you. There once was a PR adding it, but it was not merged for some reason - https://github.com/getumbrel/umbrel/pull/891

sashazykov commented 1 year ago

I now have teslamate running alonside umbrel and it works fine.

Regarding two ports, you can just link Telsamate UI from Umbrel and there is a link to Grafana from the UI itself.

mroxso commented 1 year ago

I think the most part is done. Only the secrets are the "bad" thing right now. Everything works. I tested it with my Umbrel Node

sashazykov commented 1 year ago

I would suggest you to run it under user and move volumes to the umbrel apps data directory. Here is docker-compose I use:

version: "3"

services:
  teslamate:
    image: teslamate/teslamate:latest
    user: "1000:1000"
    restart: always
    environment:
      - ENCRYPTION_KEY=key
      - DATABASE_USER=teslamate
      - DATABASE_PASS=dbpass
      - DATABASE_NAME=teslamate
      - DATABASE_HOST=database
      - MQTT_HOST=mosquitto
    ports:
      - 4000:4000
    volumes:
      - ./import:/opt/app/import
    cap_drop:
      - all

  database:
    image: postgres:14
    user: "1000:1000"
    restart: always
    environment:
      - POSTGRES_USER=teslamate
      - POSTGRES_PASSWORD=dbpass
      - POSTGRES_DB=teslamate
    volumes:
      - ./data/teslamate-db:/var/lib/postgresql/data

  grafana:
    image: teslamate/grafana:latest
    user: "1000:1000"
    restart: always
    environment:
      - DATABASE_USER=teslamate
      - DATABASE_PASS=dbpass
      - DATABASE_NAME=teslamate
      - DATABASE_HOST=database
    ports:
      - 3000:3000
    volumes:
      - ./data/teslamate-grafana-data:/var/lib/grafana

  mosquitto:
    image: eclipse-mosquitto:2
    user: "1000:1000"
    restart: always
    command: mosquitto -c /mosquitto-no-auth.conf
    volumes:
      - ./data/mosquitto-conf:/mosquitto/config
      - ./data/mosquitto-data:/mosquitto/data
mroxso commented 1 year ago

thank you. i will update it today

mroxso commented 1 year ago

seems like the permissions now are not working for teslamate-grafana -> "permission denied" in the closed PR for TeslaMate, there has been a script to update permissions for grafana. but i think i cannot do it like in the PR because this needs to change something in the umbrel script.

so a docker volume is easier to implement i think (it already works on my umbrel with docker volumes)