gopasspw / gopass-jsonapi

Gopass Browser Bindings
MIT License
51 stars 19 forks source link

gopass-jsonapi configure complains store uninitialized #104

Open liljenstolpe opened 1 year ago

liljenstolpe commented 1 year ago

Summary

bridge has stopped working on my Arch box. When I attempt to run gopass-jsonapi configure I get the following error:

Failed to initialize gopass API: password store not initialized. run 'gopass setup' first

But gopass is fully configured and running

Steps To Reproduce

Not sure how I got here. So, not quite sure how to reproduce, sorry.

Expected behavior

Be able to re-run configure on a running gopass system and be able to bring up bridge or other jsonapi clients

But - maybe - have a new-style config file, and non-default store location?

Environment

Please complete the following information (see note below)

Re-ran with DEBUG set, here are some interesting tid-bits...

❯ cat /tmp/gp.log
2023/04/07 19:03:55.079858 pwrules/aliases.go:55    pwrules.loadCustomAliases   no custom aliases found at /home/cdl/.config/gopass/domain-aliases.json
2023/04/07 19:03:55.108839 config/io.go:47  config.loadConfig   Trying to load config from /home/cdl/.config/gopass/config.yml
2023/04/07 19:03:55.108863 config/io.go:47  config.loadConfig   Trying to load config from /home/cdl/.config/gopass/config.yml
2023/04/07 19:03:55.108871 config/io.go:47  config.loadConfig   Trying to load config from /home/cdl/.gopass.yml
2023/04/07 19:03:55.109291 config/io.go:66  config.loadDefault  Loaded default config: &config.Config{AutoClip:false, AutoImport:false, ClipTimeout:45, ExportKeys:true, NoPager:false, Notifications:true, Parsing:true, Path:"/home/cdl/.local/share/gopass/stores/root", SafeContent:false, Mounts:map[string]string{}, ConfigPath:"/home/cdl/.config/gopass/config.yml", XXX:map[string]interface {}(nil)}

The key here, is you aren't seeing the config.

The config is in /home/cdl/.config/gopass/config note it's in the NEW format (the gitconfig format), not the YAML format. It looks like you aren't looking for the non-yaml format configs. Therefore, you aren't finding my stores.

Note, I didn't change the config format, I assume some upgrade that gopass went through in the last year did the translation in a migration.

liljenstolpe commented 1 year ago

@dominikschulz, any thoughts on this?

liljenstolpe commented 1 year ago

Ok, I have an ugly hack workaround, that works for some reason.

$ gopass-jsonapi configure --print

Then, at the end, when it asks you to install, say 'Y'. Evidently, that somehow bypasses the check that is blocking the normal install/configure.

liljenstolpe commented 1 year ago

Is there anyone paying attention here?

liljenstolpe commented 1 year ago

@dominkschultz - need anything else from me?

fetwar commented 1 year ago

+1, although slightly different.

I am unable to able to install for all users, without initialising a password store for the root user, which is a bit annoying.

You could change /etc/opt/chrome/native-messaging-hosts directory to allow write from non root users, then switch it back after running the install script. Although the install locations for the wrapper etc would default to still being in your home directory.

dominikschulz commented 1 year ago

I am unable to able to install for all users, without initialising a password store for the root user, which is a bit annoying.

This is something we should fix. An initialized password store should not be required to install the extension.