ayushnix / tessen

an interactive menu to autotype and copy pass and gopass data
GNU General Public License v2.0
77 stars 12 forks source link

Gopass multi store/mounts not working #24

Closed sfrique closed 2 years ago

sfrique commented 2 years ago

When using gopass multistore/mounts it always says the password is empty the command fails to know it's on a store

➜ tessen -d wofi -p gopass -a copy
misc/teste is empty

✖1 ✗  gopass show -n -f misc/teste
⚠ Entry "misc/teste" not found. Starting search...
✅ Found exact match in "pessoal/misc/teste"
Secret: pessoal/misc/teste

j6Ap)\u(w5
test: hello

➜ gopass mounts
gopass (/home/sfrique/.local/share/gopass/stores/root)
└── pessoal (/home/sfrique/.local/share/gopass/stores/pessoal)
ayushnix commented 2 years ago

Hmm, I'm unable to reproduce this issue on my system. I have gopass mounts as well and tessen seems to work fine.

Can you show me the output of the following commands?

gopass version
gopass config

➜ tessen -d wofi -p gopass -a copy misc/teste is empty

Does the wofi menu show pessoal/misc/teste or misc/teste?

sfrique commented 2 years ago

wofi only show misc/teste guess that is the problem right?

✖1 ✗  gopass version
gopass 1.13.1 (2022-01-18 21:13:53) go1.17.6 linux amd64
<root>     - gpg 2.2.32 - git 2.35.1
Available Crypto Backends: age, gpgcli, plain
Available Storage Backends: fs, gitfs
f
Your version (1.13.1) of gopass is out of date!
The latest version is 1.14.0.
You can update by downloading from https://www.gopass.pw/#install or via your package manager

➜ gopass config
autoclip: false
autoimport: true
cliptimeout: 45
exportkeys: true
nopager: false
notifications: true
parsing: true
path: /home/sfrique/.local/share/gopass/stores/root
safecontent: false
mount "pessoal" => "/home/sfrique/.local/share/gopass/stores/pessoal"

So I am thinking the problem maybe because I only have the "pessoal" mount right now

I did not migrate work and etc yet, but I am testing stuff

I did not have time to debug it yet

ayushnix commented 2 years ago

wofi only show misc/teste guess that is the problem right?

Yeah, it should show pessoal/misc/teste, assuming misc/teste.gpg is present inside /home/sfrique/.local/share/gopass/stores/pessoal. I'm not sure why this would happen because I've tried to reproduce the same gopass folder structure as yours in my system locally and it works fine for me.

So I am thinking the problem maybe because I only have the "pessoal" mount right now

tessen should work fine with just a single gopass mount. It shouldn't be a problem.

For example, here's my test gopass password store structure

$ gopass config
autoclip: false
autoimport: true
cliptimeout: 45
exportkeys: true
nopager: false
notifications: true
parsing: true
path: /data/others/.trash/gopass/root-store
safecontent: false
mount "mount-1" => "/data/others/.trash/gopass/first-mount"
mount "mount-2" => "/data/others/.trash/gopass/second-mount"
mount "mount-3" => "/data/others/.trash/gopass/mount-3"
mount "mount-4" => "/home/username/.cache/tmpgopass/stores/mount-4"

and here's the files that I have

$ gopass ls
gopass
├── company/
│   ├── ayushnix-keyval
│   └── ayushnix-otp
├── mount-1 (/data/others/.trash/gopass/first-mount)
│   └── company/
│       └── ayushnix-keyval
├── mount-2 (/data/others/.trash/gopass/second-mount)
│   └── ayushnix-customkeys
├── mount-3 (/data/others/.trash/gopass/mount-3)
│   └── same-dirname-as-mount-name
├── mount-4 (/home/username/.cache/tmpgopass/stores/mount-4)
│   └── another-test-file-with-same-name
└── root-entry

With this folder structure, tessen works fine and lists all the files in all the mounts correctly.

sfrique commented 2 years ago

I see, can you point me how does tessen get the list from gopass?

The file is there:

➜ la /home/sfrique/.local/share/gopass/stores/pessoal/misc/teste.gpg
.rw------- 472 sfrique 20 mar 13:07 /home/sfrique/.local/share/gopass/stores/pessoal/misc/teste.gpg
ayushnix commented 2 years ago

Never mind, I created multiple files inside a single mount and now I'm able to reproduce this issue.

Thanks for reporting this bug. I'll try to fix it soon.

sfrique commented 2 years ago

nice! If i have time I will also try to figure out a fix!

ayushnix commented 2 years ago

@sfrique Can you confirm if this bug has been fixed?

sfrique commented 2 years ago

yes it now shows the path and I am able to use it

thanks!

ayushnix commented 2 years ago

No problem, thanks for reporting this bug.