nektro/andesite

Consider using a dynamic config.json to handle settings

KNOXDEV opened this issue · 6 comments

I think requiring CLI arguments to function properly is not an ideal configuration strategy for what essentially amounts to a service. I propose the following:

  1. Eliminate all command line arguments except one: --config that will allow you to declare the location of config.json dynamically
  2. If the config argument above is not passed, fall back to some POSIX-y default, like ~/.andesite/config.json
  3. Move all previous command line settings into config.json

This strategy is very typical for applications of this nature.

I forgot to mention that I did see Issue #26, but I'm not sure what the status is on that endeavor, this issue proposes a different solution entirely, and I believe this offers a better alternative.

I recently added --use-home true which places the config.json inside of ~/.config/andesite/. Is this a suggestion to also be able to set --root, --port, and others from inside the config file? Just clarifying before I move forward.

Actually, --use-home is going to be removed and it will auto fallback to ~/.config/andesite/ if /.andesite/ is not found in --root.

Also, #26 was originally created to be used in conjunction with eventual Docker support and not manual usage. Though people would be free to do so.

The Andesite executable can now be launched with no CLI arguments and is able to read all config info from the respective properties inside ~/.config/andesite/config.json.