This change adds GoDoc comments to many of the public symbols in the
`pkg/` directory. It also includes various improvements to the
documentation in `README.md` and other markdown files in the `docs/`
directory.
This is a partial documentation effort, as requested by the user, to
get a pull request submitted quickly.
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
This reverts commit a828cada8f19e946d7db785dd0abfd74caf06a82.
The change of mime-type (away from text/plain) of the clipped text that
this causes is problematic, and is not yet supported everywhere. A
change like this needs to be tested more thoroughly. See:
https://github.com/gopasspw/gopass/issues/3233
Signed-off-by: Daniel Lublin <daniel@lublin.se>
* [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>
* [FEATURE] Allow for non-interactive age setup
Also updates Go to Go 1.23.2 and get rid of min and max functions
Signed-off-by: Yolan Romailler <AnomalRoil@users.noreply.github.com>
* [n/a] also renaming clear for Windows
Signed-off-by: Yolan Romailler <AnomalRoil@users.noreply.github.com>
* [n/a] bumping our GHA to Go 1.23
Signed-off-by: Yolan Romailler <AnomalRoil@users.noreply.github.com>
* [n/a] make our harden runner softer
Signed-off-by: Yolan Romailler <AnomalRoil@users.noreply.github.com>
* [n/a] make our harden runner accept go.dev
Signed-off-by: Yolan Romailler <AnomalRoil@users.noreply.github.com>
* [n/a] applying code review changes
Signed-off-by: Yolan Romailler <AnomalRoil@users.noreply.github.com>
---------
Signed-off-by: Yolan Romailler <AnomalRoil@users.noreply.github.com>
* [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 finally incorporates the changes suggested by rianadon in
Additionally it switches the unclip checksum from SHA256 to Argon2id.
Although the risk is close to zero (i.e. if someone can access our
process env we're doomed anyway) but there is just no reason to not
do it properly.
RELEASE_NOTES=[ENHANCEMENT] Hide password on MacOS clipboards
Fixes#1816
Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
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>
This is useful for packaging gopass on some platforms and
a no-op on others.
RELEASE_NOTES=n/a
Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
This is a minor cleanup that removes some useless use of ctxutil.
The goal of this series of commits is to reduce amount and
complexity of the code, not features or bugfixes.
RELEASE_NOTES=n/a
Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
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>
* 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>
On Fedora 31, `gopass unclip` fails with a "Failed to clear clipboard history"
notification. This is because DBus returns the following error message as
`klipper` is not available:
```
The name is not activatable
```
This commit adds this error message to the strings being ignored.
Fixes#1209
Signed-off-by: Simon Krenger <skrenger@redhat.com>
* clipboard: fix typo to notification title
Signed-off-by: Simon Latapie <garf1242@gmail.com>
* clipboard: add some notifications in case of password copy
Signed-off-by: Simon Latapie <garf1242@gmail.com>
* show: notify errors only in case of clipping
Notify errors if the show command has been requested with the clip
option. In the other cases, we may not want to be notified (error
printing may be sufficient).
Signed-off-by: Simon Latapie <garf1242@gmail.com>
The previous method was poorly optimized. This commit comes with a speedup
on the order of two magnitudes.
goos: linux
goarch: amd64
pkg: github.com/gopasspw/gopass/pkg/clipboard
BenchmarkWalkProc-8 1 1265002845 ns/op
BenchmarkListProc-8 100 17014944 ns/op
PASS
ok github.com/gopasspw/gopass/pkg/clipboard 4.397s
Fixes#923
Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
Grouped in the following order:
1. Packages from the std library
2. golang.org imports
3. github.com/justwatchcom/gopass packages
4. External dependencies
Sorted by gofmt.