Hypfer / ICantBelieveItsNotValetudo

A Valetudo companion service which renders maps to pngs
Apache License 2.0
129 stars 80 forks source link

Option to disable config.json writes #11

Closed markusressel closed 4 years ago

markusressel commented 4 years ago

Hey there, great stuff :nerd_face:

I tried to run the docker image in a Kubernetes Cluster and mapped the configuration file to the container using a ConfigMap. ConfigMaps, however, are not writable by design. I tried to use a volume mount that maps directly to the /app/config.js file through the rancher UI but I'm either stupid or it just doesn't work. Since the application tries to write the configuration to disk in a couple of places it fails to start and the container is shut down as well.

To get around this I cloned this repo and slightly modified the Configuration.prototype.persist() method to catch any exception that may happen during write.

The question for me is: Does ICantBelieveItsNotValetudo actually need to write the configuration at any point in time?

I mean there is no web interface or anything and the configuration can only be changed manually by editing the file on disk anyway, right? Or did I break something by just "disabling" configuration file writes altogether? (I didn't test the map generation yet, but at least it starts up fine so I assume it is working)

Hypfer commented 4 years ago

It's just there because I've copied the .js file over from Valetudo so we could simply patch that out

markusressel commented 3 years ago

Since this is broken again with the current repository, for anyone interested: I have setup a small repo that builds docker containers from the main branch of this repo daily, with the this.persist(); lines removed from the Configuration.js with a simple sed command. The resulting container can be found here: https://hub.docker.com/r/markusressel/icantbelieveitsnotvaletudo/tags?page=1&ordering=last_updated

Hypfer commented 2 years ago

https://github.com/Hypfer/ICantBelieveItsNotValetudo/commit/d8c3b91551ee65c504124151ad49bec2266db07f

Should be fixed with 2021.11.0