* [fix] Fix test regressions
This change fixes some tests that did start to fail at some point.
I can't tell for sure when they broke (didn't bisect) and if that
breakage is isolated to my system or not. But I need to fix them
anyway.
Fixes#3115
Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
* Add missing files.
Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
* Fix test failure
Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
* Fix one more version test
Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
---------
Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
* [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>
There is no good way to test these in isolation right now.
RELEASE_NOTES=n/a
Fixes#2469
Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
* 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>
This commit replaces `os.Setenv` with `t.Setenv` in tests. The
environment variable is automatically restored to its original value
when the test and all its subtests complete.
Reference: https://pkg.go.dev/testing#T.Setenv
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
Fixes#2412
RELEASE_NOTES=[BUGFIX] Only pass vim options to vim
Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
* Set vim options instead of sniffing the config
Fixes#2317
RELEASE_NOTES=[ENHANCEMENT] Set vim options instead of sniffing
Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
* Add a note on vim hardening flags to the docs.
Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
The previous recommended vim settings still allowed data to leak into
the .viminfo file
For Linux even the matching path was wrong which means that the
(insufficient) rules were not even used.
RELEASE_NOTES=[DOCUMENTATION] fix in recommended vim setting
Signed-off-by: Stefan Gehr <stefangehr@protonmail.com>
Signed-off-by: Stefan Gehr <stefangehr@protonmail.com>
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>
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>
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>
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>
Fixes#1602Fixes#1614Fixes#1600Fixes#1594Fixes#1601Fixes#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>
This commit adds a new debug package to gopass.
It is heavily inspired by github.com/restic/restic/internal/debug
and adapted for the gopass use case.
This change allows to further trim down the source code since the
new package doesn't propagate the debug flag in the context anymore.
As such we can now omit passing ctx in most places.
In order to ensure we don't accidentially keep passing ununsed
parameters we also introduce unparam to check for extra arguments.
RELEASE_NOTES=[ENHANCEMENT] New Debug package
Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
This commit contains the initial draft of the gopass API.
Design and implementation of the API are work in progress - even after
this PR has been merged. Feedback welcome but please use with caution.
Expect breaking changes to the API. Especially once we redesign the
secrets implementation.
Fixes#1379
RELEASE_NOTES=[ENHANCEMENT] Add gopass API (unstable)
Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>