Add configuration file handling to ratman daemon
Currently the only way to configure ratmand
is to provide a set of flags via the command line, or to set some environment variables. To make ratmand
easier to run we want to add a config file with the main settings.
Following is an outline of how this feature should work.
- Grab appropriate XDG environment variables to determine the state and config directory locations.
- Create
ratmand
state and configuration directories (if they don't exist) - Attempt to read from the existing configuration if it exists
- If it doesn't exist, attempt to create one from the default settings included in the daemon
- If this fails, resume without writing the configuration. No not crash!
- Include any overrides from the command line and apply them to the "active settings"
- Continue launching ratmand with the selected settings
For the beginning we should try to keep the set of configuration values small, since it adds a surface of compatibility issues down the line. The following settings should be included in the first draft of the config file:
- Enable/ Disable
netmod-inet
-
netmod-inet
bind address/ port - Enable/ Disable
netmod-lan
- API bind address/ port
-
accept_unknown_peers
with a comment as to what it does and when a user may want it on or off.