commit b66bc5efb787dba690ee9cd2073dd0a4e70f9584
parent efba5f3f660f14a010fd52a34a08f981b60aedc4
Author: Sean Enck <sean@ttypty.com>
Date: Fri, 28 Jul 2023 19:44:59 -0400
cleaning up env output for config file
Diffstat:
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/internal/config/vars.go b/internal/config/vars.go
@@ -19,6 +19,7 @@ const (
plainKeyMode = "plaintext"
commandKeyMode = "command"
commandArgsExample = "[cmd args...]"
+ fileExample = "file"
detectedValue = "(detected)"
requiredKeyOrKeyFile = "a key, a key file, or both must be set"
// ModTimeFormat is the expected modtime format
@@ -32,7 +33,6 @@ const (
)
var (
- fileExample = []string{"file"}
// Platforms represent the platforms that lockbox understands to run on
Platforms = []string{MacOSPlatform, WindowsLinuxPlatform, LinuxXPlatform, LinuxWaylandPlatform}
// TOTPDefaultColorWindow is the default coloring rules for totp
@@ -62,7 +62,7 @@ var (
// EnvPlatform is the platform that the application is running on
EnvPlatform = EnvironmentString{environmentBase: environmentBase{key: prefixKey + "PLATFORM", desc: "override the detected platform"}, defaultValue: detectedValue, allowed: Platforms, canDefault: false}
// EnvStore is the location of the keepass file/store
- EnvStore = EnvironmentString{environmentBase: environmentBase{key: prefixKey + "STORE", desc: "directory to the database file", requirement: "must be set"}, canDefault: false, allowed: fileExample}
+ EnvStore = EnvironmentString{environmentBase: environmentBase{key: prefixKey + "STORE", desc: "directory to the database file", requirement: "must be set"}, canDefault: false, allowed: []string{fileExample}}
// EnvHookDir is the directory of hooks to execute
EnvHookDir = EnvironmentString{environmentBase: environmentBase{key: prefixKey + "HOOKDIR", desc: "the path to hooks to execute on actions against the database"}, allowed: []string{"directory"}, canDefault: true, defaultValue: ""}
// EnvClipCopy allows overriding the clipboard copy command
@@ -82,7 +82,7 @@ var (
envKeyMode = EnvironmentString{environmentBase: environmentBase{key: prefixKey + "KEYMODE", requirement: "must be set to a valid mode when using a key", desc: "how to retrieve the database store password"}, allowed: []string{commandKeyMode, plainKeyMode}, canDefault: true, defaultValue: commandKeyMode}
envKey = EnvironmentString{environmentBase: environmentBase{requirement: requiredKeyOrKeyFile, key: prefixKey + "KEY", desc: fmt.Sprintf("the database key ('%s' mode) or command to run ('%s' mode)\nto retrieve the database password", plainKeyMode, commandKeyMode)}, allowed: []string{commandArgsExample, "password"}, canDefault: false}
// EnvConfig is the location of the config file to read environment variables from
- EnvConfig = EnvironmentString{environmentBase: environmentBase{key: prefixKey + "ENV", desc: fmt.Sprintf("allows setting a specific file of environment variables\nfor lockbox to read and use as configuration values (an '.env' file)\nthe keyword '%s' will search for a file in the following paths,\nmatching the first:\n(%v)", detectEnvironment, detectEnvironmentPaths)}, canDefault: false, allowed: fileExample}
+ EnvConfig = EnvironmentString{environmentBase: environmentBase{key: prefixKey + "ENV", desc: fmt.Sprintf("allows setting a specific file of environment variables\nfor lockbox to read and use as configuration values (an '.env' file)\nthe keyword '%s' will search for a file in the following paths,\nmatching the first:\n%v", detectEnvironment, detectEnvironmentPaths)}, canDefault: false, allowed: []string{detectEnvironment, fileExample}}
)
// GetReKey will get the rekey environment settings