From d479bfcd52cd101ba8df15ddde72ff82290acc7d Mon Sep 17 00:00:00 2001 From: sneak Date: Wed, 10 Jun 2026 11:37:23 -0700 Subject: [PATCH] Adopt sneak.berlin/go/vaultik vanity import path, README overhaul Module path changed from git.eeqj.de/sneak/vaultik to sneak.berlin/go/vaultik (vanity redirect). All imports, ldflags, Dockerfile, goreleaser config, and docs updated. App data/config directories now use plain "vaultik" instead of the reverse-DNS name. README: - New copy-pasteable quickstart at top: go install, config init, age keypair, config set for key + file:// destination, home backup - All command names in command details are code-quoted - config set/get gained sequence index support (age_recipients.0) so lists are settable from the CLI - Dockerfile build is CGO_ENABLED=0 to match the pure-Go build --- .goreleaser.yaml | 4 +- Dockerfile | 2 +- Makefile | 4 +- README.md | 107 +++++++-------- cmd/vaultik/main.go | 2 +- go.mod | 2 +- internal/blob/packer.go | 8 +- internal/blob/packer_test.go | 6 +- internal/cli/app.go | 18 +-- internal/cli/config.go | 125 ++++++++++++------ internal/cli/config_test.go | 20 ++- internal/cli/database.go | 4 +- internal/cli/info.go | 4 +- internal/cli/prune.go | 4 +- internal/cli/remote.go | 4 +- internal/cli/restore.go | 10 +- internal/cli/snapshot.go | 4 +- internal/cli/store.go | 4 +- internal/cli/version.go | 2 +- internal/config/config.go | 4 +- internal/database/blob_chunks_test.go | 2 +- internal/database/blobs.go | 2 +- internal/database/blobs_test.go | 2 +- internal/database/cascade_debug_test.go | 2 +- internal/database/chunk_files.go | 2 +- internal/database/chunk_files_test.go | 2 +- internal/database/chunks.go | 2 +- internal/database/chunks_test.go | 2 +- internal/database/database.go | 2 +- internal/database/file_chunks.go | 2 +- internal/database/file_chunks_test.go | 2 +- internal/database/files.go | 4 +- internal/database/models.go | 2 +- internal/database/module.go | 4 +- internal/database/repositories_test.go | 2 +- .../database/repository_comprehensive_test.go | 2 +- .../database/repository_edge_cases_test.go | 2 +- internal/database/snapshots.go | 2 +- internal/database/snapshots_test.go | 2 +- internal/database/uploads.go | 2 +- internal/s3/client_test.go | 2 +- internal/s3/module.go | 2 +- internal/snapshot/backup_test.go | 4 +- internal/snapshot/exclude_test.go | 8 +- internal/snapshot/file_change_test.go | 8 +- internal/snapshot/module.go | 6 +- internal/snapshot/progress.go | 2 +- internal/snapshot/scanner.go | 12 +- internal/snapshot/scanner_test.go | 8 +- internal/snapshot/snapshot.go | 12 +- internal/snapshot/snapshot_test.go | 6 +- internal/storage/module.go | 4 +- internal/storage/s3.go | 2 +- internal/vaultik/blob_fetch.go | 2 +- internal/vaultik/blob_fetch_hash_test.go | 4 +- internal/vaultik/helpers.go | 2 +- internal/vaultik/info.go | 4 +- internal/vaultik/integration_test.go | 14 +- internal/vaultik/prune.go | 2 +- internal/vaultik/purge_per_name_test.go | 8 +- internal/vaultik/remove_snapshot_test.go | 8 +- internal/vaultik/restore.go | 8 +- internal/vaultik/snapshot.go | 8 +- internal/vaultik/vaultik.go | 12 +- internal/vaultik/verify.go | 4 +- internal/vaultik/verify_test.go | 2 +- 66 files changed, 299 insertions(+), 237 deletions(-) diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 899223d..8e90817 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -20,8 +20,8 @@ builds: - arm64 ldflags: - -s -w - - -X 'git.eeqj.de/sneak/vaultik/internal/globals.Version={{ .Version }}' - - -X 'git.eeqj.de/sneak/vaultik/internal/globals.Commit={{ .Commit }}' + - -X 'sneak.berlin/go/vaultik/internal/globals.Version={{ .Version }}' + - -X 'sneak.berlin/go/vaultik/internal/globals.Commit={{ .Commit }}' archives: - id: default diff --git a/Dockerfile b/Dockerfile index 9fa0aaa..7ca5651 100644 --- a/Dockerfile +++ b/Dockerfile @@ -42,7 +42,7 @@ COPY . . RUN make test # Build with CGO enabled (required for mattn/go-sqlite3) -RUN CGO_ENABLED=1 go build -ldflags "-X 'git.eeqj.de/sneak/vaultik/internal/globals.Version=${VERSION}' -X 'git.eeqj.de/sneak/vaultik/internal/globals.Commit=$(git rev-parse HEAD 2>/dev/null || echo unknown)'" -o /vaultik ./cmd/vaultik +RUN CGO_ENABLED=0 go build -ldflags "-X 'sneak.berlin/go/vaultik/internal/globals.Version=${VERSION}' -X 'sneak.berlin/go/vaultik/internal/globals.Commit=$(git rev-parse HEAD 2>/dev/null || echo unknown)'" -o /vaultik ./cmd/vaultik # Runtime stage # alpine:3.21, 2026-02-25 diff --git a/Makefile b/Makefile index 24490cf..3b639c7 100644 --- a/Makefile +++ b/Makefile @@ -7,8 +7,8 @@ VERSION := 1.0.0-rc.1 GIT_REVISION := $(shell git rev-parse HEAD 2>/dev/null || echo "unknown") # Linker flags -LDFLAGS := -X 'git.eeqj.de/sneak/vaultik/internal/globals.Version=$(VERSION)' \ - -X 'git.eeqj.de/sneak/vaultik/internal/globals.Commit=$(GIT_REVISION)' +LDFLAGS := -X 'sneak.berlin/go/vaultik/internal/globals.Version=$(VERSION)' \ + -X 'sneak.berlin/go/vaultik/internal/globals.Commit=$(GIT_REVISION)' # Default target all: vaultik diff --git a/README.md b/README.md index bf9e7d1..c80a550 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,32 @@ remote S3-compatible object store. It requires no private keys, secrets, or credentials (other than those required to PUT to encrypted object storage, such as S3 API keys) stored on the backed-up system. +## quickstart + +```sh +# install +go install sneak.berlin/go/vaultik/cmd/vaultik@latest + +# create a default config file (prints the path it wrote to) +vaultik config init + +# generate an age keypair; keep key.txt somewhere safe and offline — +# you need it to restore, and the backed-up machine does not need it +age-keygen -o key.txt +grep 'public key' key.txt + +# configure the encryption key and backup destination +vaultik config set age_recipients.0 age1YOUR_PUBLIC_KEY_HERE +vaultik config set storage_url "file:///Volumes/usbstick/mybackup" + +# back up your home directory (the default config includes a "home" +# snapshot of ~ with sensible excludes) +vaultik snapshot create + +# see what you have +vaultik snapshot list +``` + Features: * modern encryption ([age](https://age-encryption.org/), X25519 + XChaCha20-Poly1305) @@ -38,43 +64,19 @@ Requirements that no existing tool meets: * encrypted * s3 compatible without an intermediate step or tool -## install +## daily use ```sh -go install git.eeqj.de/sneak/vaultik@latest -``` - -## quick start - -```sh -# 1. Install -go install git.eeqj.de/sneak/vaultik@latest - -# 2. Generate an age keypair (store the private key somewhere safe, offline) -age-keygen -o key.txt -# the public key is printed to stdout and also in key.txt - -# 3. Create a default config file -vaultik config init -# Writes to the platform config directory with commented defaults: -# macOS: ~/Library/Application Support/vaultik/config.yml -# Linux: ~/.config/vaultik/config.yml -# root: /etc/vaultik/config.yml - -# 4. Edit the config: set age_recipients, snapshots, and storage_url -vaultik config edit # opens $EDITOR -# or set individual values: -vaultik config set storage_url "file:///mnt/backups" -vaultik config get storage_url - -# 5. Run your first backup -vaultik snapshot create - -# 6. Verify it worked -vaultik snapshot list +# verify a snapshot (shallow: checks all blobs exist) vaultik snapshot verify -# 7. Set up a daily cron job (keeps last 4 weeks of snapshots) +# deep verify (downloads and cryptographically verifies every blob) +VAULTIK_AGE_SECRET_KEY='AGE-SECRET-KEY-...' vaultik snapshot verify --deep + +# restore (requires the private key) +VAULTIK_AGE_SECRET_KEY='AGE-SECRET-KEY-...' vaultik restore /tmp/restored + +# daily cron job: back up, keep a 4-week rolling window of snapshots # 0 3 * * * vaultik snapshot create --cron --prune --keep-newer-than 4w ``` @@ -120,22 +122,22 @@ vaultik version ### command details -**config init**: Write a default config file with commented explanations for +**`config init`**: Write a default config file with commented explanations for every setting. Writes to the path from `--config`, `$VAULTIK_CONFIG`, or the platform config directory (`~/Library/Application Support/vaultik/` on macOS, `~/.config/vaultik/` on Linux, `/etc/vaultik/` as root). Refuses to overwrite an existing file. Created with mode `0600` since it will contain credentials. -**config edit**: Open the config file in `$EDITOR` (falls back to `vi`). +**`config edit`**: Open the config file in `$EDITOR` (falls back to `vi`). -**config get**: Print a config value addressed by dotted YAML path +**`config get`**: Print a config value addressed by dotted YAML path (e.g. `vaultik config get s3.bucket`). Non-scalar values print as YAML. -**config set**: Set a scalar config value by dotted YAML path +**`config set`**: Set a scalar config value by dotted YAML path (e.g. `vaultik config set compression_level 9`). Comments and formatting in the file are preserved; intermediate maps are created as needed. -**snapshot create**: Perform incremental backup of configured snapshots. +**`snapshot create`**: Perform incremental backup of configured snapshots. * Optional snapshot names argument to create specific snapshots (default: all) * `--cron`: Silent unless error (for crontab) * `--prune`: After backup, drop older snapshots of each backed-up name and @@ -145,16 +147,16 @@ in the file are preserved; intermediate maps are created as needed. this duration instead of only the latest (e.g. `4w`, `30d`, `6mo`, `1y`) * `--skip-errors`: Skip file read errors (log them loudly but continue) -**snapshot list**: List all snapshots with their timestamps and sizes. +**`snapshot list`**: List all snapshots with their timestamps and sizes. * `--json`: Output in JSON format -**snapshot verify**: Verify snapshot integrity. +**`snapshot verify`**: Verify snapshot integrity. * Default (shallow): checks that all blobs referenced in the manifest exist in storage * `--deep`: Downloads and decrypts each blob, verifies chunk hashes against the encrypted metadata database * `--json`: Output results as JSON -**snapshot purge**: Remove old snapshots based on criteria. Retention is +**`snapshot purge`**: Remove old snapshots based on criteria. Retention is per-snapshot-name (`--keep-latest` keeps the latest of each name, not the latest globally). * `--keep-latest`: Keep only the most recent snapshot of each name @@ -162,42 +164,42 @@ latest globally). * `--snapshot `: Restrict to specific snapshot names (repeat for multiple) * `--force`: Skip confirmation prompt -**snapshot remove**: Remove a specific snapshot from the local database. +**`snapshot remove`**: Remove a specific snapshot from the local database. * `--remote`: Also remove snapshot metadata from remote storage * `--all`: Remove all snapshots (requires `--force`) * `--dry-run`: Show what would be deleted without deleting * `--force`: Skip confirmation prompt * `--json`: Output result as JSON -**snapshot prune**: Clean orphaned data from the local database (files, +**`snapshot prune`**: Clean orphaned data from the local database (files, chunks, blobs not referenced by any snapshot). -**snapshot cleanup**: Remove stale local snapshot records that have no +**`snapshot cleanup`**: Remove stale local snapshot records that have no corresponding metadata in remote storage. These are typically left behind by incomplete or interrupted backups. Does not touch remote storage. -**restore**: Restore files from a backup snapshot. +**`restore`**: Restore files from a backup snapshot. * Requires `VAULTIK_AGE_SECRET_KEY` environment variable * Optional path arguments to restore specific files/directories (default: all) * Preserves file permissions, timestamps, ownership (ownership requires root), symlinks, and empty directories * `--verify`: After restoring, verify every file's chunk hashes match -**prune**: Remove unreferenced blobs from remote storage. +**`prune`**: Remove unreferenced blobs from remote storage. * Scans all snapshot manifests for referenced blobs, deletes any blob not referenced * `--force`: Skip confirmation prompt * `--json`: Output stats as JSON -**info**: Display system configuration, storage settings, encryption +**`info`**: Display system configuration, storage settings, encryption recipients, and local database statistics. -**remote info**: Show detailed remote storage information including per-snapshot +**`remote info`**: Show detailed remote storage information including per-snapshot metadata sizes, blob counts, and orphaned blob detection. * `--json`: Output as JSON -**store info**: Display storage backend type and statistics. +**`store info`**: Display storage backend type and statistics. -**database purge**: Delete the local SQLite state database entirely. Remote +**`database purge`**: Delete the local SQLite state database entirely. Remote storage is unaffected; the next backup will do a full scan and re-deduplicate against existing remote blobs. * `--force`: Skip confirmation prompt @@ -300,7 +302,8 @@ Snapshot IDs follow the format `__` ## configuration reference -See `config.example.yml` for a complete annotated example. Key fields: +Run `vaultik config init` to generate a fully commented config file. +Key fields: | Field | Default | Description | |-------|---------|-------------| @@ -313,7 +316,7 @@ See `config.example.yml` for a complete annotated example. Key fields: | `blob_size_limit` | `10GB` | Maximum blob size before splitting | | `compression_level` | `3` | zstd compression level (1-19) | | `hostname` | system hostname | Hostname used in snapshot IDs | -| `index_path` | `~/.local/share/.../index.sqlite` | Local SQLite index path | +| `index_path` | platform data dir | Local SQLite index path | --- diff --git a/cmd/vaultik/main.go b/cmd/vaultik/main.go index 90f1412..70e7c19 100644 --- a/cmd/vaultik/main.go +++ b/cmd/vaultik/main.go @@ -5,7 +5,7 @@ import ( "runtime" "runtime/pprof" - "git.eeqj.de/sneak/vaultik/internal/cli" + "sneak.berlin/go/vaultik/internal/cli" ) func main() { diff --git a/go.mod b/go.mod index f558044..959f1db 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module git.eeqj.de/sneak/vaultik +module sneak.berlin/go/vaultik go 1.26.1 diff --git a/internal/blob/packer.go b/internal/blob/packer.go index 7edf15b..116c365 100644 --- a/internal/blob/packer.go +++ b/internal/blob/packer.go @@ -23,12 +23,12 @@ import ( "sync" "time" - "git.eeqj.de/sneak/vaultik/internal/blobgen" - "git.eeqj.de/sneak/vaultik/internal/database" - "git.eeqj.de/sneak/vaultik/internal/log" - "git.eeqj.de/sneak/vaultik/internal/types" "github.com/google/uuid" "github.com/spf13/afero" + "sneak.berlin/go/vaultik/internal/blobgen" + "sneak.berlin/go/vaultik/internal/database" + "sneak.berlin/go/vaultik/internal/log" + "sneak.berlin/go/vaultik/internal/types" ) // BlobHandler is a callback function invoked when a blob is finalized and ready for upload. diff --git a/internal/blob/packer_test.go b/internal/blob/packer_test.go index ed32c2b..dba194b 100644 --- a/internal/blob/packer_test.go +++ b/internal/blob/packer_test.go @@ -10,11 +10,11 @@ import ( "testing" "filippo.io/age" - "git.eeqj.de/sneak/vaultik/internal/database" - "git.eeqj.de/sneak/vaultik/internal/log" - "git.eeqj.de/sneak/vaultik/internal/types" "github.com/klauspost/compress/zstd" "github.com/spf13/afero" + "sneak.berlin/go/vaultik/internal/database" + "sneak.berlin/go/vaultik/internal/log" + "sneak.berlin/go/vaultik/internal/types" ) const ( diff --git a/internal/cli/app.go b/internal/cli/app.go index 54cd838..a595f6f 100644 --- a/internal/cli/app.go +++ b/internal/cli/app.go @@ -10,16 +10,16 @@ import ( "syscall" "time" - "git.eeqj.de/sneak/vaultik/internal/config" - "git.eeqj.de/sneak/vaultik/internal/database" - "git.eeqj.de/sneak/vaultik/internal/globals" - "git.eeqj.de/sneak/vaultik/internal/log" - "git.eeqj.de/sneak/vaultik/internal/pidlock" - "git.eeqj.de/sneak/vaultik/internal/snapshot" - "git.eeqj.de/sneak/vaultik/internal/storage" - "git.eeqj.de/sneak/vaultik/internal/vaultik" "github.com/adrg/xdg" "go.uber.org/fx" + "sneak.berlin/go/vaultik/internal/config" + "sneak.berlin/go/vaultik/internal/database" + "sneak.berlin/go/vaultik/internal/globals" + "sneak.berlin/go/vaultik/internal/log" + "sneak.berlin/go/vaultik/internal/pidlock" + "sneak.berlin/go/vaultik/internal/snapshot" + "sneak.berlin/go/vaultik/internal/storage" + "sneak.berlin/go/vaultik/internal/vaultik" ) // AppOptions contains common options for creating the fx application. @@ -125,7 +125,7 @@ func RunApp(ctx context.Context, app *fx.App) error { // It acquires a PID lock before starting to prevent concurrent instances. func RunWithApp(ctx context.Context, opts AppOptions) error { // Acquire PID lock to prevent concurrent instances - lockDir := filepath.Join(xdg.DataHome, "berlin.sneak.app.vaultik") + lockDir := filepath.Join(xdg.DataHome, "vaultik") lock, err := pidlock.Acquire(lockDir) if err != nil { if errors.Is(err, pidlock.ErrAlreadyRunning) { diff --git a/internal/cli/config.go b/internal/cli/config.go index b284dde..e9af774 100644 --- a/internal/cli/config.go +++ b/internal/cli/config.go @@ -5,6 +5,7 @@ import ( "os" "os/exec" "path/filepath" + "strconv" "strings" "github.com/spf13/cobra" @@ -12,7 +13,7 @@ import ( ) const defaultConfigTemplate = `# vaultik configuration -# Documentation: https://git.eeqj.de/sneak/vaultik +# Documentation: https://sneak.berlin/go/vaultik # ─── REQUIRED ──────────────────────────────────────────────────────────────── @@ -195,7 +196,9 @@ storage_url: "" # hostname: myserver # Path to the local SQLite index database. -# Default: ~/.local/share/berlin.sneak.app.vaultik/index.sqlite +# Default: the platform data directory, e.g. +# macOS: ~/Library/Application Support/vaultik/index.sqlite +# Linux: ~/.local/share/vaultik/index.sqlite # index_path: /path/to/index.sqlite ` @@ -387,8 +390,9 @@ func loadYAMLFile(path string) (*yaml.Node, error) { return &root, nil } -// yamlPathGet navigates a dotted key path through mapping nodes and -// returns the value node. +// yamlPathGet navigates a dotted key path through mapping and sequence +// nodes and returns the value node. Numeric path components index into +// sequences (e.g. "age_recipients.0"). func yamlPathGet(root *yaml.Node, keys []string) (*yaml.Node, error) { node := root if node.Kind == yaml.DocumentNode { @@ -399,19 +403,30 @@ func yamlPathGet(root *yaml.Node, keys []string) (*yaml.Node, error) { } for i, key := range keys { - if node.Kind != yaml.MappingNode { - return nil, fmt.Errorf("key %q is not a map", strings.Join(keys[:i], ".")) - } - found := false - for j := 0; j+1 < len(node.Content); j += 2 { - if node.Content[j].Value == key { - node = node.Content[j+1] - found = true - break + switch node.Kind { + case yaml.MappingNode: + found := false + for j := 0; j+1 < len(node.Content); j += 2 { + if node.Content[j].Value == key { + node = node.Content[j+1] + found = true + break + } } - } - if !found { - return nil, fmt.Errorf("key not found: %s", strings.Join(keys[:i+1], ".")) + if !found { + return nil, fmt.Errorf("key not found: %s", strings.Join(keys[:i+1], ".")) + } + case yaml.SequenceNode: + idx, err := strconv.Atoi(key) + if err != nil { + return nil, fmt.Errorf("key %q is a list; use a numeric index", strings.Join(keys[:i], ".")) + } + if idx < 0 || idx >= len(node.Content) { + return nil, fmt.Errorf("index %d out of range for %s (len %d)", idx, strings.Join(keys[:i], "."), len(node.Content)) + } + node = node.Content[idx] + default: + return nil, fmt.Errorf("key %q is not a map or list", strings.Join(keys[:i], ".")) } } @@ -419,7 +434,9 @@ func yamlPathGet(root *yaml.Node, keys []string) (*yaml.Node, error) { } // yamlPathSet navigates a dotted key path, creating intermediate maps as -// needed, and sets the final key to the given scalar value. +// needed, and sets the final key to the given scalar value. Numeric path +// components index into sequences; an index equal to the sequence length +// appends a new element (e.g. "age_recipients.1" on a 1-element list). func yamlPathSet(root *yaml.Node, keys []string, value string) error { node := root if node.Kind == yaml.DocumentNode { @@ -430,41 +447,67 @@ func yamlPathSet(root *yaml.Node, keys []string, value string) error { } for i, key := range keys { - if node.Kind != yaml.MappingNode { - return fmt.Errorf("key %q is not a map", strings.Join(keys[:i], ".")) - } - last := i == len(keys)-1 - var valueNode *yaml.Node - for j := 0; j+1 < len(node.Content); j += 2 { - if node.Content[j].Value == key { - valueNode = node.Content[j+1] - break + switch node.Kind { + case yaml.MappingNode: + var valueNode *yaml.Node + for j := 0; j+1 < len(node.Content); j += 2 { + if node.Content[j].Value == key { + valueNode = node.Content[j+1] + break + } } - } - if valueNode == nil { - keyNode := &yaml.Node{Kind: yaml.ScalarNode, Value: key} - valueNode = &yaml.Node{Kind: yaml.MappingNode} - if last { - valueNode = &yaml.Node{Kind: yaml.ScalarNode, Value: value} + if valueNode == nil { + keyNode := &yaml.Node{Kind: yaml.ScalarNode, Value: key} + valueNode = &yaml.Node{Kind: yaml.MappingNode} + if last { + valueNode = &yaml.Node{Kind: yaml.ScalarNode, Value: value} + } + node.Content = append(node.Content, keyNode, valueNode) + } else if last { + setScalar(valueNode, value) } - node.Content = append(node.Content, keyNode, valueNode) - } else if last { - valueNode.Kind = yaml.ScalarNode - valueNode.Tag = "" - valueNode.Value = value - valueNode.Content = nil - valueNode.Style = 0 - } - node = valueNode + node = valueNode + + case yaml.SequenceNode: + idx, err := strconv.Atoi(key) + if err != nil { + return fmt.Errorf("key %q is a list; use a numeric index", strings.Join(keys[:i], ".")) + } + if idx < 0 || idx > len(node.Content) { + return fmt.Errorf("index %d out of range for %s (len %d)", idx, strings.Join(keys[:i], "."), len(node.Content)) + } + if idx == len(node.Content) { + newNode := &yaml.Node{Kind: yaml.MappingNode} + if last { + newNode = &yaml.Node{Kind: yaml.ScalarNode, Value: value} + } + node.Content = append(node.Content, newNode) + } else if last { + setScalar(node.Content[idx], value) + } + node = node.Content[idx] + + default: + return fmt.Errorf("key %q is not a map or list", strings.Join(keys[:i], ".")) + } } return nil } +// setScalar overwrites a node in place with a plain scalar value. +func setScalar(n *yaml.Node, value string) { + n.Kind = yaml.ScalarNode + n.Tag = "" + n.Value = value + n.Content = nil + n.Style = 0 +} + // configPathForInit returns the config path to write, checking --config flag, // VAULTIK_CONFIG env, and the platform default. func configPathForInit() string { diff --git a/internal/cli/config_test.go b/internal/cli/config_test.go index 223345c..cf45f04 100644 --- a/internal/cli/config_test.go +++ b/internal/cli/config_test.go @@ -4,8 +4,8 @@ import ( "strings" "testing" - "git.eeqj.de/sneak/vaultik/internal/config" "gopkg.in/yaml.v3" + "sneak.berlin/go/vaultik/internal/config" ) // TestDefaultConfigTemplateParses ensures the init template is valid YAML @@ -45,6 +45,8 @@ func TestDefaultConfigTemplateParses(t *testing.T) { const testYAML = `# top comment compression_level: 3 +age_recipients: + - age1aaa s3: bucket: oldbucket # inline comment region: us-east-1 @@ -74,6 +76,9 @@ func TestYAMLPathGet(t *testing.T) { {"compression_level", "3", false}, {"s3.bucket", "oldbucket", false}, {"s3.region", "us-east-1", false}, + {"age_recipients.0", "age1aaa", false}, + {"age_recipients.5", "", true}, + {"age_recipients.notanumber", "", true}, {"s3.nonexistent", "", true}, {"nonexistent", "", true}, {"compression_level.sub", "", true}, @@ -114,6 +119,17 @@ func TestYAMLPathSet(t *testing.T) { t.Fatalf("set newmap.newkey: %v", err) } + // Overwrite a sequence element and append a new one + if err := yamlPathSet(root, splitPath("age_recipients.0"), "age1bbb"); err != nil { + t.Fatalf("set age_recipients.0: %v", err) + } + if err := yamlPathSet(root, splitPath("age_recipients.1"), "age1ccc"); err != nil { + t.Fatalf("append age_recipients.1: %v", err) + } + if err := yamlPathSet(root, splitPath("age_recipients.5"), "age1ddd"); err == nil { + t.Error("expected out-of-range append to fail") + } + // Round-trip and verify values + comment preservation out, err := yaml.Marshal(root) if err != nil { @@ -121,7 +137,7 @@ func TestYAMLPathSet(t *testing.T) { } text := string(out) - for _, want := range []string{"newbucket", "s3.example.com", "newkey: val", "# top comment", "# inline comment"} { + for _, want := range []string{"newbucket", "s3.example.com", "newkey: val", "# top comment", "# inline comment", "age1bbb", "age1ccc"} { if !contains(text, want) { t.Errorf("round-tripped YAML missing %q:\n%s", want, text) } diff --git a/internal/cli/database.go b/internal/cli/database.go index 615cf30..cc2c1a0 100644 --- a/internal/cli/database.go +++ b/internal/cli/database.go @@ -4,9 +4,9 @@ import ( "fmt" "os" - "git.eeqj.de/sneak/vaultik/internal/config" - "git.eeqj.de/sneak/vaultik/internal/log" "github.com/spf13/cobra" + "sneak.berlin/go/vaultik/internal/config" + "sneak.berlin/go/vaultik/internal/log" ) // NewDatabaseCommand creates the database command group diff --git a/internal/cli/info.go b/internal/cli/info.go index be3b37d..9bc8914 100644 --- a/internal/cli/info.go +++ b/internal/cli/info.go @@ -4,10 +4,10 @@ import ( "context" "os" - "git.eeqj.de/sneak/vaultik/internal/log" - "git.eeqj.de/sneak/vaultik/internal/vaultik" "github.com/spf13/cobra" "go.uber.org/fx" + "sneak.berlin/go/vaultik/internal/log" + "sneak.berlin/go/vaultik/internal/vaultik" ) // NewInfoCommand creates the info command diff --git a/internal/cli/prune.go b/internal/cli/prune.go index f197acd..35e6c62 100644 --- a/internal/cli/prune.go +++ b/internal/cli/prune.go @@ -4,10 +4,10 @@ import ( "context" "os" - "git.eeqj.de/sneak/vaultik/internal/log" - "git.eeqj.de/sneak/vaultik/internal/vaultik" "github.com/spf13/cobra" "go.uber.org/fx" + "sneak.berlin/go/vaultik/internal/log" + "sneak.berlin/go/vaultik/internal/vaultik" ) // NewPruneCommand creates the prune command diff --git a/internal/cli/remote.go b/internal/cli/remote.go index 40c3763..9e58c90 100644 --- a/internal/cli/remote.go +++ b/internal/cli/remote.go @@ -4,10 +4,10 @@ import ( "context" "os" - "git.eeqj.de/sneak/vaultik/internal/log" - "git.eeqj.de/sneak/vaultik/internal/vaultik" "github.com/spf13/cobra" "go.uber.org/fx" + "sneak.berlin/go/vaultik/internal/log" + "sneak.berlin/go/vaultik/internal/vaultik" ) // NewRemoteCommand creates the remote command and subcommands diff --git a/internal/cli/restore.go b/internal/cli/restore.go index 9e0b3f1..4b3012a 100644 --- a/internal/cli/restore.go +++ b/internal/cli/restore.go @@ -4,13 +4,13 @@ import ( "context" "os" - "git.eeqj.de/sneak/vaultik/internal/config" - "git.eeqj.de/sneak/vaultik/internal/globals" - "git.eeqj.de/sneak/vaultik/internal/log" - "git.eeqj.de/sneak/vaultik/internal/storage" - "git.eeqj.de/sneak/vaultik/internal/vaultik" "github.com/spf13/cobra" "go.uber.org/fx" + "sneak.berlin/go/vaultik/internal/config" + "sneak.berlin/go/vaultik/internal/globals" + "sneak.berlin/go/vaultik/internal/log" + "sneak.berlin/go/vaultik/internal/storage" + "sneak.berlin/go/vaultik/internal/vaultik" ) // RestoreOptions contains options for the restore command diff --git a/internal/cli/snapshot.go b/internal/cli/snapshot.go index f9592b1..78f12f3 100644 --- a/internal/cli/snapshot.go +++ b/internal/cli/snapshot.go @@ -6,10 +6,10 @@ import ( "io" "os" - "git.eeqj.de/sneak/vaultik/internal/log" - "git.eeqj.de/sneak/vaultik/internal/vaultik" "github.com/spf13/cobra" "go.uber.org/fx" + "sneak.berlin/go/vaultik/internal/log" + "sneak.berlin/go/vaultik/internal/vaultik" ) // NewSnapshotCommand creates the snapshot command and subcommands diff --git a/internal/cli/store.go b/internal/cli/store.go index 35da17b..9c5c7a5 100644 --- a/internal/cli/store.go +++ b/internal/cli/store.go @@ -6,10 +6,10 @@ import ( "strings" "time" - "git.eeqj.de/sneak/vaultik/internal/log" - "git.eeqj.de/sneak/vaultik/internal/storage" "github.com/spf13/cobra" "go.uber.org/fx" + "sneak.berlin/go/vaultik/internal/log" + "sneak.berlin/go/vaultik/internal/storage" ) // StoreApp contains dependencies for store commands diff --git a/internal/cli/version.go b/internal/cli/version.go index 75818f4..602cfac 100644 --- a/internal/cli/version.go +++ b/internal/cli/version.go @@ -4,8 +4,8 @@ import ( "fmt" "runtime" - "git.eeqj.de/sneak/vaultik/internal/globals" "github.com/spf13/cobra" + "sneak.berlin/go/vaultik/internal/globals" ) // NewVersionCommand creates the version command diff --git a/internal/config/config.go b/internal/config/config.go index 72cd666..a47f347 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -9,13 +9,13 @@ import ( "filippo.io/age" "git.eeqj.de/sneak/smartconfig" - "git.eeqj.de/sneak/vaultik/internal/log" "github.com/adrg/xdg" "go.uber.org/fx" "gopkg.in/yaml.v3" + "sneak.berlin/go/vaultik/internal/log" ) -const appName = "berlin.sneak.app.vaultik" +const appName = "vaultik" // expandTilde expands ~ at the start of a path to the user's home directory. func expandTilde(path string) string { diff --git a/internal/database/blob_chunks_test.go b/internal/database/blob_chunks_test.go index 070fd8c..9dae601 100644 --- a/internal/database/blob_chunks_test.go +++ b/internal/database/blob_chunks_test.go @@ -6,7 +6,7 @@ import ( "testing" "time" - "git.eeqj.de/sneak/vaultik/internal/types" + "sneak.berlin/go/vaultik/internal/types" ) func TestBlobChunkRepository(t *testing.T) { diff --git a/internal/database/blobs.go b/internal/database/blobs.go index c528d09..44072c6 100644 --- a/internal/database/blobs.go +++ b/internal/database/blobs.go @@ -6,7 +6,7 @@ import ( "fmt" "time" - "git.eeqj.de/sneak/vaultik/internal/log" + "sneak.berlin/go/vaultik/internal/log" ) type BlobRepository struct { diff --git a/internal/database/blobs_test.go b/internal/database/blobs_test.go index d8be6b5..3d06c5d 100644 --- a/internal/database/blobs_test.go +++ b/internal/database/blobs_test.go @@ -5,7 +5,7 @@ import ( "testing" "time" - "git.eeqj.de/sneak/vaultik/internal/types" + "sneak.berlin/go/vaultik/internal/types" ) func TestBlobRepository(t *testing.T) { diff --git a/internal/database/cascade_debug_test.go b/internal/database/cascade_debug_test.go index ed24746..6ef933f 100644 --- a/internal/database/cascade_debug_test.go +++ b/internal/database/cascade_debug_test.go @@ -6,7 +6,7 @@ import ( "testing" "time" - "git.eeqj.de/sneak/vaultik/internal/types" + "sneak.berlin/go/vaultik/internal/types" ) // TestCascadeDeleteDebug tests cascade delete with debug output diff --git a/internal/database/chunk_files.go b/internal/database/chunk_files.go index e78c363..0e5f0df 100644 --- a/internal/database/chunk_files.go +++ b/internal/database/chunk_files.go @@ -5,7 +5,7 @@ import ( "database/sql" "fmt" - "git.eeqj.de/sneak/vaultik/internal/types" + "sneak.berlin/go/vaultik/internal/types" ) type ChunkFileRepository struct { diff --git a/internal/database/chunk_files_test.go b/internal/database/chunk_files_test.go index 9c772c4..a4e8bbc 100644 --- a/internal/database/chunk_files_test.go +++ b/internal/database/chunk_files_test.go @@ -5,7 +5,7 @@ import ( "testing" "time" - "git.eeqj.de/sneak/vaultik/internal/types" + "sneak.berlin/go/vaultik/internal/types" ) func TestChunkFileRepository(t *testing.T) { diff --git a/internal/database/chunks.go b/internal/database/chunks.go index 0a4f508..04fc4ef 100644 --- a/internal/database/chunks.go +++ b/internal/database/chunks.go @@ -5,7 +5,7 @@ import ( "database/sql" "fmt" - "git.eeqj.de/sneak/vaultik/internal/log" + "sneak.berlin/go/vaultik/internal/log" ) type ChunkRepository struct { diff --git a/internal/database/chunks_test.go b/internal/database/chunks_test.go index 7571804..5122bb1 100644 --- a/internal/database/chunks_test.go +++ b/internal/database/chunks_test.go @@ -4,7 +4,7 @@ import ( "context" "testing" - "git.eeqj.de/sneak/vaultik/internal/types" + "sneak.berlin/go/vaultik/internal/types" ) func TestChunkRepository(t *testing.T) { diff --git a/internal/database/database.go b/internal/database/database.go index 0cc7c4e..5f0f14c 100644 --- a/internal/database/database.go +++ b/internal/database/database.go @@ -22,8 +22,8 @@ import ( "strconv" "strings" - "git.eeqj.de/sneak/vaultik/internal/log" _ "modernc.org/sqlite" + "sneak.berlin/go/vaultik/internal/log" ) //go:embed schema/*.sql diff --git a/internal/database/file_chunks.go b/internal/database/file_chunks.go index d3514f5..31fa142 100644 --- a/internal/database/file_chunks.go +++ b/internal/database/file_chunks.go @@ -5,7 +5,7 @@ import ( "database/sql" "fmt" - "git.eeqj.de/sneak/vaultik/internal/types" + "sneak.berlin/go/vaultik/internal/types" ) type FileChunkRepository struct { diff --git a/internal/database/file_chunks_test.go b/internal/database/file_chunks_test.go index c009e97..ebd2e01 100644 --- a/internal/database/file_chunks_test.go +++ b/internal/database/file_chunks_test.go @@ -6,7 +6,7 @@ import ( "testing" "time" - "git.eeqj.de/sneak/vaultik/internal/types" + "sneak.berlin/go/vaultik/internal/types" ) func TestFileChunkRepository(t *testing.T) { diff --git a/internal/database/files.go b/internal/database/files.go index 21c0a0b..bf81e18 100644 --- a/internal/database/files.go +++ b/internal/database/files.go @@ -6,8 +6,8 @@ import ( "fmt" "time" - "git.eeqj.de/sneak/vaultik/internal/log" - "git.eeqj.de/sneak/vaultik/internal/types" + "sneak.berlin/go/vaultik/internal/log" + "sneak.berlin/go/vaultik/internal/types" ) type FileRepository struct { diff --git a/internal/database/models.go b/internal/database/models.go index 14bc580..f95831b 100644 --- a/internal/database/models.go +++ b/internal/database/models.go @@ -5,7 +5,7 @@ package database import ( "time" - "git.eeqj.de/sneak/vaultik/internal/types" + "sneak.berlin/go/vaultik/internal/types" ) // File represents a file or directory in the backup system. diff --git a/internal/database/module.go b/internal/database/module.go index dcf4559..98a5b74 100644 --- a/internal/database/module.go +++ b/internal/database/module.go @@ -6,9 +6,9 @@ import ( "os" "path/filepath" - "git.eeqj.de/sneak/vaultik/internal/config" - "git.eeqj.de/sneak/vaultik/internal/log" "go.uber.org/fx" + "sneak.berlin/go/vaultik/internal/config" + "sneak.berlin/go/vaultik/internal/log" ) // Module provides database dependencies diff --git a/internal/database/repositories_test.go b/internal/database/repositories_test.go index 439f325..6324824 100644 --- a/internal/database/repositories_test.go +++ b/internal/database/repositories_test.go @@ -7,7 +7,7 @@ import ( "testing" "time" - "git.eeqj.de/sneak/vaultik/internal/types" + "sneak.berlin/go/vaultik/internal/types" ) func TestRepositoriesTransaction(t *testing.T) { diff --git a/internal/database/repository_comprehensive_test.go b/internal/database/repository_comprehensive_test.go index 3bc25a6..384f80a 100644 --- a/internal/database/repository_comprehensive_test.go +++ b/internal/database/repository_comprehensive_test.go @@ -7,7 +7,7 @@ import ( "testing" "time" - "git.eeqj.de/sneak/vaultik/internal/types" + "sneak.berlin/go/vaultik/internal/types" ) // TestFileRepositoryUUIDGeneration tests that files get unique UUIDs diff --git a/internal/database/repository_edge_cases_test.go b/internal/database/repository_edge_cases_test.go index 4f9bb2b..b4ba6ba 100644 --- a/internal/database/repository_edge_cases_test.go +++ b/internal/database/repository_edge_cases_test.go @@ -7,7 +7,7 @@ import ( "testing" "time" - "git.eeqj.de/sneak/vaultik/internal/types" + "sneak.berlin/go/vaultik/internal/types" ) // TestFileRepositoryEdgeCases tests edge cases for file repository diff --git a/internal/database/snapshots.go b/internal/database/snapshots.go index 6cfe1bd..f3c6526 100644 --- a/internal/database/snapshots.go +++ b/internal/database/snapshots.go @@ -6,7 +6,7 @@ import ( "fmt" "time" - "git.eeqj.de/sneak/vaultik/internal/types" + "sneak.berlin/go/vaultik/internal/types" ) type SnapshotRepository struct { diff --git a/internal/database/snapshots_test.go b/internal/database/snapshots_test.go index 1ee7186..c856163 100644 --- a/internal/database/snapshots_test.go +++ b/internal/database/snapshots_test.go @@ -7,7 +7,7 @@ import ( "testing" "time" - "git.eeqj.de/sneak/vaultik/internal/types" + "sneak.berlin/go/vaultik/internal/types" ) const ( diff --git a/internal/database/uploads.go b/internal/database/uploads.go index b3db507..c1a3c09 100644 --- a/internal/database/uploads.go +++ b/internal/database/uploads.go @@ -5,7 +5,7 @@ import ( "database/sql" "time" - "git.eeqj.de/sneak/vaultik/internal/log" + "sneak.berlin/go/vaultik/internal/log" ) // Upload represents a blob upload record diff --git a/internal/s3/client_test.go b/internal/s3/client_test.go index db86b74..1bb267e 100644 --- a/internal/s3/client_test.go +++ b/internal/s3/client_test.go @@ -6,7 +6,7 @@ import ( "io" "testing" - "git.eeqj.de/sneak/vaultik/internal/s3" + "sneak.berlin/go/vaultik/internal/s3" ) func TestClient(t *testing.T) { diff --git a/internal/s3/module.go b/internal/s3/module.go index 61b554f..8839ec7 100644 --- a/internal/s3/module.go +++ b/internal/s3/module.go @@ -3,8 +3,8 @@ package s3 import ( "context" - "git.eeqj.de/sneak/vaultik/internal/config" "go.uber.org/fx" + "sneak.berlin/go/vaultik/internal/config" ) // Module exports S3 functionality as an fx module. diff --git a/internal/snapshot/backup_test.go b/internal/snapshot/backup_test.go index 05bd30c..fa6b9b4 100644 --- a/internal/snapshot/backup_test.go +++ b/internal/snapshot/backup_test.go @@ -13,8 +13,8 @@ import ( "testing/fstest" "time" - "git.eeqj.de/sneak/vaultik/internal/database" - "git.eeqj.de/sneak/vaultik/internal/types" + "sneak.berlin/go/vaultik/internal/database" + "sneak.berlin/go/vaultik/internal/types" ) // MockS3Client is a mock implementation of S3 operations for testing diff --git a/internal/snapshot/exclude_test.go b/internal/snapshot/exclude_test.go index d872ec0..ba2efef 100644 --- a/internal/snapshot/exclude_test.go +++ b/internal/snapshot/exclude_test.go @@ -7,12 +7,12 @@ import ( "testing" "time" - "git.eeqj.de/sneak/vaultik/internal/database" - "git.eeqj.de/sneak/vaultik/internal/log" - "git.eeqj.de/sneak/vaultik/internal/snapshot" - "git.eeqj.de/sneak/vaultik/internal/types" "github.com/spf13/afero" "github.com/stretchr/testify/require" + "sneak.berlin/go/vaultik/internal/database" + "sneak.berlin/go/vaultik/internal/log" + "sneak.berlin/go/vaultik/internal/snapshot" + "sneak.berlin/go/vaultik/internal/types" ) func setupExcludeTestFS(t *testing.T) afero.Fs { diff --git a/internal/snapshot/file_change_test.go b/internal/snapshot/file_change_test.go index f3b695c..033934b 100644 --- a/internal/snapshot/file_change_test.go +++ b/internal/snapshot/file_change_test.go @@ -6,13 +6,13 @@ import ( "testing" "time" - "git.eeqj.de/sneak/vaultik/internal/database" - "git.eeqj.de/sneak/vaultik/internal/log" - "git.eeqj.de/sneak/vaultik/internal/snapshot" - "git.eeqj.de/sneak/vaultik/internal/types" "github.com/spf13/afero" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "sneak.berlin/go/vaultik/internal/database" + "sneak.berlin/go/vaultik/internal/log" + "sneak.berlin/go/vaultik/internal/snapshot" + "sneak.berlin/go/vaultik/internal/types" ) // TestFileContentChange verifies that when a file's content changes, diff --git a/internal/snapshot/module.go b/internal/snapshot/module.go index 7913eee..c542772 100644 --- a/internal/snapshot/module.go +++ b/internal/snapshot/module.go @@ -1,11 +1,11 @@ package snapshot import ( - "git.eeqj.de/sneak/vaultik/internal/config" - "git.eeqj.de/sneak/vaultik/internal/database" - "git.eeqj.de/sneak/vaultik/internal/storage" "github.com/spf13/afero" "go.uber.org/fx" + "sneak.berlin/go/vaultik/internal/config" + "sneak.berlin/go/vaultik/internal/database" + "sneak.berlin/go/vaultik/internal/storage" ) // ScannerParams holds parameters for scanner creation diff --git a/internal/snapshot/progress.go b/internal/snapshot/progress.go index 0c015a6..568efd2 100644 --- a/internal/snapshot/progress.go +++ b/internal/snapshot/progress.go @@ -10,8 +10,8 @@ import ( "syscall" "time" - "git.eeqj.de/sneak/vaultik/internal/log" "github.com/dustin/go-humanize" + "sneak.berlin/go/vaultik/internal/log" ) const ( diff --git a/internal/snapshot/scanner.go b/internal/snapshot/scanner.go index e935376..4102a43 100644 --- a/internal/snapshot/scanner.go +++ b/internal/snapshot/scanner.go @@ -12,15 +12,15 @@ import ( "sync" "time" - "git.eeqj.de/sneak/vaultik/internal/blob" - "git.eeqj.de/sneak/vaultik/internal/chunker" - "git.eeqj.de/sneak/vaultik/internal/database" - "git.eeqj.de/sneak/vaultik/internal/log" - "git.eeqj.de/sneak/vaultik/internal/storage" - "git.eeqj.de/sneak/vaultik/internal/types" "github.com/dustin/go-humanize" "github.com/gobwas/glob" "github.com/spf13/afero" + "sneak.berlin/go/vaultik/internal/blob" + "sneak.berlin/go/vaultik/internal/chunker" + "sneak.berlin/go/vaultik/internal/database" + "sneak.berlin/go/vaultik/internal/log" + "sneak.berlin/go/vaultik/internal/storage" + "sneak.berlin/go/vaultik/internal/types" ) // FileToProcess holds information about a file that needs processing diff --git a/internal/snapshot/scanner_test.go b/internal/snapshot/scanner_test.go index 5b03549..4ceaf84 100644 --- a/internal/snapshot/scanner_test.go +++ b/internal/snapshot/scanner_test.go @@ -7,11 +7,11 @@ import ( "testing" "time" - "git.eeqj.de/sneak/vaultik/internal/database" - "git.eeqj.de/sneak/vaultik/internal/log" - "git.eeqj.de/sneak/vaultik/internal/snapshot" - "git.eeqj.de/sneak/vaultik/internal/types" "github.com/spf13/afero" + "sneak.berlin/go/vaultik/internal/database" + "sneak.berlin/go/vaultik/internal/log" + "sneak.berlin/go/vaultik/internal/snapshot" + "sneak.berlin/go/vaultik/internal/types" ) func TestScannerSimpleDirectory(t *testing.T) { diff --git a/internal/snapshot/snapshot.go b/internal/snapshot/snapshot.go index 883c572..c745490 100644 --- a/internal/snapshot/snapshot.go +++ b/internal/snapshot/snapshot.go @@ -44,15 +44,15 @@ import ( "strings" "time" - "git.eeqj.de/sneak/vaultik/internal/blobgen" - "git.eeqj.de/sneak/vaultik/internal/config" - "git.eeqj.de/sneak/vaultik/internal/database" - "git.eeqj.de/sneak/vaultik/internal/log" - "git.eeqj.de/sneak/vaultik/internal/storage" - "git.eeqj.de/sneak/vaultik/internal/types" "github.com/dustin/go-humanize" "github.com/spf13/afero" "go.uber.org/fx" + "sneak.berlin/go/vaultik/internal/blobgen" + "sneak.berlin/go/vaultik/internal/config" + "sneak.berlin/go/vaultik/internal/database" + "sneak.berlin/go/vaultik/internal/log" + "sneak.berlin/go/vaultik/internal/storage" + "sneak.berlin/go/vaultik/internal/types" ) // SnapshotManager handles snapshot creation and metadata export diff --git a/internal/snapshot/snapshot_test.go b/internal/snapshot/snapshot_test.go index 2f40ba3..a47df4a 100644 --- a/internal/snapshot/snapshot_test.go +++ b/internal/snapshot/snapshot_test.go @@ -7,10 +7,10 @@ import ( "path/filepath" "testing" - "git.eeqj.de/sneak/vaultik/internal/config" - "git.eeqj.de/sneak/vaultik/internal/database" - "git.eeqj.de/sneak/vaultik/internal/log" "github.com/spf13/afero" + "sneak.berlin/go/vaultik/internal/config" + "sneak.berlin/go/vaultik/internal/database" + "sneak.berlin/go/vaultik/internal/log" ) const ( diff --git a/internal/storage/module.go b/internal/storage/module.go index 7842286..bf830d6 100644 --- a/internal/storage/module.go +++ b/internal/storage/module.go @@ -5,9 +5,9 @@ import ( "fmt" "strings" - "git.eeqj.de/sneak/vaultik/internal/config" - "git.eeqj.de/sneak/vaultik/internal/s3" "go.uber.org/fx" + "sneak.berlin/go/vaultik/internal/config" + "sneak.berlin/go/vaultik/internal/s3" ) // Module exports storage functionality as an fx module. diff --git a/internal/storage/s3.go b/internal/storage/s3.go index 9d648fa..534aed7 100644 --- a/internal/storage/s3.go +++ b/internal/storage/s3.go @@ -5,7 +5,7 @@ import ( "fmt" "io" - "git.eeqj.de/sneak/vaultik/internal/s3" + "sneak.berlin/go/vaultik/internal/s3" ) // S3Storer wraps the existing s3.Client to implement Storer. diff --git a/internal/vaultik/blob_fetch.go b/internal/vaultik/blob_fetch.go index b440492..f7310fa 100644 --- a/internal/vaultik/blob_fetch.go +++ b/internal/vaultik/blob_fetch.go @@ -8,7 +8,7 @@ import ( "io" "filippo.io/age" - "git.eeqj.de/sneak/vaultik/internal/blobgen" + "sneak.berlin/go/vaultik/internal/blobgen" ) // hashVerifyReader wraps a blobgen.Reader and verifies the double-SHA-256 hash diff --git a/internal/vaultik/blob_fetch_hash_test.go b/internal/vaultik/blob_fetch_hash_test.go index 192ec78..c8f6099 100644 --- a/internal/vaultik/blob_fetch_hash_test.go +++ b/internal/vaultik/blob_fetch_hash_test.go @@ -10,8 +10,8 @@ import ( "testing" "filippo.io/age" - "git.eeqj.de/sneak/vaultik/internal/blobgen" - "git.eeqj.de/sneak/vaultik/internal/vaultik" + "sneak.berlin/go/vaultik/internal/blobgen" + "sneak.berlin/go/vaultik/internal/vaultik" ) // TestFetchAndDecryptBlobVerifiesHash verifies that FetchAndDecryptBlob checks diff --git a/internal/vaultik/helpers.go b/internal/vaultik/helpers.go index 6ea2571..202939f 100644 --- a/internal/vaultik/helpers.go +++ b/internal/vaultik/helpers.go @@ -7,7 +7,7 @@ import ( "strings" "time" - "git.eeqj.de/sneak/vaultik/internal/types" + "sneak.berlin/go/vaultik/internal/types" ) // SnapshotInfo contains information about a snapshot diff --git a/internal/vaultik/info.go b/internal/vaultik/info.go index 2d1517b..00f8819 100644 --- a/internal/vaultik/info.go +++ b/internal/vaultik/info.go @@ -7,9 +7,9 @@ import ( "sort" "strings" - "git.eeqj.de/sneak/vaultik/internal/log" - "git.eeqj.de/sneak/vaultik/internal/snapshot" "github.com/dustin/go-humanize" + "sneak.berlin/go/vaultik/internal/log" + "sneak.berlin/go/vaultik/internal/snapshot" ) // ShowInfo displays system and configuration information diff --git a/internal/vaultik/integration_test.go b/internal/vaultik/integration_test.go index 86736ba..83a3315 100644 --- a/internal/vaultik/integration_test.go +++ b/internal/vaultik/integration_test.go @@ -11,16 +11,16 @@ import ( "testing" "time" - "git.eeqj.de/sneak/vaultik/internal/config" - "git.eeqj.de/sneak/vaultik/internal/database" - "git.eeqj.de/sneak/vaultik/internal/log" - "git.eeqj.de/sneak/vaultik/internal/snapshot" - "git.eeqj.de/sneak/vaultik/internal/storage" - "git.eeqj.de/sneak/vaultik/internal/types" - "git.eeqj.de/sneak/vaultik/internal/vaultik" "github.com/spf13/afero" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "sneak.berlin/go/vaultik/internal/config" + "sneak.berlin/go/vaultik/internal/database" + "sneak.berlin/go/vaultik/internal/log" + "sneak.berlin/go/vaultik/internal/snapshot" + "sneak.berlin/go/vaultik/internal/storage" + "sneak.berlin/go/vaultik/internal/types" + "sneak.berlin/go/vaultik/internal/vaultik" ) // MockStorer implements storage.Storer for testing diff --git a/internal/vaultik/prune.go b/internal/vaultik/prune.go index 2fb1a35..4bfbb8e 100644 --- a/internal/vaultik/prune.go +++ b/internal/vaultik/prune.go @@ -5,8 +5,8 @@ import ( "fmt" "strings" - "git.eeqj.de/sneak/vaultik/internal/log" "github.com/dustin/go-humanize" + "sneak.berlin/go/vaultik/internal/log" ) // PruneOptions contains options for the prune command diff --git a/internal/vaultik/purge_per_name_test.go b/internal/vaultik/purge_per_name_test.go index e76c0bc..ff86be3 100644 --- a/internal/vaultik/purge_per_name_test.go +++ b/internal/vaultik/purge_per_name_test.go @@ -8,12 +8,12 @@ import ( "testing" "time" - "git.eeqj.de/sneak/vaultik/internal/database" - "git.eeqj.de/sneak/vaultik/internal/log" - "git.eeqj.de/sneak/vaultik/internal/types" - "git.eeqj.de/sneak/vaultik/internal/vaultik" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "sneak.berlin/go/vaultik/internal/database" + "sneak.berlin/go/vaultik/internal/log" + "sneak.berlin/go/vaultik/internal/types" + "sneak.berlin/go/vaultik/internal/vaultik" ) // setupPurgeTest creates a Vaultik instance with an in-memory database and mock diff --git a/internal/vaultik/remove_snapshot_test.go b/internal/vaultik/remove_snapshot_test.go index 33c4d07..6db8d66 100644 --- a/internal/vaultik/remove_snapshot_test.go +++ b/internal/vaultik/remove_snapshot_test.go @@ -8,13 +8,13 @@ import ( "sync" "testing" - "git.eeqj.de/sneak/vaultik/internal/log" - "git.eeqj.de/sneak/vaultik/internal/snapshot" - "git.eeqj.de/sneak/vaultik/internal/storage" - "git.eeqj.de/sneak/vaultik/internal/vaultik" "github.com/klauspost/compress/zstd" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "sneak.berlin/go/vaultik/internal/log" + "sneak.berlin/go/vaultik/internal/snapshot" + "sneak.berlin/go/vaultik/internal/storage" + "sneak.berlin/go/vaultik/internal/vaultik" ) // testStorer implements storage.Storer for testing diff --git a/internal/vaultik/restore.go b/internal/vaultik/restore.go index 5797fc8..272b1fe 100644 --- a/internal/vaultik/restore.go +++ b/internal/vaultik/restore.go @@ -12,14 +12,14 @@ import ( "time" "filippo.io/age" - "git.eeqj.de/sneak/vaultik/internal/blobgen" - "git.eeqj.de/sneak/vaultik/internal/database" - "git.eeqj.de/sneak/vaultik/internal/log" - "git.eeqj.de/sneak/vaultik/internal/types" "github.com/dustin/go-humanize" "github.com/schollz/progressbar/v3" "github.com/spf13/afero" "golang.org/x/term" + "sneak.berlin/go/vaultik/internal/blobgen" + "sneak.berlin/go/vaultik/internal/database" + "sneak.berlin/go/vaultik/internal/log" + "sneak.berlin/go/vaultik/internal/types" ) const ( diff --git a/internal/vaultik/snapshot.go b/internal/vaultik/snapshot.go index c0f1612..22cba97 100644 --- a/internal/vaultik/snapshot.go +++ b/internal/vaultik/snapshot.go @@ -12,12 +12,12 @@ import ( "text/tabwriter" "time" - "git.eeqj.de/sneak/vaultik/internal/database" - "git.eeqj.de/sneak/vaultik/internal/log" - "git.eeqj.de/sneak/vaultik/internal/snapshot" - "git.eeqj.de/sneak/vaultik/internal/types" "github.com/dustin/go-humanize" "golang.org/x/sync/errgroup" + "sneak.berlin/go/vaultik/internal/database" + "sneak.berlin/go/vaultik/internal/log" + "sneak.berlin/go/vaultik/internal/snapshot" + "sneak.berlin/go/vaultik/internal/types" ) // SnapshotCreateOptions contains options for the snapshot create command diff --git a/internal/vaultik/vaultik.go b/internal/vaultik/vaultik.go index 7dce62a..51bc44d 100644 --- a/internal/vaultik/vaultik.go +++ b/internal/vaultik/vaultik.go @@ -7,14 +7,14 @@ import ( "io" "os" - "git.eeqj.de/sneak/vaultik/internal/config" - "git.eeqj.de/sneak/vaultik/internal/crypto" - "git.eeqj.de/sneak/vaultik/internal/database" - "git.eeqj.de/sneak/vaultik/internal/globals" - "git.eeqj.de/sneak/vaultik/internal/snapshot" - "git.eeqj.de/sneak/vaultik/internal/storage" "github.com/spf13/afero" "go.uber.org/fx" + "sneak.berlin/go/vaultik/internal/config" + "sneak.berlin/go/vaultik/internal/crypto" + "sneak.berlin/go/vaultik/internal/database" + "sneak.berlin/go/vaultik/internal/globals" + "sneak.berlin/go/vaultik/internal/snapshot" + "sneak.berlin/go/vaultik/internal/storage" ) // Vaultik contains all dependencies needed for vaultik operations diff --git a/internal/vaultik/verify.go b/internal/vaultik/verify.go index 542ae9f..5ee20eb 100644 --- a/internal/vaultik/verify.go +++ b/internal/vaultik/verify.go @@ -10,11 +10,11 @@ import ( "os" "time" - "git.eeqj.de/sneak/vaultik/internal/log" - "git.eeqj.de/sneak/vaultik/internal/snapshot" "github.com/dustin/go-humanize" "github.com/klauspost/compress/zstd" _ "modernc.org/sqlite" + "sneak.berlin/go/vaultik/internal/log" + "sneak.berlin/go/vaultik/internal/snapshot" ) // VerifyOptions contains options for the verify command diff --git a/internal/vaultik/verify_test.go b/internal/vaultik/verify_test.go index 7e03056..6ff6adc 100644 --- a/internal/vaultik/verify_test.go +++ b/internal/vaultik/verify_test.go @@ -8,10 +8,10 @@ import ( "io" "testing" - "git.eeqj.de/sneak/vaultik/internal/crypto" "github.com/klauspost/compress/zstd" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "sneak.berlin/go/vaultik/internal/crypto" ) // TestTeeReaderWithDecryption tests that TeeReader correctly hashes all encrypted