lunacam
lunacam copied to clipboard
Configuration changes
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:
- reload any run-time components to observe the configuration change (e.g. reloading templates or restarting the HTTP server)
- flush an updated config.json onto disk
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 ofConfig
against the same backing file - Still requires a static config file under /etc