FR: pass static settings during load time, allowing being overriden at runtime
Describe the problem to be solved
In diverse setups it's interesting to be able to pre-define some settings when the application loads, instead of having to manually set them via the settings page.
One possibility is to have environment variables for each setting (as suggested on #445, for instance), but this approach does not scale as the number of settings will increase with time.
The user should still be able to change such settings manually, overriding the ones passed at load time.
Describe the solution that you'd like
As we use json for the settings, we could encode the complete settings in a single value, passed either via environment variable or command line argument; something along the lines of:
LIGHTMETER_STATIC_SETTINGS='{"global": {"localIP": "127.0.0.1", "appLanguage": "en", "publicURL": "https://example.com/lightmeter/"}, "slack": {"bearerToken": "123456", "channel": "my_channel"}}'
Or:
-static_settings '{"global": {"localIP": "127.0.0.1", "appLanguage": "en", "publicURL": "https://example.com/lightmeter/"}, "slack": {"bearerToken": "123456", "channel": "my_channel"}}'
If the user changes some of those settings manually, those should take priority over the "static" ones.
Describe alternatives you've considered
Right now the user must manually set such values at runtime, via the settings page.
Additional context
This feature is interesting for the Demo Server as well as for managed services, such as the SaaS solution we plan to provide for a wider range of users. We can pre-configure the e-mail notifications based on the owner of an instance, for instance.