168 Commits

Author SHA1 Message Date
google-labs-jules[bot]
57db06bd94
Add regression test for issue #2571 (#3250)
* feat: Add regression test for issue #2571

This commit adds a regression test for issue #2571. The issue describes a scenario where `gopass sync` incorrectly removes public keys for sub-stores under certain conditions.

The new integration test in `tests/sync_test.go` reproduces the steps outlined in the GitHub issue to ensure that the public key is not deleted after running `gopass sync`.

* [fix] Fix lint errors

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>

---------

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Co-authored-by: Dominik Schulz <dominik.schulz@gauner.org>
2025-09-22 17:55:19 +02:00
google-labs-jules[bot]
8c60b17c24
feat(age): Add unlock command to age agent (#3244)
* feat(age): Add unlock command to age agent

This change introduces a proper lock/unlock mechanism for the age agent.

The issue was that after locking the agent with `gopass age lock`, there was no way to unlock it without restarting the agent. This made the lock command mostly useless.

This change introduces a new `unlock` command for the agent and a `locked` state.

- The `lock` command now sets a `locked` flag to `true` in addition to clearing identities.
- The `decrypt` function in the agent now checks this `locked` flag and returns an error if the agent is locked.
- When the gopass client receives the "agent is locked" error, it will ask the user for their passphrase, reload the identities, and send them to the agent.
- A new `gopass age agent unlock` CLI command is added to trigger this new functionality.
- The `gopass age agent status` command is enhanced to report whether the agent is locked.
- The old top-level `gopass age lock` command is hidden, and a new `gopass age agent lock` command is introduced for consistency.

Fixes #3242

* feat(age): Add unlock command to age agent

This change introduces a proper lock/unlock mechanism for the age agent.

The issue was that after locking the agent with `gopass age lock`, there was no way to unlock it without restarting the agent. This made the lock command mostly useless.

This change introduces a new `unlock` command for the agent and a `locked` state.

- The `lock` command now sets a `locked` flag to `true` in addition to clearing identities.
- The `decrypt` function in the agent now checks this `locked` flag and returns an error if the agent is locked.
- When the gopass client receives the "agent is locked" error, it will ask the user for their passphrase, reload the identities, and send them to the agent.
- A new `gopass age agent unlock` CLI command is added to trigger this new functionality.
- The `gopass age agent status` command is enhanced to report whether the agent is locked.
- The old top-level `gopass age lock` command is hidden, and a new `gopass age agent lock` command is introduced for consistency.

I have also addressed the PR comment about the import alias. I have removed the alias and used a dot import instead to avoid the name collision.

Fixes #3242

* feat(age): Add unlock command to age agent

This change introduces a proper lock/unlock mechanism for the age agent.

The issue was that after locking the agent with `gopass age lock`, there was no way to unlock it without restarting the agent. This made the lock command mostly useless.

This change introduces a new `unlock` command for the agent and a `locked` state.

- The `lock` command now sets a `locked` flag to `true` in addition to clearing identities.
- The `decrypt` function in the agent now checks this `locked` flag and returns an error if the agent is locked.
- When the gopass client receives the "agent is locked" error, it will ask the user for their passphrase, reload the identities, and send them to the agent.
- A new `gopass age agent unlock` CLI command is added to trigger this new functionality.
- The `gopass age agent status` command is enhanced to report whether the agent is locked.
- The old top-level `gopass age lock` command is hidden, and a new `gopass age agent lock` command is introduced for consistency.

To avoid name collisions with the imported `filippo.io/age` package, the local `age` package has been renamed to `agecrypto`.

Fixes #3242

* feat(age): Add auto-lock feature to age agent

This change introduces an auto-lock feature for the age agent. The agent will now automatically lock itself after a configurable period of inactivity.

This change also includes the initial fix for issue #3242, which introduced a proper lock/unlock mechanism for the age agent.

- A new config option `age.agent-timeout` is added to specify the inactivity timeout in seconds.
- The agent now has a timer that is reset on every successful decryption operation.
- If the timer expires, the agent locks itself.
- A new `set-timeout` command is added to the agent protocol to configure the timeout.
- The gopass client sends the timeout to the agent when it starts or when it unlocks the agent.
- A new test `TestAgentAutoLock` is added to verify the new functionality.

To avoid name collisions with the imported `filippo.io/age` package, the local `age` package has been renamed to `agecrypto`.

Fixes #3242

* [fix] Fix lint issues

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>

---------

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Co-authored-by: Dominik Schulz <dominik.schulz@gauner.org>
2025-09-20 17:09:12 +02:00
google-labs-jules[bot]
baad47c7ef
feat(age): add agent for passphrase caching (#3218)
* This change introduces an agent for the age backend to cache passphrases for age identities.

The agent is a long-running process that listens on a Unix domain socket. Gopass communicates with the agent to request decryption of secrets. The agent caches the passphrases for the identities and performs the decryption, so the passphrases never leave the agent process. This addresses the security concerns with the initial implementation.

The agent can be controlled with the following commands:
- `gopass age agent`: starts the agent in the foreground.
- `gopass age lock`: locks the agent, clearing all cached passphrases.

The age backend will automatically start the agent if it's not already running and the `age.agent-enabled` configuration option is set to `true` (the default).

This change includes:
- The implementation of the age agent in `internal/backend/crypto/age/agent/`.
- Modifications to the age backend to communicate with the agent.
- A new configuration option `age.agent-enabled`.
- Unit tests for the agent.
- Updated documentation for the age backend.

The integration test for this feature (`TestAgeAgent`) is currently failing. The issue is that the test environment is non-interactive, and the code path for initializing a new age store requires a password for the identity keyring, which triggers a `pinentry` call that fails without a TTY. I have tried several approaches to work around this, including setting the `GOPASS_PASSWORD` environment variable and providing a custom pinentry script, but none have been successful so far. The core implementation of the agent is believed to be correct, but the integration test needs further work to run in a non-interactive environment.

* This change introduces an agent for the age backend to cache passphrases for age identities.

The agent is a long-running process that listens on a Unix domain socket. Gopass communicates with the agent to request decryption of secrets. The agent caches the passphrases for the identities and performs the decryption, so the passphrases never leave the agent process. This addresses the security concerns with the initial implementation.

The agent can be controlled with the following commands:
- `gopass age agent`: starts the agent in the foreground.
- `gopass age lock`: locks the agent, clearing all cached passphrases.

The age backend will automatically start the agent if it's not already running and the `age.agent-enabled` configuration option is set to `true` (the default).

This change includes:
- The implementation of the age agent in `internal/backend/crypto/age/agent/`.
- Modifications to the age backend to communicate with the agent.
- A new configuration option `age.agent-enabled`.
- Unit tests for the agent.
- Updated documentation for the age backend.

* This change introduces an agent for the age backend to cache passphrases for age identities.

The agent is a long-running process that listens on a Unix domain socket. Gopass communicates with the agent to request decryption of secrets. The agent caches the passphrases for the identities and performs the decryption, so the passphrases never leave the agent process. This addresses the security concerns with the initial implementation.

The agent can be controlled with the following commands:
- `gopass age agent`: starts the agent in the foreground.
- `gopass age lock`: locks the agent, clearing all cached passphrases.

The age backend will automatically start the agent if it's not already running and the `age.agent-enabled` configuration option is set to `true` (the default).

This change includes:
- The implementation of the age agent in `internal/backend/crypto/age/agent/`.
- Modifications to the age backend to communicate with the agent.
- A new configuration option `age.agent-enabled`.
- Unit tests for the agent.
- Updated documentation for the age backend.

* This change introduces an agent for the age backend to cache passphrases for age identities.

The agent is a long-running process that listens on a Unix domain socket. Gopass communicates with the agent to request decryption of secrets. The agent caches the passphrases for the identities and performs the decryption, so the passphrases never leave the agent process. This addresses the security concerns with the initial implementation.

The agent can be controlled with the following commands:
- `gopass age agent`: starts the agent in the foreground.
- `gopass age lock`: locks the agent, clearing all cached passphrases.

The age backend will automatically start the agent if it's not already running and the `age.agent-enabled` configuration option is set to `true` (the default).

This change includes:
- The implementation of the age agent in `internal/backend/crypto/age/agent/`.
- Modifications to the age backend to communicate with the agent.
- A new configuration option `age.agent-enabled`.
- Unit tests for the agent.
- Updated documentation for the age backend.

* Fix some test failures and add more logging.

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>

* Fix lint error

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>

* [fix] Fix integration tests

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>

---------

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Co-authored-by: Dominik Schulz <dominik.schulz@gauner.org>
2025-09-15 22:03:33 +02:00
Dominik Schulz
f893378261
[fix] Disable Windows tests (#3204)
We have some strange test failures on Windows and I can not identify any
root cause in this repo. It does look like either a Go or a GHA Windows
builder regression and I currently don't have the resources to properly
debug those. If you care about Windows, please help. Otherwise I have
to turn these off for now to unblock PR which are perfectly find on
other platforms.

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2025-08-19 20:19:52 +02:00
Parham Alvani
46dfddaef0
Handle referencing in passwords (#3163)
* feat: handle referencing in passwords

Signed-off-by: Parham Alvani <parham.alvani@gmail.com>

* feat: use seq over slice to improve performance

Signed-off-by: Parham Alvani <parham.alvani@gmail.com>

* feat: handle error during reference following

Signed-off-by: Parham Alvani <parham.alvani@gmail.com>

* feat: provide a flag for not following references

Signed-off-by: Parham Alvani <parham.alvani@gmail.com>

* feat: disable ref following on edit and remove the flag

Signed-off-by: Parham Alvani <parham.alvani@gmail.com>

* feat: provide a configuration for follow-references

Signed-off-by: Parham Alvani <parham.alvani@gmail.com>

* fix: correct configuration tests

Signed-off-by: Parham Alvani <parham.alvani@gmail.com>

* fix: correct tests and document the new flag

Signed-off-by: Parham Alvani <parham.alvani@gmail.com>

* fix: correct integration test

Signed-off-by: Parham Alvani <parham.alvani@gmail.com>

* fix: correct tests

Signed-off-by: Parham Alvani <parham.alvani@gmail.com>

---------

Signed-off-by: Parham Alvani <parham.alvani@gmail.com>
2025-05-28 18:10:54 +02:00
Tom Payne
7e3c54d1f9
[feat] Remove expensive and unmaintained zxcvbn-go strength checker (#3133)
Signed-off-by: Tom Payne <twpayne@gmail.com>
2025-04-20 20:47:26 +02:00
Dominik Schulz
f4ee40ce23
[feat] Replace clipboard library to support wl-copy args (#3123)
* [feat] Replace clipboard library to support wl-copy args

This change should allow us to protect sensitive content
from being captured in some clipboard managers on KDE.

Fixes #2611

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>

* [chore] Update clipboard dep

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>

* [fix] Update clipboard

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>

---------

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2025-04-19 14:46:14 +02:00
Dominik Schulz
7281ca8ab4
[chore] Migrate to golangci-lint v2 (#3104)
* [chore] Migrate to golangci-lint v2

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>

* [chore] Fix more lint issues

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>

* [chore] Fix more lint issue

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>

* [chore] Fix more lint issues

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>

* [chore] Add more package comments.

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>

* [chore] Fix golangci-lint config and the remaining checks

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>

* [fix] Use Go 1.24

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>

* [fix] Fix container builds

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>

* Fix more failing tests

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>

* Fix test failure

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>

* Fix another len assertion

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>

* Move location tests

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>

* [fix] Fix most remaining lint issues

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>

* [fix] Only run XDG specific tests on linux

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>

* [fix] Attempt to address on source of flaky failures

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>

---------

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2025-04-17 08:05:43 +02:00
GLoby
c32ec32a52
[TESTING/CLEANUP] Replace deprecated tenv linter for usetesting (#3087)
* [CLEANUP] Comply to linters about blank lines

Signed-off-by: Ilya Eryomenko <ilya@eryomenko.com>

* [TESTING] Replace tenv linter with usetesting as it's deprecated

Signed-off-by: Ilya Eryomenko <ilya@eryomenko.com>

* [TESTING] Replace os.MkdirTemp with t.TempDir for improved test isolation and comply with usetesting linter

Signed-off-by: Ilya Eryomenko <ilya@eryomenko.com>

* [TESTING] Ensure temporary directories are not empty in tests

Signed-off-by: Ilya Eryomenko <ilya@eryomenko.com>

---------

Signed-off-by: Ilya Eryomenko <ilya@eryomenko.com>
2025-03-14 13:22:36 +01:00
Dominik Schulz
cd6006a5ce
chore: Fix new linter issues (#2998)
* chore: Fix new linter issues

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>

* fix: Do not use JSONeq for mixed content

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>

---------

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2024-11-24 14:44:29 +01:00
Ludovic Fernandez
9b6a28f031
[chore] use the same version of golangci-lint (#2948)
* [chore] use the same version of golangci-lint

Signed-off-by: Fernandez Ludovic <ldez@users.noreply.github.com>

* Fixing the new lint issues in 1.61.0

Signed-off-by: Yolan Romailler <AnomalRoil@users.noreply.github.com>

* Fixing test issue introduced by lint fix

Signed-off-by: Yolan Romailler <AnomalRoil@users.noreply.github.com>

* [chore] show golangci-lint stats

Signed-off-by: Fernandez Ludovic <ldez@users.noreply.github.com>

---------

Signed-off-by: Fernandez Ludovic <ldez@users.noreply.github.com>
Signed-off-by: Yolan Romailler <AnomalRoil@users.noreply.github.com>
Co-authored-by: Yolan Romailler <AnomalRoil@users.noreply.github.com>
2024-09-25 15:36:23 +02:00
Dominik Schulz
d6669e15e5
chore: Switch to static list of linters (#2882)
* chore: Switch to static list of linters

The old approach was prone to random CI failures when a golangci-lint
was updated and did enable new linters. This approach means we will have
to update the include list from time to time but won't get random CI
failures.

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>

* fix: Update enabled linters to be compatible with GHA

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>

---------

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2024-06-10 13:54:49 +02:00
Dominik Schulz
34567d93ee
[bugfix] Bring back audit summary (#2820)
* [bugfix] Bring back audit summary

This PR brings back the audit summary view and displays only that by
default. This restores the old behaviour before we refactored the
audit implementation. The new view is still available with the
new --full flag.

Fixes #2816

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>

* Fix tests.

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>

* Fix integration test

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>

---------

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2024-03-13 14:26:06 +01:00
Dominik Schulz
9edbf3070c
[feat] Allow supression of password generation in create templates (#2821)
* [feat] Allow supression of password generation in create templates

This PR adds a new always_prompt boolean that allows suppressing the
question that ask for generating a password in create templates. Use
this is you always want to force entering the credentials, e.g. if
you use a specific template for vendor-supplied credentials.

Fixes #2819

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>

* Remove failing integration test

The messages have changed and the removed one is not expected anymore.

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>

* Fix lint check

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>

---------

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2024-03-13 14:11:52 +01:00
Yolan Romailler
d3c64f2d90
[BUGFIX] Use 'en' as default language for the xkcd generator (#2793)
* [BUGFIX] Use 'en' as default language for the xkcd generator

Fixes #2792

Signed-off-by: Yolan Romailler <anomalroil@users.noreply.github.com>

* [n/a] massaging integration tests

Signed-off-by: Yolan Romailler <anomalroil@users.noreply.github.com>

---------

Signed-off-by: Yolan Romailler <anomalroil@users.noreply.github.com>
2024-02-10 13:59:29 +01:00
Yolan Romailler
d56639fcd7
[CLEANUP] Migration of options to more appropriate sections (#2681)
* [CLEANUP] Moving options to the correct config section

This adds an easy migration path to our config handling, which should
allow us to migrate option names around much more easily in the future.

Any system level config or env variables options are not migrated.

This also fixes a bug in our test code, where the root mount path was
not properly set in our config, because we used "path:" instead of
"path=" to set it.

Signed-off-by: Yolan Romailler <anomalroil@users.noreply.github.com>

* [DOCUMENTATION] Document legacy options and their migration path

This also makes sure that legacy options aren't used in the code anymore using the docs test and its regexp

Signed-off-by: Yolan Romailler <anomalroil@users.noreply.github.com>

* [n/a] Removing weird spaces from changelog

Signed-off-by: Yolan Romailler <anomalroil@users.noreply.github.com>

* [DOCUMENTATION] Reformatting our Markdown tables properly

Signed-off-by: Yolan Romailler <anomalroil@users.noreply.github.com>

* [TESTING] Patching a timezone bug in tests

This is a fun one where if your Timezone isn't UTC and you are past midnight but it's not past midnight UTC, the tests would fail because you're not using the right date to validate it.

Signed-off-by: Yolan Romailler <anomalroil@users.noreply.github.com>

* [n/a] Fix a typo and use the correct Env variables in the doc about the custom Env variables

Signed-off-by: Yolan Romailler <anomalroil@users.noreply.github.com>

* [BREAKING] Custom Env options moved from GOPASS_CONFIG_CONFIG_KEY_i to GOPASS_CONFIG_KEY_i

As discussed in #2617, this actually reflects the way GIT_CONFIG works.

It also fixes a potential Panic in our codebase when IsSet was called
without any Preset config on a non-existing key.

Signed-off-by: Yolan Romailler <anomalroil@users.noreply.github.com>

* [CLEANUP] Patching all of the new linter complaints

Signed-off-by: Yolan Romailler <anomalroil@users.noreply.github.com>

* [CLEANUP] Use Go1.21 everywhere

Signed-off-by: Yolan Romailler <anomalroil@users.noreply.github.com>

* [n/a] Increase our Golangci timeout

Signed-off-by: Yolan Romailler <anomalroil@users.noreply.github.com>

* [n/a] code review comment and extra regression test

Signed-off-by: Yolan Romailler <anomalroil@users.noreply.github.com>

---------

Signed-off-by: Yolan Romailler <anomalroil@users.noreply.github.com>
2023-11-03 18:40:58 +01:00
sudoforge
9fdb08b210
feat: add core.autopush to separate push/autosync behavior (#2569)
This change adds a `core.autopush` configuration option (which defaults
to a value of `true`). This new configuration option is used in
post-write-ish actions, to determine if the remote repository should be
pushed to. In doing this, we support workflows where a user may want to
always push to the remote, but disable the behavior of "sync", which
fetches updates from remotes for all mounts (including the root store).

Closes: gopasspw/gopass#2551

Signed-off-by: sudoforge <9c001b67637a@sudoforge.com>
2023-04-07 17:18:23 +02:00
Dominik Schulz
4a9fe688a5
Hide unnecessary git error messages during gopass init (#2547)
* Hide unnecessary git error messages during gopass init

These don't impact the setup workflow but confuse users.

Fixes #2543

RELEASE_NOTES=[BUGFIX] Hide harmless git error messages.

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>

* Ignore module with valid but strangly formatted license from checks

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>

* Fix integration tests

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>

---------

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2023-02-09 15:07:44 +01:00
Dominik Schulz
932d7a1d54
Rewrite gopass audit (#2506)
* Start new auditor

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>

* Add new files

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>

* Rewrite gopass audit

Fixes #2504

RELEASE_NOTES=[ENHANCEMENT] Rewrite gopass audit. Add HTML and CSV
exports.

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>

* Fix tests

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>

* Add template flag

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2023-01-03 21:03:42 +01:00
Dominik Schulz
5d5e83d789
Check existing recipients before trying to add a new one (#2487)
* Check existing recipients before trying to add a new one

Fixes #1918

RELEASE_NOTES=[ENHANCEMENT] Check recipients before adding a new one.

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>

* Add test for CheckRecipients with an invalid key.

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>

* Add custom error type and a better error message.

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>

* Initialize InvalidRecipientsError

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>

* Skip CheckRecipients tests on Windows

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2022-12-24 19:16:41 +01:00
Dominik Schulz
d9199cd9c2
Incorporate cleanup and simplifications ideas from kpitt/gopass (#2468)
* Improve test isolation

These test shouldn't pick up user configs.

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>

* Use correct flag names for rcs init test

These flags must use the canonical names since they are not processed
by the CLI library and as such aliases are not applied.

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>

* Remove obsolete warning in fsck help

The default format should be fully compatible with other
password store implementations.

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>

* Remove unused "Verbose" context property

This was never set anywhere, so we can safely remove it.

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>

* Remove --clip option for the find command

When this is invoked as `gopass find` there is actually no
code path that leads to this flag being used.

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>

* Remove mount versions from the `version` command

The `version` command should generally only print the version and not
load the full config, trigger auto-sync and other operations the
happend when initializing the mounts.

Moving the mount point information to the new `mounts versions` command.

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>

* Update find integration test

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>

* Do not run auto-sync if the command is `sync`

Otherwise sync might run twice.

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>

* Reset auto-sync if a full `sync` succeeds

Since a `gopass sync` without the `--store` option is the same
operation as an auto-sync we should reset the interval if it
was successfull.

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>

* Remove sync messages about importing and exporting keys

These usually don't take a lot of time and don't need a mention unless
they fail.

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>

* Refactor OTP action to reduce code complexity and duplication

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>

* Clean up outdated Git documentation

`gopass` isn't configuring `git` to sign commits anymore.

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2022-12-11 23:08:46 +01:00
Dominik Schulz
f58454452f
Increase test coverage (#2461)
RELEASE_NOTES=n/a

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2022-12-10 23:05:33 +01:00
Dominik Schulz
1e7a6b160a
Maintain secret structure when parsing (#2433)
* Maintain secret structure when parsing

This commit introduces a new KV secret type ("AKV") that fully maintains
the secret format when parsing. As such it obsoletes the old KV and
Plain formats and the need for the core.parsing option.

Fixes #2431

RELEASE_NOTES=[ENHANCEMENT] Maintain secret structure when parsing

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>

* Update internal/action/edit.go

Co-authored-by: Yolan Romailler <AnomalRoil@users.noreply.github.com>

* Address review comments

This brings back the noparsing flag since we need this to cover some
corners cases.

RELEASE_NOTES=n/a

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
Co-authored-by: Yolan Romailler <AnomalRoil@users.noreply.github.com>
2022-12-01 22:53:40 +01:00
Dominik Schulz
18ffee354f
Add .gitconfig parser (#2395)
This commit adds yet another config handler for gopass. It is based on
the format used by git itself. This has the potential to address a lot
of long standing issues, but it also causes a lot of changes to how we
handle configuration, so bugs are inevitable.

Fixes #1567
Fixes #1764
Fixes #1819
Fixes #1878
Fixes #2387
Fixes #2418

RELEASE_NOTES=[BREAKING] New config format based on git config.

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
Co-authored-by: Yolan Romailler <AnomalRoil@users.noreply.github.com>

address comments

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2022-11-25 10:50:34 +01:00
Dominik Schulz
9f037ddd4f Update config integration tests
Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2022-09-27 21:50:39 +02:00
Dominik Schulz
9885c2ff64
Add GPG unit test harness (#2254)
RELEASE_NOTES=n/a

Fixes #2252

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2022-06-07 20:49:09 +02:00
Dominik Schulz
c426b57420
Allow removing multiple secrets at one (#2239)
RELEASE_NOTES=[ENHANCEMENT] Allow deleting multiple secrets

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2022-05-30 20:03:23 +02:00
Dominik Schulz
16c071a780
Enable golangci-lint on push and pr (#2158)
Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2022-03-24 21:58:53 +01:00
Dominik Schulz
5eceae1f86
Try gocritic (#2169)
RELEASE_NOTES=n/a

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2022-03-17 21:07:55 +01:00
Dominik Schulz
117db90478
Update deps (#2168)
Ran 'make upgrade' (includes gofumpt).

RELEASE_NOTES=n/a

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2022-03-17 20:55:53 +01:00
Dominik Schulz
7dd8ed505a
Handle from prefix correctly during move (#2110)
Fixes #2079

RELEASE_NOTES=[BUGFIX] Handle from prefix correctly on mv

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2022-01-14 23:05:07 +01:00
Justin Kromlinger
6758797df0
Add env variables for custom clipboard commands (#2091)
* Add env variables for custom clipboard commands

Adds `GOPASS_CLIPBOARD_COPY_CMD` and `GOPASS_CLIPBOARD_CLEAR_CMD`
environment variables which are called instead of the normal
implementation if set. The commands receive the name of the password as
their first parameter and the password or its checksum on `STDIN`.

Resolves #2042.

RELEASE_NOTES=[FEATURE] Add env variables for custom clipboard commands.

Signed-off-by: hashworks <mail@hashworks.net>

* Improve two line test ambiguity

The output might contain the previous value "and". Additionally with the
new values it is now clearer what is tested.

RELEASE_NOTES=[TESTING] Improve two line test ambiguity.

Signed-off-by: hashworks <mail@hashworks.net>

* Use a helper to unset env vars in clipboard tests

RELEASE_NOTES=[TESTING] Use a helper to unset env vars in clipboard tests.

Signed-off-by: hashworks <mail@hashworks.net>
2022-01-11 10:02:08 +01:00
Dominik Schulz
0eff31a8ce
Enable additional golangci-lint godot checks (#2077) 2021-12-29 22:47:53 +01:00
Yolan Romailler
fa249c4cf4
Avoid using predeclared names as variable (#2076)
RELEASE_NOTES=n/a

Signed-off-by: Yolan Romailler <anomalroil@users.noreply.github.com>
2021-12-28 20:07:22 +01:00
Yolan Romailler
3d3c7d5b77
GCI-ing imports (#2072)
Running gci in order to make sure we have properly deterministic imports

RELEASE_NOTES=n/a

Signed-off-by: Yolan Romailler <anomalroil@users.noreply.github.com>
2021-12-28 13:59:31 +01:00
Dominik Schulz
03aa36b826
Create wizard (#2064)
RELEASE_NOTES=[ENHANCEMENT] Template support for the create wizard

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2021-12-24 07:16:35 +01:00
Dominik Schulz
5f8afb6415
Improve compatibility with passage (#2060)
* Improve compatibility with github.com/FiloSottile/passage

Part of #2060

RELEASE_NOTES=[ENHANCEMENT] Passage compat improvements

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>

* Add migration tooling to automate upgrades with existing age backends

RELEASE_NOTES=n/a

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2021-12-21 11:04:35 +01:00
Yolan Romailler
a4e2a777b0
Using sane default for partial config (#1968)
RELEASE_NOTES=[BUGFIX] Use same default for partial config files

This is also upgrading the documentation regarding setup as we didn't reflect the move to the .local dir in there yet.

Fixes #1654

Fixes #1967

Signed-off-by: Yolan Romailler <yolan@romailler.ch>
2021-08-08 15:28:26 +02:00
Dominik Schulz
1131dbf5fb
Remove GOPASS_NOCOLOR (#1937)
Fixes #1936

RELEASE_NOTES=[CLEANUP] Remove GOPASS_NOCOLOR in favor of NO_COLOR

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2021-08-05 22:33:31 +02:00
Dominik Schulz
2c9cbb5208
Add more debug logging (#1856)
RELEASE_NOTES=n/a

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2021-03-20 20:54:56 +01:00
Dominik Schulz
73ed2c189e
Upgrade to Go 1.16 (#1803)
Remove usage of io/ioutil: https://golang.org/doc/go1.16?s=03#ioutil

RELEASE_NOTES=[ENHANCEMENT] Use Go 1.16

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2021-02-17 21:39:07 +01:00
Dominik Schulz
08b7d56d65
Add suffix f to formating out methods (#1794)
This commit renames the existing out methods that expect
a format string to include the common f suffix and introduces
new out methods without this suffix that don't accept a
format string or variadic arguments.

Fixes #1793

RELEASE_NOTES=n/a

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2021-02-15 19:38:58 +01:00
Dominik Schulz
d9759ffec8
Replace github.com/pkg/errors by stdlib errors (#1750)
RELEASE_NOTES=n/a

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2021-01-26 09:21:52 +01:00
Yolan Romailler
61329b3198
Adding support for multiple same keys (#1741)
RELEASE_NOTES=[ENHANCEMENT] KV secrets are now key-values, supporting multiple same key with different values

Fixes #1576

Signed-off-by: Yolan Romailler <yolan@romailler.ch>
2021-01-22 08:50:38 +01:00
Dominik Schulz
74ea14c323
Remove colored output (#1743)
This confuses some terminals.

Also: fix setup.go condition and validate git setup.

Fixes #1464
Fixes #1467

RELEASE_NOTES=n/a

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2021-01-21 10:32:25 +01:00
Dominik Schulz
2d1b87514c
UX update (#1715)
Streamline command output, add unicode icons and ask for passphrase
during onboarding.

Fixes #1698

RELEASE_NOTES=[ENHANCEMENT] UTF-8 emojis
RELEASE_NOTES=[BUGFIX] Ask passphrase upon key generation


Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2021-01-18 13:54:49 +01:00
Dominik Schulz
ddfe7bfc97
Remove final references to internal packages (#1709)
RELEASE_NOTES=n/a

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2021-01-14 09:15:29 +01:00
Dominik Schulz
ff349772ac
Reduce dependencies on internal packages (#1707)
This PR moves some packages from internal to pkg to increase the
independence of binaries in cmd/ from internal packages further.

RELEASE_NOTES=n/a

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2021-01-13 18:21:09 +01:00
Yolan Romailler
fb2553bba0
Disable input parsing (#1681)
Fixes #1602
Fixes #1614
Fixes #1600
Fixes #1594
Fixes #1601
Fixes #1650

RELEASE_NOTES=[BUGFIX] Disabling all kind of parsing of the input
RELEASE_NOTES=[ENHANCEMENT] Adding the flag show -n to disable output parsing
RELEASE_NOTES=[ENHANCEMENT] Adding the option parsing to disable all parsing

Signed-off-by: Yolan Romailler <yolan@romailler.ch>
2021-01-07 21:53:06 +01:00
Dominik Schulz
ddc223262e
Remove MIME secrets (#1665)
RELEASE_NOTES=[CLEANUP] Remove MIME

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2021-01-02 12:47:58 +01:00