Documentation ¶
Index ¶
- Variables
- func Directory() string
- func Homedir() string
- func PwStoreDir(mount string) string
- type Config
- func (c *Config) CheckOverflow() error
- func (c *Config) Config() *Config
- func (c *Config) ConfigMap() map[string]string
- func (c *Config) Directory() string
- func (c *Config) Save() error
- func (c *Config) SetConfigValue(key, value string) error
- func (c *Config) String() string
- func (c *Config) WithContext(ctx context.Context) context.Context
- type Pre1102
- type Pre1127
- type Pre130
- type Pre140
- type Pre182
- type Pre182StoreConfig
- type Pre193
- type Pre193StoreConfig
Constants ¶
This section is empty.
Variables ¶
var ( // ErrConfigNotFound is returned on load if the config was not found. ErrConfigNotFound = fmt.Errorf("config not found") // ErrConfigNotParsed is returned on load if the config could not be decoded. ErrConfigNotParsed = fmt.Errorf("config not parseable") )
Functions ¶
func Directory ¶
func Directory() string
Directory returns the configuration directory for the gopass config file.
func Homedir ¶
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 if the env is not set.
Types ¶
type Config ¶
type Config struct { AutoClip bool `yaml:"autoclip"` // decide whether passwords are automatically copied or not. AutoImport bool `yaml:"autoimport"` // import missing public keys w/o asking. ClipTimeout int `yaml:"cliptimeout"` // clear clipboard after seconds. ExportKeys bool `yaml:"exportkeys"` // automatically export public keys of all recipients. NoPager bool `yaml:"nopager"` // do not invoke a pager to display long lists. Notifications bool `yaml:"notifications"` // enable desktop notifications. Parsing bool `yaml:"parsing"` // allows to switch off all output parsing. Path string `yaml:"path"` SafeContent bool `yaml:"safecontent"` // avoid showing passwords in terminal. Mounts map[string]string `yaml:"mounts"` UseKeychain bool `yaml:"keychain"` // use OS keychain for age ConfigPath string `yaml:"-"` // Catches all undefined files and must be empty after parsing. XXX map[string]any `yaml:",inline"` }
Config is the current config struct.
func Load ¶
func Load() *Config
Load will load the config from the default location or return a default config.
func LoadWithFallback ¶
func LoadWithFallback() *Config
LoadWithFallback will try to load the config from one of the default locations.
func LoadWithFallbackRelaxed ¶ added in v1.12.1
func LoadWithFallbackRelaxed() *Config
LoadWithFallbackRelaxed will try to load the config from one of the default. locations but also accept a more recent config.
func (*Config) CheckOverflow ¶
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 Pre1102 ¶
type Pre1102 struct { AutoClip bool `yaml:"autoclip"` // decide whether passwords are automatically copied or not. AutoImport bool `yaml:"autoimport"` // import missing public keys w/o asking. ClipTimeout int `yaml:"cliptimeout"` // clear clipboard after seconds. ExportKeys bool `yaml:"exportkeys"` // automatically export public keys of all recipients. MIME bool `yaml:"mime"` // enable gopass native MIME secrets. NoColor bool `yaml:"nocolor"` // do not use color when outputing text. NoPager bool `yaml:"nopager"` // do not invoke a pager to display long lists. Notifications bool `yaml:"notifications"` // enable desktop notifications. Path string `yaml:"path"` SafeContent bool `yaml:"safecontent"` // avoid showing passwords in terminal. Mounts map[string]string `yaml:"mounts"` // Catches all undefined files and must be empty after parsing. XXX map[string]any `yaml:",inline"` }
Pre1102 is a pre-1.10.2 config.
func (*Pre1102) CheckOverflow ¶
CheckOverflow implements configer.
type Pre1127 ¶ added in v1.12.8
type Pre1127 struct { AutoClip bool `yaml:"autoclip"` // decide whether passwords are automatically copied or not. AutoImport bool `yaml:"autoimport"` // import missing public keys w/o asking. ClipTimeout int `yaml:"cliptimeout"` // clear clipboard after seconds. ExportKeys bool `yaml:"exportkeys"` // automatically export public keys of all recipients. NoColor bool `yaml:"nocolor"` // do not use color when outputing text. NoPager bool `yaml:"nopager"` // do not invoke a pager to display long lists. Notifications bool `yaml:"notifications"` // enable desktop notifications. Parsing bool `yaml:"parsing"` // allows to switch off all output parsing. Path string `yaml:"path"` SafeContent bool `yaml:"safecontent"` // avoid showing passwords in terminal. Mounts map[string]string `yaml:"mounts"` ConfigPath string `yaml:"-"` // Catches all undefined files and must be empty after parsing. XXX map[string]any `yaml:",inline"` }
Pre1127 is a pre-1.12.7 config.
func (*Pre1127) CheckOverflow ¶ added in v1.12.8
CheckOverflow implements configer.
type Pre130 ¶
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. Confirm 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]any `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 ¶
CheckOverflow implements configer.
type Pre140 ¶
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"` Confirm 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]any `yaml:",inline"` }
Pre140 is the gopass config structure before version 1.4.0.
func (*Pre140) CheckOverflow ¶
CheckOverflow implements configer.
type Pre182 ¶
type Pre182 struct { Path string `yaml:"-"` Root *Pre182StoreConfig `yaml:"root"` Mounts map[string]*Pre182StoreConfig `yaml:"mounts"` Version string `yaml:"version"` // Catches all undefined files and must be empty after parsing. XXX map[string]any `yaml:",inline"` }
Pre182 is the gopass config structure before version 1.8.2.
func (*Pre182) CheckOverflow ¶
CheckOverflow implements configer.
type Pre182StoreConfig ¶
type Pre182StoreConfig struct { AskForMore bool `yaml:"askformore"` // ask for more data on generate. AutoClip bool `yaml:"autoclip"` // decide whether passwords are automatically copied or not. 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. CheckRecpHash bool `yaml:"check_recipient_hash"` ClipTimeout int `yaml:"cliptimeout"` // clear clipboard after seconds. Concurrency int `yaml:"concurrency"` // allow to run multiple thread when batch processing. EditRecipients bool `yaml:"editrecipients"` // edit recipients when confirming. NoColor bool `yaml:"nocolor"` // do not use color when outputing text. Confirm bool `yaml:"noconfirm"` // do not confirm recipients when encrypting. NoPager bool `yaml:"nopager"` // do not invoke a pager to display long lists. Notifications bool `yaml:"notifications"` // enable desktop notifications. Path string `yaml:"path"` // path to the root store. RecipientHash map[string]string `yaml:"recipient_hash"` SafeContent bool `yaml:"safecontent"` // avoid showing passwords in terminal. UseSymbols bool `yaml:"usesymbols"` // always use symbols when generating passwords. }
Pre182StoreConfig is a per-store (root or mount) config.
type Pre193 ¶
type Pre193 struct { Path string `yaml:"-"` Root *Pre193StoreConfig Mounts map[string]*Pre193StoreConfig // Catches all undefined files and must be empty after parsing. XXX map[string]any `yaml:",inline"` }
Pre193 is is pre-1.9.3 config.
func (*Pre193) CheckOverflow ¶
CheckOverflow implements configer.
type Pre193StoreConfig ¶
type Pre193StoreConfig struct { AutoClip bool `yaml:"autoclip"` // decide whether passwords are automatically copied or not. 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. CheckRecpHash bool `yaml:"check_recipient_hash"` ClipTimeout int `yaml:"cliptimeout"` // clear clipboard after seconds. Concurrency int `yaml:"concurrency"` // allow to run multiple thread when batch processing. EditRecipients bool `yaml:"editrecipients"` // edit recipients when confirming. ExportKeys bool `yaml:"exportkeys"` // automatically export public keys of all recipients. NoColor bool `yaml:"nocolor"` // do not use color when outputing text. Confirm bool `yaml:"noconfirm"` // do not confirm recipients when encrypting. NoPager bool `yaml:"nopager"` // do not invoke a pager to display long lists. Notifications bool `yaml:"notifications"` // enable desktop notifications. Path string `yaml:"path"` // path to the root store. RecipientHash map[string]string `yaml:"recipient_hash"` SafeContent bool `yaml:"safecontent"` // avoid showing passwords in terminal. UseSymbols bool `yaml:"usesymbols"` // always use symbols when generating passwords. }
Pre193StoreConfig is a pre-1.9.3 store config.