gopasspw / gopass

The slightly more awesome standard unix password manager for teams
https://www.gopass.pw/
MIT License
5.84k stars 487 forks source link

docs: example for gopass mounts add command #2951

Open jcrben opened 1 day ago

jcrben commented 1 day ago

Putting the link to the docs here might not make as much sense as putting in the main command I guess. Let me know if you want me to pull them up. Of course you don't have to accept this, open to your feedback

I've been feeling a bit dense using gopass to be honest, originally was trying to add an existing mount and it spits out this ugly message:

ben2204@lenovo-legion:~/dotfiles$ gopass mounts add $(pwd)/.password-store

Error: failed to add mount "/home/ben2204/dotfiles/.password-store" to "/home/ben2204/.local/share/gopass/stores/-home-ben2204-dotfiles-.password-store": failed to add mount: failed to init sub store "home/ben2204/dotfiles/.password-store" at "/home/ben2204/.local/share/gopass/stores/-home-ben2204-dotfiles-.password-store": password store home/ben2204/dotfiles/.password-store is not initialized. Try gopass init --store home/ben2204/dotfiles/.password-store --path /home/ben2204/.local/share/gopass/stores/-home-ben2204-dotfiles-.password-store

I then followed that up with this:

gopass mounts add -c $(pwd)/.password-store

which created this ugliness:

ben2204@lenovo-legion:~/dotfiles$ gopass ls
gopass
└── home/
    └── ben2204/
        └── dotfiles/
            └── .password-store (/home/ben2204/.local/share/gopass/stores/-home-ben2204-dotfiles-.password-store)

Finally figured it out after reading the fine manual (RTFM) 😄

ben2204@lenovo-legion:~/dotfiles$ gopass mounts add  secondary-store $(pwd)/.password-store
Mounted secondary-store as /home/ben2204/dotfiles/.password-store
ben2204@lenovo-legion:~/dotfiles$ gopass ls
gopass
├── asecret
└── secondary-store (/home/ben2204/dotfiles/.password-store)
    └── test1
dominikschulz commented 1 hour ago

Thank you. I agree the command is not as easy to use as I'd expect it to be. I think we should try to make it more user friendly. Your change is a first step in that direction but I think we should also think about further ways to make this easy to use.

Accidentally mounting a tree inside the store (like in your pwd example) sounds like something we should be able to detect and prevent. And if there is only one argument given and it matches an existing path we might hint the user at the correct invocation.