Skip to content

fix: Gittea write config to XDG_CONFIG_HOME when set - #620

Merged
scottisloud merged 2 commits into
1Password:mainfrom
rr3khan:fix/gitea-xdg-config-home
Jul 7, 2026
Merged

scottisloud merged 2 commits into
1Password:mainfrom
rr3khan:fix/gitea-xdg-config-home

Conversation

@rr3khan

@rr3khan rr3khan commented Jul 3, 2026 •

Copy link
Copy Markdown
Contributor

Overview

On macOS with $XDG_CONFIG_HOME exported, op plugin init tea writes tea's config to a path tea never reads, so every tea command fails with Error: no available login.

The plugin resolves the config path with os.UserConfigDir(), which ignores $XDG_CONFIG_HOME on darwin, while tea resolves it through adrg/xdg, which prefers $XDG_CONFIG_HOME on every platform. When the variable is set (common for users syncing dotfiles across Linux and macOS), the two diverge: the plugin writes to ~/Library/Application Support/tea/config.yml while tea reads from $XDG_CONFIG_HOME/tea/config.yml.

ConfigPath() now checks $XDG_CONFIG_HOME first and falls back to os.UserConfigDir(), matching tea's own resolution order. Added tests covering both branches.

Type of change

  • Created a new plugin
  • Improved an existing plugin
  • Fixed a bug in an existing plugin
  • Improved contributor utilities or experience

Related Issue(s)

How To Test

export XDG_CONFIG_HOME=$HOME/.config
op plugin init tea   # link a Gitea personal access token
tea pulls            # previously: Error: no available login

Without $XDG_CONFIG_HOME set, behavior is unchanged (os.UserConfigDir() fallback). go test ./plugins/gitea/... and make gitea/validate pass.

Changelog

The Gitea plugin now writes tea's configuration to the location tea reads when XDG_CONFIG_HOME is set.

@rr3khan rr3khan changed the title fix: write config to XDG_CONFIG_HOME when set Jul 3, 2026
@scottisloud
scottisloud self-requested a review July 7, 2026 21:25

@scottisloud scottisloud left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! LGTM.

@scottisloud
scottisloud merged commit 9c3e59c into 1Password:main Jul 7, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants