Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Application configuration #23

Open
rockerbacon opened this issue Feb 14, 2024 · 0 comments · May be fixed by #24
Open

Application configuration #23

rockerbacon opened this issue Feb 14, 2024 · 0 comments · May be fixed by #24
Labels
enhancement New feature or request

Comments

@rockerbacon
Copy link
Owner

rockerbacon commented Feb 14, 2024

About

As discussed in #17, we would like to have a way for configuring some application-wide settings through a configuration file.

Solution

We will use a 2-level configuration. Any given setting will be first read from a configuration file, if the configuration file does not exist or does not specify the desired setting, a sensible default should be used.
The configuration file will be in JSON format.
The file location is pre-defined, and varies based on operating system:

  • Linux: we'll follow the XDG spec and the file will be placed at $XDG_CONFIG_HOME/icm/settings.json. $HOME/.config will be used in place of XDG_CONFIG_HOME if it is not set.
  • MacOS: I could not find any official up-to-date documents, but archived documents suggest we should place our file at $HOME/Library/Application Support/icm/settings.json. I found other people corroborating the information and no suggestion of alternative locations.
  • Windows: I could not find any official documents, but the overall consensus on the internet is that application configuration files should be placed within "%AppData%", so we'll use %AppData%\icm\settings.json

The implementation can use the two variables we already wish to parameterize (HTTP server host and port) to provide a more complete feature and better validate itself.

This issue does not cover features for manipulating the settings file.

@rockerbacon rockerbacon added the enhancement New feature or request label Feb 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant