21 Commits

Author SHA1 Message Date
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
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
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
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
94f4f559b4
Avoid fuzzy search and direct show on gopass search (#1400)
Fixes #453

RELEASE_NOTES=[ENHANCEMENT] Avoid direct show on gopass search

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2020-05-29 23:03:56 +02:00
Dominik Schulz
be8e8d698c
Always copy passwords to clipboard is autoclip is set (#1316)
Fixes #1255
Fixes #1317

RELEASE_NOTES=[BUGFIX] Simplify autoclip behavior

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2020-05-03 19:11:58 +02:00
Moritz Johner
21ff26d73a
feat: support windows (#1295)
* feat: support windows

Signed-off-by: Moritz Johner <beller.moritz@googlemail.com>

* fix: revert unnecessary changes

Signed-off-by: Moritz Johner <beller.moritz@googlemail.com>

* fix: remove useless test

Signed-off-by: Moritz Johner <beller.moritz@googlemail.com>
2020-04-29 00:27:05 +02:00
Dominik Schulz
0f437fb468
Fix tests (#1281)
Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2020-04-25 20:02:44 +02:00
Martin Hoefling
3ba59c0d6b
Windows tests (#1171)
* make tests run on windows and osx

* add osx and windows as test target
* add slow test factor as osx doesn't seem to be fast enough to capture the test interval
* reset buildflags on windows as no PIC code can be built
* append .exe to gopass output
* fix some tests on windows, disable others

Signed-off-by: Martin Hoefling <martin.hoefling@gmx.de>

* kill gpg and test commands on windows after test

Signed-off-by: Martin Hoefling <martin.hoefling@gmx.de>

* disable problematic clipboard and jsonapi tests under windows

Signed-off-by: Martin Hoefling <martin.hoefling@gmx.de>
2020-04-24 17:52:00 +02:00
Yolan Romailler
5c5118553b
Let find support the -force flag (#1251)
Currently when the safecontent option is enable and the find action is
used and returns a single exact match, it will say: "Found exact match
in 'path'. No safe content to display, you can force display with show -f."

This is not accurate, since the -f flag is not supported by the find
action. This commit adds support for it so that it works as intended.

Adding some tests as well.

Signed-off-by: Yolan Romailler <yolan@romailler.ch>
2020-04-24 17:47:12 +02:00
Dominik Schulz
16e9e0f4b9
Update tests to abort if return value is critical (#997)
This commit updates the test cases to abort in cases where the returned values
must not be nil in order to avoid subsequent tests from panicking.

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2018-11-25 16:49:43 +01:00
Dominik Schulz
ad3c38294d
Refactor action package (#731) 2018-03-27 17:11:03 +02:00
Dominik Schulz
132b21fd02 Fix some typos and minor issues 2017-09-14 20:31:17 +02:00
Dominik Schulz
8ef89b3a59 Improve error handling and propagation (#280)
This commit makes heavy use of github.com/pkg/errors to improve
handling and propagation of errors and to provide more meaningful
error messages. It also fixes some minor issues/wording wrt. error
message. Also it introduces distinct exit codes for different types
of errors.

Fixes #150
2017-08-23 17:38:22 +02:00
Dominik Schulz
f90d667023 Fix tests 2017-08-21 17:44:25 +02:00
Dominik Schulz
4adb6e991a If find yields only one results display directly (#265)
* Implement terminal selection

Fixes #258

* Fix tests

* Add simple pagination

* If find yields only one results display directly

Fixes #263

* Fix tests
2017-08-15 15:43:05 +02:00
Dominik Schulz
1a05147d89 Release testing for 1.2.0 (#157)
Fixes #156
Fixes #146
2017-06-20 16:18:48 +02:00
Dominik Schulz
f78a04d72b Allow files and folders with the same name (#124)
Fixes #25
2017-06-13 15:21:44 +02:00
Dominik Schulz
f329ddc105 Make find compare entries case insensitive
Fixes #107
2017-05-17 13:40:12 +02:00
Dominik Schulz
a299b0e4e8 Add integration tests 2017-02-02 15:55:17 +01:00