Skip to content

Commit

Permalink
Remove the convert command
Browse files Browse the repository at this point in the history
We only have one revision control provider now, so conversion is really
just changing the encryption.  This is relatively easy to implement as
a shell script, similar to the sample `passage` migration script shown
in <https://github.com/FiloSottile/passage/blob/main/README>.  The
`convert` command would probably be better implemented as a separate
utility using `gopass` as a library (similar to `gopass-hibp`).
  • Loading branch information
kpitt committed Sep 28, 2022
1 parent bbaecf3 commit 02aeaa2
Show file tree
Hide file tree
Showing 7 changed files with 1 addition and 326 deletions.
2 changes: 0 additions & 2 deletions docs/backends/age.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ gopass recipients add github:user

This will automatically create a new age keypair and initilize the new store.

Existing stores can be migrated using `gopass convert --crypto age`.

## Features

* Encryption using `age` library, can be decrypted using the `age` CLI
Expand Down
24 changes: 0 additions & 24 deletions docs/commands/convert.md
Original file line number Diff line number Diff line change
@@ -1,24 +0,0 @@
# `convert` command

The `convert` command exists to migrate stores between different backend
implementations.

Note: This command exists to enable a possible migration path. If we agree
on a single set of backend implementations the multiple backend support
might go away and this command as well.

## Synopsis

```
$ gopass convert --store=foo --move=true --storage=gitfs --crypto=age
$ gopass convert --store=bar --move=false --storage=fs --crypto=plain
```

## Flags

Flag | Description
---- | -----------
`--store` | Substore to convert.
`--move` | Remove backup after converting? (default: `false`)
`--storage` | Target storage backend.
`--crypto` | Target crypto backend.
27 changes: 0 additions & 27 deletions internal/action/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,33 +151,6 @@ func (s *Action) GetCommands() []*cli.Command {
Action: s.Config,
BashComplete: s.ConfigComplete,
},
{
Name: "convert",
Usage: "Convert a store to different backends",
Description: "Convert a store to a different set of backends",
Action: s.Convert,
Before: s.IsInitialized,
Hidden: true,
Flags: []cli.Flag{
&cli.StringFlag{
Name: "store",
Usage: "Specify which store to convert",
},
&cli.BoolFlag{
Name: "move",
Value: true,
Usage: "Replace store?",
},
&cli.StringFlag{
Name: "crypto",
Usage: fmt.Sprintf("Which crypto backend? %v", backend.CryptoRegistry.BackendNames()),
},
&cli.StringFlag{
Name: "storage",
Usage: fmt.Sprintf("Which storage backend? %v", backend.StorageRegistry.BackendNames()),
},
},
},
{
Name: "copy",
Aliases: []string{"cp"},
Expand Down
91 changes: 0 additions & 91 deletions internal/action/convert.go

This file was deleted.

147 changes: 0 additions & 147 deletions internal/store/leaf/convert.go

This file was deleted.

34 changes: 0 additions & 34 deletions internal/store/root/convert.go

This file was deleted.

2 changes: 1 addition & 1 deletion main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ func TestGetCommands(t *testing.T) { //nolint:paralleltest
c.Context = ctx

commands := getCommands(act, app)
assert.Equal(t, 39, len(commands))
assert.Equal(t, 38, len(commands))

prefix := ""
testCommands(t, c, commands, prefix)
Expand Down

0 comments on commit 02aeaa2

Please sign in to comment.