Skip to content

Commit

Permalink
Merge pull request #10 from kpitt/less-opinionated-config
Browse files Browse the repository at this point in the history
Don't be overly-opinionated about user's configuration
  • Loading branch information
kpitt authored Sep 28, 2022
2 parents cd84f76 + c516101 commit 461fad1
Show file tree
Hide file tree
Showing 8 changed files with 2 additions and 133 deletions.
3 changes: 0 additions & 3 deletions docs/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@ Yes, there is a gopass-based [Terraform provider](https://github.com/camptocamp/
## How can I fix `"gpg: decryption failed: No secret key"` errors?
Set the `auto-expand-secmem` option in your gpg-agent.conf, if your version of GnuPG supports it.

## I'm getting `Path too long for Unix domain socket` errors, usually on MacOS.
This can be fixed by setting `export TMPDIR=/tmp` (or any other suiteable location with a path shorter than 80 characters).

## Empty secret?
Old version of `gpg` may fail to decode message encrypted with newer version without any message. The encrypted secret in such case is just empty and gopass will warn you about this. One case of such behaviour we have seen so far is when the encryption key generated with `gpg` version 2.3.x encrypt a password that is then decrypted on `gpg` version 2.2.x (default on Ubuntu 18.04). In this particular case old `gpg` does not understand `AEAD` encryption extension, and it fails without any error. If it is your case then follw the instructions in listed in #2283.

Expand Down
13 changes: 0 additions & 13 deletions internal/action/reminder.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"context"
"os"

"github.com/kpitt/gopass/internal/env"
"github.com/kpitt/gopass/internal/out"
"github.com/kpitt/gopass/pkg/ctxutil"
)
Expand All @@ -22,18 +21,6 @@ func (s *Action) printReminder(ctx context.Context) {
return
}

// this might be printed along other reminders
if s.rem.Overdue("env") {
msg, err := env.Check(ctx)
if err != nil {
out.Warningf(ctx, "Failed to check environment: %s", err)
}
if msg != "" {
out.Warningf(ctx, "%s", msg)
}
_ = s.rem.Reset("env")
}

// Note: We only want to print one reminder per day (at most).
// So we intentionally return after printing one, leaving the others
// for the following days.
Expand Down
19 changes: 2 additions & 17 deletions internal/backend/storage/gitfs/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,6 @@ const (
// that git has. We'd prefer if that wasn't necessary but git has way too many modes of operation
// and we need it to behave a predicatable as possible.
func (g *Git) fixConfig(ctx context.Context) error {
// set push default, to avoid issues with
// "fatal: The current branch master has multiple upstream branches, refusing to push"
// https://stackoverflow.com/questions/948354/default-behavior-of-git-push-without-a-branch-specified.
if err := g.ConfigSet(ctx, "push.default", "matching"); err != nil {
return fmt.Errorf("failed to set git config for push.default: %w", err)
}

if err := g.ConfigSet(ctx, "pull.rebase", "false"); err != nil {
return fmt.Errorf("failed to set git config for pull.rebase: %w", err)
}

// setup for proper diffs.
if err := g.ConfigSet(ctx, "diff.gpg.binary", "true"); err != nil {
out.Errorf(ctx, "Error while initializing git: %s", err)
Expand All @@ -40,12 +29,7 @@ func (g *Git) fixConfig(ctx context.Context) error {
out.Errorf(ctx, "Error while initializing git: %s", err)
}

// setup for persistent SSH connections.
if sc := gitSSHCommand(); sc != "" {
if err := g.ConfigSet(ctx, "core.sshCommand", sc); err != nil {
out.Errorf(ctx, "Error while configuring persistent SSH connections: %s", err)
}
}
// TODO: should set up for age encryption also, or check the crypto backend

return nil
}
Expand Down Expand Up @@ -73,6 +57,7 @@ func (g *Git) InitConfig(ctx context.Context, userName, userEmail string) error
return fmt.Errorf("failed to fix git config: %w", err)
}

// TODO: handle `*.age` files if using `age` crypto backend
if err := os.WriteFile(filepath.Join(g.fs.Path(), ".gitattributes"), []byte("*.gpg diff=gpg\n"), fileMode); err != nil {
return fmt.Errorf("failed to initialize git: %w", err)
}
Expand Down
19 changes: 0 additions & 19 deletions internal/backend/storage/gitfs/ssh_darwin.go

This file was deleted.

20 changes: 0 additions & 20 deletions internal/backend/storage/gitfs/ssh_others.go

This file was deleted.

8 changes: 0 additions & 8 deletions internal/backend/storage/gitfs/ssh_windows.go

This file was deleted.

42 changes: 0 additions & 42 deletions internal/env/env_darwin.go

This file was deleted.

11 changes: 0 additions & 11 deletions internal/env/env_others.go

This file was deleted.

0 comments on commit 461fad1

Please sign in to comment.