twpayne / chezmoi

Manage your dotfiles across multiple diverse machines, securely.
https://www.chezmoi.io/
MIT License
12.9k stars 478 forks source link

Wrong .chezmoi.config.age.identity #3593

Closed ErrrorMaxx closed 6 months ago

ErrrorMaxx commented 6 months ago

Describe the bug

Wanted to setup .chezmoiignore to ignore encypted files when configured decrypting key is not available yet. But .chezmoi.config.age.identity contains not my configured path, but a {}

To reproduce

In .chezmoi.yaml.tmpl:

encryption: "age"
age:
  identity: ~/.config/chezmoi/key.sec
  recipient: "..."
$ cz execute-template '{{ .chezmoi.config.age.identity }}'
map[]

Expected behavior

Expected to get ~/.config/chezmoi/key.sec or like that

Output of command with the --verbose flag

$ chezmoi --verbose data
{
  "chezmoi": {
    ...
    "config": {
      ...
      "age": {
        "args": null,
        "command": "/data/data/com.termux/files/usr/bin/rage",
        "identities": null,
        "identity": {},
        "passphrase": false,
        "recipient": "...",
        "recipients": null,
        "recipientsFile": {},
        "recipientsFiles": null,
        "suffix": ".age",
        "symmetric": false,
        "useBuiltin": false
      },
      ...

Output of chezmoi doctor

```console $ chezmoi doctor RESULT CHECK MESSAGE warning version v2.46.1 ok latest-version v2.46.1 ok os-arch android/arm64 ok uname Linux localhost 4.19.191+ #1 SMP PREEMPT Wed Nov 29 21:44:22 CST 2023 aarch64 Android ok go-version go1.21.6 (gc) ok executable /data/data/com.termux/files/usr/bin/chezmoi ok config-file ~/.config/chezmoi/chezmoi.yaml, last modified 2024-02-23T21:19:17Z warning source-dir ~/.local/share/chezmoi is a git working tree (dirty) ok suspicious-entries no suspicious entries warning working-tree ~/.local/share/chezmoi is a git working tree (dirty) ok dest-dir ~ is a directory warning umask 077 ok cd-command found /data/data/com.termux/files/usr/bin/zsh ok cd-args /data/data/com.termux/files/usr/bin/zsh info diff-command not set ok edit-command found /data/data/com.termux/files/usr/bin/micro ok edit-args /data/data/com.termux/files/usr/bin/micro ok git-command found /data/data/com.termux/files/usr/bin/git, version 2.43.2 warning merge-command vimdiff not found in $PATH ok shell-command found /data/data/com.termux/files/usr/bin/zsh ok shell-args /data/data/com.termux/files/usr/bin/zsh ok age-command found /data/data/com.termux/files/usr/bin/rage, version 0.10.0 ok gpg-command found /data/data/com.termux/files/usr/bin/gpg, version 2.4.4 info pinentry-command not set info 1password-command op not found in $PATH info bitwarden-command bw not found in $PATH info bitwarden-secrets-command bws not found in $PATH info dashlane-command dcli not found in $PATH info doppler-command doppler not found in $PATH info gopass-command gopass not found in $PATH info keepassxc-command keepassxc-cli not found in $PATH info keepassxc-db not set info keeper-command keeper not found in $PATH info lastpass-command lpass not found in $PATH info pass-command pass not found in $PATH info passhole-command ph not found in $PATH info rbw-command rbw not found in $PATH info vault-command vault not found in $PATH info vlt-command vlt not found in $PATH info secret-command not set ```
twpayne commented 6 months ago

This is the same bug as #3582. Let's move tracking to that one.