Athens: Update default path for proxy config file

Created on 14 Nov 2018  路  3Comments  路  Source: gomods/athens

The current default path to the config file is ../../config.dev.toml regardless from where you start the proxy.

I'd suggest to use a more generic name for the file, as config.toml and also either skip the path entirely or even better use (per OS) specific config path. E.g.:

OS | Path |
---- | ---- |
Linux | $XDG_CONFIG_HOME |
macOS | ~/Library/Application Support/ (details) |
Windows | %LOCALAPPDATA% |

proposal refactor

Most helpful comment

what about multiple valid paths with priority, on load config init would check each of them

./config.toml
{homeDir}/config.toml - {homeDir} resolved based on OS
/etc/athens/config.toml - on linux
../../config.toml

I do not mind to rename to athens.config.toml especially with homedir involved

All 3 comments

$XDG_CONFIG_HOME should probably just be $HOME as not all Linux distros support the base directory specification.

what about multiple valid paths with priority, on load config init would check each of them

./config.toml
{homeDir}/config.toml - {homeDir} resolved based on OS
/etc/athens/config.toml - on linux
../../config.toml

I do not mind to rename to athens.config.toml especially with homedir involved

For Linux if it's in the home directory, priority should be [.athens.config.toml, .config/athens/config.toml, /etc/athens/config.toml] or similar but in that order. Home then home relative config directory then system level. However system level config directories are not standardized across distributions.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

marwan-at-work picture marwan-at-work  路  4Comments

robjloranger picture robjloranger  路  4Comments

chriscoffee picture chriscoffee  路  3Comments

arschles picture arschles  路  3Comments

chriscoffee picture chriscoffee  路  4Comments