You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This program caches authentication-related and other data in a local SQLite database. The location of this database is determined in the following way:
If --profile arg is provided:
XDG_CONFIG_HOME/b2/db-<profile>.sqlite, if XDG_CONFIG_HOME env var is set
~/.b2db-{profile}.sqlite
Otherwise:
B2_ACCOUNT_INFO env var’s value, if set
~/.b2_account_info, if it exists
XDG_CONFIG_HOME/b2/account_info, if XDG_CONFIG_HOME env var is set
~/.b2_account_info, as default
If the directory XDG_CONFIG_HOME/b2 does not exist (and is needed), it is created.
This program caches authentication-related and other data in a local SQLite database.
The location of this database is determined in the following way:
If ``--profile`` arg is provided:
* ``{XDG_CONFIG_HOME_ENV_VAR}/b2/db-<profile>.sqlite``, if ``{XDG_CONFIG_HOME_ENV_VAR}`` env var is set
* ``{B2_ACCOUNT_INFO_PROFILE_FILE}``
Otherwise:
* ``{B2_ACCOUNT_INFO_ENV_VAR}`` env var's value, if set
* ``{B2_ACCOUNT_INFO_DEFAULT_FILE}``, if it exists
* ``{XDG_CONFIG_HOME_ENV_VAR}/b2/account_info``, if ``{XDG_CONFIG_HOME_ENV_VAR}`` env var is set
* ``{B2_ACCOUNT_INFO_DEFAULT_FILE}``, as default
If the directory ``{XDG_CONFIG_HOME_ENV_VAR}/b2`` does not exist (and is needed), it is created.
Problem
The problem with the above is the fallback to ~/.b2*.
The XDG Base Directory specification demands (emphasis by me):
XDG_CONFIG_HOME defines the base directory relative to which user-specific configuration files should be stored. If $XDG_CONFIG_HOME is either not set or empty, a default equal to $HOME/.config should be used.
I'd like to propose that b2 properly adheres to the XDG Base Directory specification, meaning to fall back to $HOME/.config/b2/ if XDG_CONFIG_HOME is unset.
Intro
Current docs of the b2 CLI state1:
Current source of that documentation states:
B2_Command_Line_Tool/b2/console_tool.py
Lines 766 to 779 in 88a0305
Problem
The problem with the above is the fallback to
~/.b2*
.The XDG Base Directory specification demands (emphasis by me):
I think most popular Linux distributions like Ubuntu or Arch do not set the
XDG_CACHE_HOME
,XDG_CONFIG_HOME
,XDG_DATA_HOME
andXDG_STATE_HOME
environment variables and expect programs to fall back to the spec's default paths.Solution
I'd like to propose that b2 properly adheres to the XDG Base Directory specification, meaning to fall back to
$HOME/.config/b2/
ifXDG_CONFIG_HOME
is unset.Related: #699
Footnotes
Note that the doc's Markdown formatting is partially broken, see fix Markdown formatting #957 ↩
The text was updated successfully, but these errors were encountered: