Giter Club home page Giter Club logo

Comments (11)

Koenkk avatar Koenkk commented on September 24, 2024 2

Yes, will do this

from zigbee2mqtt.

Koenkk avatar Koenkk commented on September 24, 2024

I'm wondering why there should be a configuration option for the dbPath. Can't this be done by mounting the /app/data volume to the persistent hassio folder? (the same as where the zigbee2mqtt configuration.yaml will be)

from zigbee2mqtt.

tb-killa avatar tb-killa commented on September 24, 2024

@Koenkk i think it should be the users choice to point to the DB file.
I vote up for the dbpath inside the configuration file.

from zigbee2mqtt.

danielwelch avatar danielwelch commented on September 24, 2024

@Koenkk The current approach we're taking in the add-on doesn't mount configuration.yaml into a persistent Hass.io volume, but instead writes the options (from the Hass.io UI) to configuration.yaml in-place within the container on startup. Hass.io allows the add-on to specify certain volumes (such as /share) that can be mounted within an add-on container, so if we could specify the DB location, we could save to one of these persistent volumes.

The problem with the current approach is that the location is hard-coded, and essentially "within" a bunch of things that we would not want to persist between builds/versions. In addition to making it possible to persist the data, breaking out the dbPath as a config option would make things less rigid in this sense.

from zigbee2mqtt.

dgomes avatar dgomes commented on September 24, 2024

Also the log file should remain in a separate directory.

I think /data is overly used for static stuff

from zigbee2mqtt.

Koenkk avatar Koenkk commented on September 24, 2024

@danielwelch this sounds like a good approach, however how would you handle the devices being automatically added to configuration.yaml? In order for a device to work it has to be there.

from zigbee2mqtt.

danielwelch avatar danielwelch commented on September 24, 2024

Sounds like configuration.yaml needs to be persisted too for this to work properly since device data is persisted there (not just the DB), right?

If that's the case, I think the easiest thing would be to allow the user to specify a path for this file as well via the Hass.io add-on, just like we're requesting for the db. This would let us store configuration.yaml in /share, and the user could edit it directly.

I understand these are big requests, sorry!

from zigbee2mqtt.

Koenkk avatar Koenkk commented on September 24, 2024

Yes that is the case, wouldn't is be easier to symlink /app/data to /share?

from zigbee2mqtt.

danielwelch avatar danielwelch commented on September 24, 2024

I am far from a Docker expert, but my understanding is that symlinking into and out of docker containers leads to problems and is generally not a good idea.

Since the major motivation for this change is the add-on, I'd be happy to work on a solution and make a PR. I'll focus on making this backward-compatible for current users.

from zigbee2mqtt.

Koenkk avatar Koenkk commented on September 24, 2024

Both dbPath and panId are configurable now, can this be closed?

from zigbee2mqtt.

danielwelch avatar danielwelch commented on September 24, 2024

I'd say so, thanks!

from zigbee2mqtt.

Related Issues (20)

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.