diff options
| author | Paul Buetow <paul@buetow.org> | 2026-02-22 20:53:09 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-02-22 20:53:09 +0200 |
| commit | 9df83b738cd6731c5d7171dc0f4de6bb99871029 (patch) | |
| tree | feb1d82ed0b563d9125ea901b7004afd67f18e78 /internal | |
| parent | 7de95e396d729895a7e1e27c1155c9d365fab41c (diff) | |
Replace all geheim path/name defaults with foostore
- Default data_dir: ~/git/geheimlager → ~/git/foostore-data
- Default export_dir: ~/.geheimlagerexport → ~/.foostore-export
- Default key_file: ~/.geheimlager.key → ~/.foostore.key
- Rename env var GEHEIM_SHELL → FOOSTORE_SHELL
- Update package-level comments across cli, shell, store, git, config
- Update Magefile and CLAUDE.md docs to reflect new paths
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'internal')
| -rw-r--r-- | internal/cli/cli.go | 6 | ||||
| -rw-r--r-- | internal/config/config.go | 12 | ||||
| -rw-r--r-- | internal/config/config_test.go | 8 | ||||
| -rw-r--r-- | internal/git/git.go | 2 | ||||
| -rw-r--r-- | internal/shell/shell.go | 2 | ||||
| -rw-r--r-- | internal/store/store.go | 2 |
6 files changed, 16 insertions, 16 deletions
diff --git a/internal/cli/cli.go b/internal/cli/cli.go index fb76e90..ef00010 100644 --- a/internal/cli/cli.go +++ b/internal/cli/cli.go @@ -1,4 +1,4 @@ -// Package cli implements the command-line interface for geheim. +// Package cli implements the command-line interface for foostore. // It mirrors the Ruby CLI class (geheim.rb lines 551-713): parsing argv, // dispatching commands, and running an optional interactive readline shell. // Run() is the top-level entry point called by cmd/foostore/main.go. @@ -138,10 +138,10 @@ func readPIN() (string, error) { // run dispatches a single command (when argv is non-empty and no shell flag is // set) or enters the interactive shell loop. Returns an exit code. func (c *CLI) run(ctx context.Context, argv []string) int { - // Enter shell mode when: no arguments, $GEHEIM_SHELL is set, or the first + // Enter shell mode when: no arguments, $FOOSTORE_SHELL is set, or the first // argument is "shell". Mirrors the Ruby shell_loop entry conditions. enterShell := len(argv) == 0 || - os.Getenv("GEHEIM_SHELL") != "" || + os.Getenv("FOOSTORE_SHELL") != "" || (len(argv) > 0 && argv[0] == "shell") if enterShell { diff --git a/internal/config/config.go b/internal/config/config.go index 04c8302..2f7871e 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -1,6 +1,6 @@ -// Package config handles loading and storing geheim configuration. +// Package config handles loading and storing foostore configuration. // Defaults mirror the Ruby reference (geheim.rb Config::DEFAULTS). -// A JSON file at ~/.config/geheim.json overrides individual fields; +// A JSON file at ~/.config/foostore.json overrides individual fields; // missing fields keep their default values because Go's json.Unmarshal // only touches fields that are present in the JSON document. package config @@ -17,7 +17,7 @@ import ( const configPath = "~/.config/foostore.json" // Config holds all application-wide configuration values. -// JSON field names use snake_case to match geheim.rb Config::DEFAULTS keys. +// JSON field names use snake_case to match the original geheim.rb Config::DEFAULTS keys. type Config struct { DataDir string `json:"data_dir"` ExportDir string `json:"export_dir"` @@ -46,9 +46,9 @@ func defaultConfig() Config { } return Config{ - DataDir: filepath.Join(home, "git", "geheimlager"), - ExportDir: filepath.Join(home, ".geheimlagerexport"), - KeyFile: filepath.Join(home, ".geheimlager.key"), + DataDir: filepath.Join(home, "git", "foostore-data"), + ExportDir: filepath.Join(home, ".foostore-export"), + KeyFile: filepath.Join(home, ".foostore.key"), KeyLength: 32, EncAlg: "AES-256-CBC", AddToIV: "Hello world", diff --git a/internal/config/config_test.go b/internal/config/config_test.go index 715a09e..4ad8312 100644 --- a/internal/config/config_test.go +++ b/internal/config/config_test.go @@ -78,9 +78,9 @@ func TestLoad_defaults(t *testing.T) { cfg := Load() cases := []struct{ name, got, want string }{ - {"DataDir", cfg.DataDir, filepath.Join(dir, "git", "geheimlager")}, - {"ExportDir", cfg.ExportDir, filepath.Join(dir, ".geheimlagerexport")}, - {"KeyFile", cfg.KeyFile, filepath.Join(dir, ".geheimlager.key")}, + {"DataDir", cfg.DataDir, filepath.Join(dir, "git", "foostore-data")}, + {"ExportDir", cfg.ExportDir, filepath.Join(dir, ".foostore-export")}, + {"KeyFile", cfg.KeyFile, filepath.Join(dir, ".foostore.key")}, {"EncAlg", cfg.EncAlg, "AES-256-CBC"}, {"AddToIV", cfg.AddToIV, "Hello world"}, {"EditCmd", cfg.EditCmd, "vi"}, @@ -145,7 +145,7 @@ func TestLoad_override(t *testing.T) { if cfg.EncAlg != "AES-256-CBC" { t.Errorf("EncAlg = %q; want AES-256-CBC", cfg.EncAlg) } - if cfg.DataDir != filepath.Join(dir, "git", "geheimlager") { + if cfg.DataDir != filepath.Join(dir, "git", "foostore-data") { t.Errorf("DataDir = %q; want default", cfg.DataDir) } } diff --git a/internal/git/git.go b/internal/git/git.go index af4a394..a1e6d6e 100644 --- a/internal/git/git.go +++ b/internal/git/git.go @@ -1,4 +1,4 @@ -// Package git wraps git operations used by geheim to manage the secret store. +// Package git wraps git operations used by foostore to manage the secret store. // It mirrors the Git module from the original Ruby implementation (geheim.rb lines 79-123), // running real git subprocesses rather than using a Go git library. package git diff --git a/internal/shell/shell.go b/internal/shell/shell.go index 1d231b9..16c6366 100644 --- a/internal/shell/shell.go +++ b/internal/shell/shell.go @@ -1,4 +1,4 @@ -// Package shell provides interactive readline-based shell integration for geheim. +// Package shell provides interactive readline-based shell integration for foostore. // It wraps github.com/ergochat/readline to offer vi mode, tab completion, // history deduplication (matching the Ruby reference implementation), and // password reading without echo. diff --git a/internal/store/store.go b/internal/store/store.go index 0dfa5e7..3bed381 100644 --- a/internal/store/store.go +++ b/internal/store/store.go @@ -1,4 +1,4 @@ -// Package store manages the geheim secret store on disk. +// Package store manages the foostore secret store on disk. // It mirrors the Geheim class from the Ruby reference (geheim.rb lines 341-549), // providing add/import/remove/search/export operations over the encrypted file pairs // (.index + .data) stored in cfg.DataDir. |
