Suggestion: config should be stored in ~/.config/op

lilyball
lilyball
Community Member

It looks like op stores information about previously-signed-in teams in ~/.op/config. It would be nice if this was stored in ${XDG_CONFIG_HOME:-~/.config}/op/config (to use Bash's syntax for fallback values for environment variables).

That said, I'm not really sure this counts as config, since it's not user-editable data. Perhaps it should be data instead, which would be ${XDG_DATA_HOME:-~/.local/share}/op, or cache, which would be ${XDG_CACHE_HOME:-~/.cache}/op.

This would make op more consistent with a number of other tools and avoid littering the home folder with yet another dotfile.


1Password Version: Not Provided
Extension Version: Not Provided
OS Version: Not Provided
Sync Type: Not Provided

Comments

  • ag_konstantin
    ag_konstantin
    1Password Alumni

    Hi @kballard,

    Thank you for writing in and for your suggestion! The tool does take into consideration XDG_CONFIG_HOME environment variable to determine where to store its configuration. Currently the config file would be stored in $XDG_CONFIG_HOME/.op/config. If XDG_CONFIG_HOME environment variable is not set or is empty, then the tool would fallback to storing its configuration in the home folder.

    Please let us know if this is not the behavior you are observing.

    As for whether the stored configuration files belong in config, data, or cache category... we value your opinion, and we will bring it up for an internal debate in future.

    Kind regards,
    Konstantin

  • lilyball
    lilyball
    Community Member

    I haven't tried setting $XDG_CONFIG_HOME, but the standard behavior for tools that use this variable is to fall back to behaving as though XDG_CONFIG_HOME is set to ~/.config if the variable is unset. You can find more information at the XDG Base Directory Specification.

  • ag_konstantin
    ag_konstantin
    1Password Alumni
    edited August 2018

    Thank you for the link @kballard. You've got a good point there. We will discuss the fallback location internally with the team to see if we can deploy such change safely without disrupting the service for existing customers.

    Kind regards,
    Konstantin

  • Moritz_
    Moritz_
    Community Member

    Just found this and agree with the op (no pun intended lol)

  • AGAlumB
    AGAlumB
    1Password Alumni

    Ha! Nevertheless, well played. Thanks for letting us know you'd gopher that change too. :crazy:

  • Thank you for the suggestion, @kballard! I created an issue for this improvement.

This discussion has been closed.