diff options
| author | Paul Buetow <paul@buetow.org> | 2026-04-18 08:20:34 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-04-18 08:20:34 +0300 |
| commit | b3e0fad0b7e4ba02821df602d01c2275f82527d5 (patch) | |
| tree | 7a176b86f556162220cb7303ec0d283162e596ce /internal/config | |
| parent | 9cab01cc8a3ec80a9ecede8a609b7b6e0769a446 (diff) | |
feat: make keepass the default backend with master.kdbx default path
Change default backend from "geheim" to "keepass" and default KDBXPath
from ~/Documents/Keepass/master to ~/Documents/Keepass/master.kdbx.
Existing geheim users must set backend="geheim" in ~/.config/foostore.json.
Update resolveBackend fallback, struct comments, and test assertions to match.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'internal/config')
| -rw-r--r-- | internal/config/config.go | 16 | ||||
| -rw-r--r-- | internal/config/config_test.go | 4 |
2 files changed, 11 insertions, 9 deletions
diff --git a/internal/config/config.go b/internal/config/config.go index 3b4bed4..f0cc6f0 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -22,8 +22,8 @@ const ( // Config holds all application-wide configuration values. // JSON field names use snake_case to match the original geheim.rb Config::DEFAULTS keys. -// The Backend field selects the storage backend: "geheim" (default, encrypted -// .index/.data files in a git repo) or "keepass" (a .kdbx database file). +// The Backend field selects the storage backend: "keepass" (default, a .kdbx +// database file) or "geheim" (encrypted .index/.data files in a git repo). type Config struct { DataDir string `json:"data_dir"` ExportDir string `json:"export_dir"` @@ -36,10 +36,10 @@ type Config struct { MacOSClipboardCmd string `json:"macos_clipboard_cmd"` SyncRepos []string `json:"sync_repos"` - // Backend selects the storage backend: "geheim" (default) or "keepass". + // Backend selects the storage backend: "keepass" (default) or "geheim". Backend string `json:"backend"` // KDBXPath is the path to the KeePass .kdbx database file. - // Defaults to ~/Documents/Keepass/master to match migrate-kdbx defaults. + // Defaults to ~/Documents/Keepass/master.kdbx. KDBXPath string `json:"kdbx_path"` // KDBXKeyFile is the optional path to a KeePass key file. // An empty value disables key file authentication. @@ -115,12 +115,14 @@ func defaultConfigWithHome(home string) Config { MacOSClipboardCmd: "pbcopy", SyncRepos: []string{"git1", "git2"}, - // Backend defaults match the geheim (original) storage backend. + // Backend defaults to "keepass" so new users get the KeePass backend + // out of the box. Existing geheim users must set backend="geheim" in + // ~/.config/foostore.json to keep their existing behaviour. // KDBXPath and KDBXPassFile defaults mirror the migrate-kdbx command // at internal/cli/migrate_kdbx.go so users who already use that command // have zero additional configuration to provide. - Backend: "geheim", - KDBXPath: filepath.Join(home, "Documents", "Keepass", "master"), + Backend: "keepass", + KDBXPath: filepath.Join(home, "Documents", "Keepass", "master.kdbx"), KDBXKeyFile: "", KDBXPassFile: filepath.Join(home, ".master.pass"), } diff --git a/internal/config/config_test.go b/internal/config/config_test.go index 7ffcc68..eac7340 100644 --- a/internal/config/config_test.go +++ b/internal/config/config_test.go @@ -296,8 +296,8 @@ func TestLoad_backendDefaults(t *testing.T) { cfg := Load() cases := []struct{ name, got, want string }{ - {"Backend", cfg.Backend, "geheim"}, - {"KDBXPath", cfg.KDBXPath, filepath.Join(dir, "Documents", "Keepass", "master")}, + {"Backend", cfg.Backend, "keepass"}, + {"KDBXPath", cfg.KDBXPath, filepath.Join(dir, "Documents", "Keepass", "master.kdbx")}, {"KDBXKeyFile", cfg.KDBXKeyFile, ""}, {"KDBXPassFile", cfg.KDBXPassFile, filepath.Join(dir, ".master.pass")}, } |
