* [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>
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#1567Fixes#1764Fixes#1819Fixes#1878Fixes#2387Fixes#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>
* 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>
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>
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>
Fixes#788Fixes#1575Fixes#1574Fixes#1573Fixes#1570Fixes#1592
RELEASE_NOTES=[BUGFIX] Correcting newlines handling
RELEASE_NOTES=[BUGFIX] Show now correctly handles -C and -u together
RELEASE_NOTES=[BUGFIX] Insert is now parsing its stdin input
This is trying to correct the way we display and write newlines.
Newlines are appended by the MIME type after the header but won't be
displayed by show now unless the MIME body is non-empty.
Notice the `mime` setting is significantly changing the way secrets are
handled, written and displayed, also how the newlines are treated.
I've tried to add tests to take this into account.
I've also added unit tests and integration tests accordingly to try and
detect such regressions in the future.
This is changing the behaviour of insert to make it compatible with the new MIME format
This is also refactoring the code a bit, removing dead code such as the
YAML special handling.
Signed-off-by: Yolan Romailler <yolan@romailler.ch>
This commit introduces a new MIME-based secrets format that will
eventually replace any existing secret format.
Fixes#1310
RELEASE_NOTES=[BREAKING] New secrets format.
Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
aka unpopular opinions.
This commit removes a lot of weight and legacy as well as some features.
This wil break some exotic use cases which is regretable, but it is
inevitable and important to clean up these bad past design choices.
It removes some configuration options but most importantly it does
revert the decision to introduce an awkward custom backend URL
schema. This is an important step in the direction of zero configuration
and convention over configuration.
Fixes#569Fixes#1225
RELEASE_NOTES=[DEPRECATION] Remove askformore, autosync,
check_recipient_hash and concurrency options.
Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
* 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>
* 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>
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>
* Fixes#667 and correct a few details
This primarily adds the config option requested in #667.
I've added back the notion or erroring in case of a show action on an
entry with only a password and the safe content option enabled
Also I've fixed the way the String() function of the StoreConfig forgot
to display the Notification value in its output.
* Adding tests for autoclip
* adding a clip flag back
* correcting an old copy-paste mistake
* trying to correct the problem
* Correcting the error caused by #701
* Addressing #684
Adapting the integration tests accordingly.
Also adding an integration test to avoid conflict between safecontent and -c in
the show action.
* Adding real unit tests
* Removing all direct color uses
Since we have a package out to handle the output and the formatting and
coloring, there is no reason to directly use the color package.
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
* Adding unit tests for new feature
* Adding a setting to avoid showing password
By default, especially when usernames or comments in password entry are
useful, it may be dangerous to display the password on the terminal.
This commit add a setting to handle this, as well as a way to force
current behaviour.
The default behaviour is changed to this more sane and secure way.
Unit tests for the feature are passing.
* Adding config unit test
To check that the configuration is handled correctly.
* Adding QRcode Show test
* Reverting back default behaviour to pass one
And adding a readme entry in the Show section.