SensorsIot / IOTstack

Docker stack for getting started on IOT on the Raspberry PI
GNU General Public License v3.0
1.45k stars 308 forks source link

Add Support for Gladys Assistant #492

Closed amamel closed 2 years ago

amamel commented 2 years ago

Please add support for installing Glady's Assistant on the IoT stack.

A privacy-first, open-source home assistant. A super-stable software, designed for performance & security

Glady's Assistant Docs

Paraphraser commented 2 years ago

@amamel

Well, I took a look and this is what I came up with:

  gladys:
    container_name: gladys
    image: gladysassistant/gladys:v4
    restart: unless-stopped
    environment:
      - TZ=Australia/Sydney
      - NODE_ENV=production
      - SERVER_PORT=8123
      - SQLITE_FILE_PATH=/var/lib/gladysassistant/gladys-production.db
    network_mode: host
    volumes:
      - ./volumes/gladysassistant:/var/lib/gladysassistant
      - /var/run/docker.sock:/var/run/docker.sock
      - /dev:/dev:ro
      - /run/udev:/run/udev:ro

The container seemed to start (in the sense of not going into a restart loop) and I could connect on port 8123 (which I picked because it's the HA port).

A few questions before I go any further:

  1. I'm not a fan of any container that specifies the "privileged" flag. Why is it required? I omitted it and nothing seemed to complain.
  2. I don't understand why the example at the docs link you gave wants to give the container read-write access to the host's /dev. That makes me very very twitchy. I've appended the ":ro" flag and nothing seemed to complain.
  3. Despite the assurance that all the data is stored locally, I take the view that a UI should never ask for a DoB. Why on earth does a service like Gladys need to know a user's date of birth? Yes, I know ye can respond with nonsense but that's not the point. No system should demand personally-identifying information without a demonstrable need-to-know.

Then there's this:

$ docker logs gladys 
2022-02-09T15:44:47+1100 <warn> service.start.js:44 (Service.start) Unable to start service zigbee2mqtt Error: (HTTP code 301) unexpected -  
    at /src/server/node_modules/docker-modem/lib/modem.js:301:17
    at getCause (/src/server/node_modules/docker-modem/lib/modem.js:331:7)
    at Modem.buildPayload (/src/server/node_modules/docker-modem/lib/modem.js:300:5)
    at IncomingMessage.<anonymous> (/src/server/node_modules/docker-modem/lib/modem.js:275:14)
    at IncomingMessage.emit (events.js:412:35)
    at endReadableNT (internal/streams/readable.js:1334:12)
    at processTicksAndRejections (internal/process/task_queues.js:82:21) {
  reason: undefined,
  statusCode: 301,
  json: <Buffer >
}
2022-02-09T15:44:47+1100 <error> index.js:20 (process.<anonymous>) uncaughtException catched: uncaughtException
2022-02-09T15:44:47+1100 <error> index.js:21 (process.<anonymous>) Error: getaddrinfo ENOTFOUND containers
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:71:26) {
  errno: -3008,
  code: 'ENOTFOUND',
  syscall: 'getaddrinfo',
  hostname: 'containers'
}
2022-02-09T15:44:47+1100 <warn> service.start.js:44 (Service.start) Unable to start service mqtt Error: (HTTP code 301) unexpected -  
    at /src/server/node_modules/docker-modem/lib/modem.js:301:17
    at getCause (/src/server/node_modules/docker-modem/lib/modem.js:331:7)
    at Modem.buildPayload (/src/server/node_modules/docker-modem/lib/modem.js:300:5)
    at IncomingMessage.<anonymous> (/src/server/node_modules/docker-modem/lib/modem.js:275:14)
    at IncomingMessage.emit (events.js:412:35)
    at endReadableNT (internal/streams/readable.js:1334:12)
    at processTicksAndRejections (internal/process/task_queues.js:82:21) {
  reason: undefined,
  statusCode: 301,
  json: <Buffer >
}
2022-02-09T15:44:47+1100 <error> index.js:20 (process.<anonymous>) uncaughtException catched: uncaughtException
2022-02-09T15:44:47+1100 <error> index.js:21 (process.<anonymous>) Error: getaddrinfo ENOTFOUND containers
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:71:26) {
  errno: -3008,
  code: 'ENOTFOUND',
  syscall: 'getaddrinfo',
  hostname: 'containers'
}

Those appear to suggest the container expects to be able to start zigbeee2mqtt and a service called "mqtt" (which might mean Mosquitto). After a bit of nosing around I found the "integrations" page, clicked on MQTT and was presented with:

Screen Shot 2022-02-09 at 16 01 18

Well, it is running on Docker and, guess what, a Mosquitto container is running right alongside:

NAMES          CREATED          STATUS
gladys         18 minutes ago   Up 18 minutes
influxdb       28 minutes ago   Up 28 minutes (healthy)
pihole         28 minutes ago   Up 28 minutes (healthy)
wireguard      28 minutes ago   Up 28 minutes
grafana        28 minutes ago   Up 28 minutes (healthy)
nodered        28 minutes ago   Up 28 minutes (healthy)
mosquitto      28 minutes ago   Up 28 minutes (healthy)
portainer-ce   28 minutes ago   Up 28 minutes

At a pinch I could also get zigbee2mqtt running on this box too but I'm not sure I'd get any further.

Kinda stuck...

Paraphraser commented 2 years ago

No response. Should probably be considered stale.