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

Default configuration paths #477

Open
samlikins opened this issue Dec 28, 2017 · 3 comments
Open

Default configuration paths #477

samlikins opened this issue Dec 28, 2017 · 3 comments

Comments

@samlikins
Copy link
Contributor

Under the "Configuration Handling" section of the documentation, it stipulates that the default paths which are checked for a configuration file are:

  • /etc/<app_label>/<app_label>.conf
  • ~/.<app_label>.conf
  • ~/.<app_label>/config

The plugins and templates (as with the configurations) directories have a user specific path that uses the home directory directly. This habit is in conflict with XDG Base Directory Specification; notably:

There is a single base directory relative to which user-specific configuration files should be written. This directory is defined by the environment variable $XDG_CONFIG_HOME...

If $XDG_CONFIG_HOME is either not set or empty, a default equal to $HOME/.config should be used.

As such additional paths to check for configurations should be:

  • ~/.config/<app_label>/<app_label>.conf
  • ~/.config/<app_label>/config
  • ~/.config/<app_label>.conf
  • ~/.config/<app_label>/conf.d

Also for plugins:

  • ~/.config/<app_label>/plugins.d
  • ~/.config/<app_label>/plugins

Lastly for templates:

  • ~/.config/<app_label>/templates

This can be accomplished with minor code modifications.

@samlikins
Copy link
Contributor Author

samlikins commented Dec 28, 2017

The code could be further modified to check for the environment variables (ie: $XDG_DATA_HOME , $XDG_CONFIG_HOME, $XDG_DATA_DIRS, $XDG_CONFIG_DIRS, $XDG_CACHE_HOME, and $XDG_RUNTIME_DIR) and use their values if provided, but this is a good first step in the right direction.

@derks derks added this to the 2.99.2 Portland Development milestone Jan 17, 2018
@derks derks self-assigned this Jan 17, 2018
derks added a commit that referenced this issue Mar 2, 2018
- Resolves Issue #477
- Closes PR #478
@derks
Copy link
Member

derks commented Mar 2, 2018

Implemented in portland (Cement 3) branch.

@derks derks closed this as completed Mar 2, 2018
@derks
Copy link
Member

derks commented Aug 10, 2018

Reopening this as I am re-working config files and directories and realized that these changes should probably be in it's own extension rather than baking into the core framework.

@derks derks reopened this Aug 10, 2018
@derks derks removed this from the 2.99.2 Portland Development milestone Aug 12, 2018
@derks derks removed their assignment Dec 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants