summaryrefslogtreecommitdiff
path: root/internal
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-02-22 19:17:57 +0200
committerPaul Buetow <paul@buetow.org>2026-02-22 19:17:57 +0200
commitd629558394465b8956285edac324d67688ddd2c1 (patch)
treef511cf1ea87d916c11e85243361c366ae9843cd4 /internal
parent48280e828bc4737a91ed556226f7fdcb52679f87 (diff)
Rename binary from geheim to foostore
- go.mod: module path codeberg.org/snonux/geheim → codeberg.org/snonux/foostore - cmd/geheim/ → cmd/foostore/ - Magefile.go: binary/binaryName/mainPkg constants updated - internal/config: config file path ~/.config/geheim.json → ~/.config/foostore.json - All import paths and comments updated throughout - Delete geheim.rb (the original Ruby implementation, superseded by this Go rewrite) - CLAUDE.md rewritten to reflect the Go implementation, new binary name, build system (mage), and current package architecture Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'internal')
-rw-r--r--internal/cli/cli.go24
-rw-r--r--internal/config/config.go2
-rw-r--r--internal/config/config_test.go8
-rw-r--r--internal/crypto/crypto_test.go2
-rw-r--r--internal/git/git_test.go2
-rw-r--r--internal/shell/shell_test.go2
-rw-r--r--internal/store/data.go4
-rw-r--r--internal/store/data_test.go2
-rw-r--r--internal/store/index.go4
-rw-r--r--internal/store/index_test.go2
-rw-r--r--internal/store/store.go6
-rw-r--r--internal/store/store_test.go6
12 files changed, 32 insertions, 32 deletions
diff --git a/internal/cli/cli.go b/internal/cli/cli.go
index 0ae4dde..fb76e90 100644
--- a/internal/cli/cli.go
+++ b/internal/cli/cli.go
@@ -1,7 +1,7 @@
// Package cli implements the command-line interface for geheim.
// 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/geheim/main.go.
+// Run() is the top-level entry point called by cmd/foostore/main.go.
package cli
import (
@@ -15,13 +15,13 @@ import (
"runtime"
"strings"
- "codeberg.org/snonux/geheim/internal/clipboard"
- "codeberg.org/snonux/geheim/internal/config"
- "codeberg.org/snonux/geheim/internal/crypto"
- "codeberg.org/snonux/geheim/internal/git"
- "codeberg.org/snonux/geheim/internal/shell"
- "codeberg.org/snonux/geheim/internal/store"
- "codeberg.org/snonux/geheim/internal/version"
+ "codeberg.org/snonux/foostore/internal/clipboard"
+ "codeberg.org/snonux/foostore/internal/config"
+ "codeberg.org/snonux/foostore/internal/crypto"
+ "codeberg.org/snonux/foostore/internal/git"
+ "codeberg.org/snonux/foostore/internal/shell"
+ "codeberg.org/snonux/foostore/internal/store"
+ "codeberg.org/snonux/foostore/internal/version"
)
// CommandList is the canonical list of supported commands, ordered to match
@@ -60,7 +60,7 @@ type CLI struct {
}
// New initialises all runtime dependencies (config, PIN, cipher, store, git,
-// clipboard, shell) and returns a ready-to-use CLI. cmd/geheim/main.go calls
+// clipboard, shell) and returns a ready-to-use CLI. cmd/foostore/main.go calls
// New with a signal-cancellable context so that long-running operations (fzf,
// external editors) are interrupted cleanly on SIGINT/SIGTERM.
func New(ctx context.Context) (*CLI, error) {
@@ -70,7 +70,7 @@ func New(ctx context.Context) (*CLI, error) {
// Run dispatches argv (typically os.Args[1:]) to the appropriate handler or
// enters the interactive shell loop. Returns an exit code suitable for
// os.Exit. The caller is responsible for calling sh.Close() when done;
-// cmd/geheim/main.go does this via defer.
+// cmd/foostore/main.go does this via defer.
func (c *CLI) Run(ctx context.Context, argv []string) int {
defer c.sh.Close()
return c.run(ctx, argv)
@@ -297,7 +297,7 @@ func (c *CLI) dispatchSimple(ctx context.Context, argv []string, cmd string) (in
return 0, "", true
case "version":
- logMsg(fmt.Sprintf("geheim %s", version.Version))
+ logMsg(fmt.Sprintf("foostore %s", version.Version))
return 0, "", true
case "commands":
@@ -315,7 +315,7 @@ func (c *CLI) dispatchSimple(ctx context.Context, argv []string, cmd string) (in
// dispatch is called, so this branch only fires in one-shot mode where
// switching to interactive mode is not meaningful. We print a notice and
// exit cleanly rather than silently doing nothing.
- logMsg("Use geheim without arguments to enter interactive mode")
+ logMsg("Use foostore without arguments to enter interactive mode")
return 0, "", true
case "exit":
diff --git a/internal/config/config.go b/internal/config/config.go
index f48a046..6354d83 100644
--- a/internal/config/config.go
+++ b/internal/config/config.go
@@ -14,7 +14,7 @@ import (
)
// configPath is the location of the optional user config file.
-const configPath = "~/.config/geheim.json"
+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.
diff --git a/internal/config/config_test.go b/internal/config/config_test.go
index ae2d6c1..3f8ace9 100644
--- a/internal/config/config_test.go
+++ b/internal/config/config_test.go
@@ -9,7 +9,7 @@ import (
"testing"
)
-// writeUserConfig creates the ~/.config/geheim.json file inside the given
+// writeUserConfig creates the ~/.config/foostore.json file inside the given
// HOME directory (which must already exist). Used to exercise Load() directly.
func writeUserConfig(t *testing.T, home, content string) {
t.Helper()
@@ -17,7 +17,7 @@ func writeUserConfig(t *testing.T, home, content string) {
if err := os.MkdirAll(cfgDir, 0o755); err != nil {
t.Fatalf("MkdirAll: %v", err)
}
- path := filepath.Join(cfgDir, "geheim.json")
+ path := filepath.Join(cfgDir, "foostore.json")
if err := os.WriteFile(path, []byte(content), 0o600); err != nil {
t.Fatalf("WriteFile: %v", err)
}
@@ -167,7 +167,7 @@ func TestLoad_invalid_json(t *testing.T) {
// TestLoad_missing_file_no_warning verifies that a missing config file does NOT
// produce any output — absence is normal for a first-run or unconfigured install.
func TestLoad_missing_file_no_warning(t *testing.T) {
- dir := t.TempDir() // no geheim.json inside
+ dir := t.TempDir() // no foostore.json inside
t.Setenv("HOME", dir)
stderr := captureStderr(func() { _ = Load() })
@@ -188,7 +188,7 @@ func TestLoad_unreadable_file(t *testing.T) {
writeUserConfig(t, dir, `{"edit_cmd":"nvim"}`)
// Make the file unreadable.
- cfgPath := filepath.Join(dir, ".config", "geheim.json")
+ cfgPath := filepath.Join(dir, ".config", "foostore.json")
if err := os.Chmod(cfgPath, 0o000); err != nil {
t.Fatalf("Chmod: %v", err)
}
diff --git a/internal/crypto/crypto_test.go b/internal/crypto/crypto_test.go
index 556a12e..fb37d69 100644
--- a/internal/crypto/crypto_test.go
+++ b/internal/crypto/crypto_test.go
@@ -294,7 +294,7 @@ func TestEncryptGolden(t *testing.T) {
wantHex: "6190f985f42374d24dd8e17b3b2d6057",
},
{
- name: "Hello world / pin=abcd1234 / 64x 'y'",
+ name: "Hello world / pin=abcd1234 / 64x 'y'",
plaintext: []byte("Hello, world!"),
pin: "abcd1234",
// 64 bytes of 'y': key is already 2x the required 32 bytes so it gets truncated.
diff --git a/internal/git/git_test.go b/internal/git/git_test.go
index 87d2ecf..fa1f8f7 100644
--- a/internal/git/git_test.go
+++ b/internal/git/git_test.go
@@ -8,7 +8,7 @@ import (
"strings"
"testing"
- "codeberg.org/snonux/geheim/internal/git"
+ "codeberg.org/snonux/foostore/internal/git"
)
// initRepo creates a temporary git repository with a minimal config so that
diff --git a/internal/shell/shell_test.go b/internal/shell/shell_test.go
index 19491e3..71eafa8 100644
--- a/internal/shell/shell_test.go
+++ b/internal/shell/shell_test.go
@@ -8,7 +8,7 @@ import (
"os"
"testing"
- "codeberg.org/snonux/geheim/internal/shell"
+ "codeberg.org/snonux/foostore/internal/shell"
)
// isTTY returns true when stdin is connected to an actual terminal.
diff --git a/internal/store/data.go b/internal/store/data.go
index b9423f2..fb33bf0 100644
--- a/internal/store/data.go
+++ b/internal/store/data.go
@@ -9,8 +9,8 @@ import (
"path/filepath"
"strings"
- "codeberg.org/snonux/geheim/internal/crypto"
- "codeberg.org/snonux/geheim/internal/git"
+ "codeberg.org/snonux/foostore/internal/crypto"
+ "codeberg.org/snonux/foostore/internal/git"
)
// Data holds a decrypted secret blob and the paths used to persist it.
diff --git a/internal/store/data_test.go b/internal/store/data_test.go
index 88b80cd..42721af 100644
--- a/internal/store/data_test.go
+++ b/internal/store/data_test.go
@@ -8,7 +8,7 @@ import (
"path/filepath"
"testing"
- "codeberg.org/snonux/geheim/internal/crypto"
+ "codeberg.org/snonux/foostore/internal/crypto"
)
// --- helpers -----------------------------------------------------------------
diff --git a/internal/store/index.go b/internal/store/index.go
index 9064971..923082f 100644
--- a/internal/store/index.go
+++ b/internal/store/index.go
@@ -11,8 +11,8 @@ import (
"path/filepath"
"strings"
- "codeberg.org/snonux/geheim/internal/crypto"
- "codeberg.org/snonux/geheim/internal/git"
+ "codeberg.org/snonux/foostore/internal/crypto"
+ "codeberg.org/snonux/foostore/internal/git"
)
// Index represents a decrypted .index file and its associated .data path.
diff --git a/internal/store/index_test.go b/internal/store/index_test.go
index a16d757..57aea8c 100644
--- a/internal/store/index_test.go
+++ b/internal/store/index_test.go
@@ -9,7 +9,7 @@ import (
"strings"
"testing"
- "codeberg.org/snonux/geheim/internal/crypto"
+ "codeberg.org/snonux/foostore/internal/crypto"
)
// newTestIndexCipher is a local helper to avoid import cycle via store_test.go.
diff --git a/internal/store/store.go b/internal/store/store.go
index fe9f132..0dfa5e7 100644
--- a/internal/store/store.go
+++ b/internal/store/store.go
@@ -19,9 +19,9 @@ import (
"sort"
"strings"
- "codeberg.org/snonux/geheim/internal/config"
- "codeberg.org/snonux/geheim/internal/crypto"
- "codeberg.org/snonux/geheim/internal/git"
+ "codeberg.org/snonux/foostore/internal/config"
+ "codeberg.org/snonux/foostore/internal/crypto"
+ "codeberg.org/snonux/foostore/internal/git"
)
// Action describes what to do with each matching secret during a Search call.
diff --git a/internal/store/store_test.go b/internal/store/store_test.go
index 950c010..9670a01 100644
--- a/internal/store/store_test.go
+++ b/internal/store/store_test.go
@@ -13,9 +13,9 @@ import (
"strings"
"testing"
- "codeberg.org/snonux/geheim/internal/config"
- "codeberg.org/snonux/geheim/internal/crypto"
- "codeberg.org/snonux/geheim/internal/git"
+ "codeberg.org/snonux/foostore/internal/config"
+ "codeberg.org/snonux/foostore/internal/crypto"
+ "codeberg.org/snonux/foostore/internal/git"
)
// --- test helpers ------------------------------------------------------------