Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrConfigNotFound is returned on load if the config was not found ErrConfigNotFound = errors.Errorf("config not found") // ErrConfigNotParsed is returned on load if the config could not be decoded ErrConfigNotParsed = errors.Errorf("config not parseable") )
Functions ¶
func Directory ¶ added in v1.6.1
func Directory() string
Directory returns the configuration directory for the gopass config file
func Homedir ¶ added in v1.4.0
func Homedir() string
Homedir returns the users home dir or an empty string if the lookup fails
func PwStoreDir ¶
PwStoreDir reads the password store dir from the environment or returns the default location ~/.password-store if the env is not set
Types ¶
type Config ¶
type Config struct { Root *StoreConfig `yaml:"root"` Mounts map[string]*StoreConfig `yaml:"mounts"` Version string `yaml:"version"` // Catches all undefined files and must be empty after parsing XXX map[string]interface{} `yaml:",inline"` }
Config is the current config struct
func (*Config) CheckOverflow ¶ added in v1.4.0
CheckOverflow implements configer. It will check for any extra config values not handled by the current struct
func (*Config) SetConfigValue ¶
SetConfigValue will try to set the given key to the value in the config struct
type Pre130 ¶ added in v1.4.1
type Pre130 struct { AlwaysTrust bool `yaml:"alwaystrust"` // always trust public keys when encrypting AskForMore bool `yaml:"askformore"` // ask for more data on generate AutoImport bool `yaml:"autoimport"` // import missing public keys w/o asking AutoPull bool `yaml:"autopull"` // pull from git before push AutoPush bool `yaml:"autopush"` // push to git remote after commit ClipTimeout int `yaml:"cliptimeout"` // clear clipboard after seconds Debug bool `yaml:"debug"` // enable debug output LoadKeys bool `yaml:"loadkeys"` // load missing keys from store Mounts map[string]string `yaml:"mounts,omitempty"` NoColor bool `yaml:"nocolor"` // disable colors in output NoConfirm bool `yaml:"noconfirm"` // do not confirm recipients when encrypting Path string `yaml:"path"` // path to the root store PersistKeys bool `yaml:"persistkeys"` // store recipient keys in store SafeContent bool `yaml:"safecontent"` // avoid showing passwords in terminal Version string `yaml:"version"` // Catches all undefined files and must be empty after parsing XXX map[string]interface{} `yaml:",inline"` }
Pre130 is the gopass config structure before version 1.3.0. Not all fields were available between 1.0.0 and 1.3.0, but this struct should cover all of them.
func (*Pre130) CheckOverflow ¶ added in v1.4.1
CheckOverflow implements configer
type Pre140 ¶ added in v1.4.0
type Pre140 struct { AskForMore bool `yaml:"askformore"` // ask for more data on generate AutoImport bool `yaml:"autoimport"` // import missing public keys w/o asking AutoSync bool `yaml:"autosync"` // push to git remote after commit, pull before push if necessary ClipTimeout int `yaml:"cliptimeout"` // clear clipboard after seconds Mounts map[string]string `yaml:"mounts,omitempty"` NoConfirm bool `yaml:"noconfirm"` // do not confirm recipients when encrypting Path string `yaml:"path"` // path to the root store SafeContent bool `yaml:"safecontent"` // avoid showing passwords in terminal Version string `yaml:"version"` // Catches all undefined files and must be empty after parsing XXX map[string]interface{} `yaml:",inline"` }
Pre140 is the gopass config structure before version 1.4.0
func (*Pre140) CheckOverflow ¶ added in v1.4.0
CheckOverflow implements configer
type StoreConfig ¶ added in v1.4.0
type StoreConfig struct { AskForMore bool `yaml:"askformore"` // ask for more data on generate AutoImport bool `yaml:"autoimport"` // import missing public keys w/o asking AutoSync bool `yaml:"autosync"` // push to git remote after commit, pull before push if necessary ClipTimeout int `yaml:"cliptimeout"` // clear clipboard after seconds NoConfirm bool `yaml:"noconfirm"` // do not confirm recipients when encrypting NoPager bool `yaml:"nopager"` // do not invoke a pager to display long lists Path string `yaml:"path"` // path to the root store SafeContent bool `yaml:"safecontent"` // avoid showing passwords in terminal UseSymbols bool `yaml:"usesymbols"` // always use symbols when generating passwords NoColor bool `yaml:"nocolor"` // do not use color when outputing text }
StoreConfig is a per-store (root or mount) config
func (*StoreConfig) ConfigMap ¶ added in v1.4.0
func (c *StoreConfig) ConfigMap() map[string]string
ConfigMap returns a map of stringified config values for easy printing
func (*StoreConfig) SetConfigValue ¶ added in v1.4.0
func (c *StoreConfig) SetConfigValue(key, value string) error
SetConfigValue will try to set the given key to the value in the config struct
func (StoreConfig) WithContext ¶ added in v1.4.0
func (c StoreConfig) WithContext(ctx context.Context) context.Context
WithContext returns a context with all config options set for this store config, iff they have not been already set in the context