lunacam icon indicating copy to clipboard operation
lunacam copied to clipboard

Configuration changes

Open reynoldsbd opened this issue 6 years ago • 1 comments

Currently, changes to LunaCam configuration require manually editing /etc/lunacam/config.json on the Pi and restarting lunacam.service.

Eventually, it should be possible to change configuration via the Web UI. Additionally, such changes should generally not require any restart.

Proposal

Move config.json under /var, into some directory accessible by the lunacam user (which we can setup using tmpfiles.d). When the user makes a configuration change using the web UI, the server process should then:

  1. reload any run-time components to observe the configuration change (e.g. reloading templates or restarting the HTTP server)
  2. flush an updated config.json onto disk

reynoldsbd avatar Feb 17 '19 17:02 reynoldsbd

Work is in progress. The config module provides a read/write configuration store suitable for use by multiple components.

Still a few open issues:

  • Easy to abuse config by opening more than one instance of Config against the same backing file
  • Still requires a static config file under /etc

reynoldsbd avatar Jun 15 '19 17:06 reynoldsbd