39 Commits

Author SHA1 Message Date
Dominik Schulz
71861e4a8b
chore: Update golangci-lint (#3287)
Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2025-11-12 21:09:26 +01:00
google-labs-jules[bot]
86720090b6
docs: Add GoDoc to pkg and improve markdown files (#3251)
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>
2025-09-22 19:37:15 +02:00
Dominik Schulz
c5f25acdfc
[chore] Move gitconfig to their own repo (#3131)
This commit finalizes the move of the gitconfig pkg to a
separate repo.

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2025-04-19 21:37:38 +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
AnomalRoil
4c2caf3e9b
[FEATURE] Allow for non-interactive age setup (#2970)
* [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>
2024-10-14 19:32:26 +02:00
Dominik Schulz
78e7d8e4ee
[bugfix] Fix loading of git configs (#2849)
* [bugfix] Fix loading of git configs

The gitconfig package was incorrectly using gopass specific
locations when trying to load global (per user) git configs.

This change makes it use the correct locations.

Fixes #2686

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

* Fix typo

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

* Fix linter issues

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

* Fix failing tests

Those started to fail because we are now correctly reading
global git configs.

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

---------

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2024-03-29 15:29:51 +01:00
Ludovic Fernandez
b8f0ff8ff2
[chore]: linting (#2840)
Signed-off-by: Fernandez Ludovic <ldez@users.noreply.github.com>
2024-03-25 19:32:57 +01:00
Dominik Schulz
263b78119b
[bugfix] Fix writes to global config from tests (#2727)
* [bugfix] Fix writes to global config from tests

Fixes #2725

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

* Shorten readonly config creation.

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

* Address review comments

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

---------

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2023-12-01 14:04:17 +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
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
bd59fba0da
Use git identity when pre-populating git config (#2442)
Fixes #968

RELEASE_NOTES=[ENHANCEMENT] Pre-populate ID with git values

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2022-12-04 17:55:06 +01:00
Dominik Schulz
670b772350
Fix new lint issues (#2378)
RELEASE_NOTES=n/a

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

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2022-10-04 22:17:54 +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
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
0eff31a8ce
Enable additional golangci-lint godot checks (#2077) 2021-12-29 22:47:53 +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
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
defhacks
555edfb4d3
RELEASE_NOTES=[BUGFIX] Fixing progress bar to handle zero properly (#2048)
Signed-off-by: Michael Coulter <hacks@bitz.ca>
2021-11-26 20:45:44 +01:00
Faye Duxovni
efa78b2645
Move prompts and progress bars to stderr rather than stdout (#2004)
Having password prompts/etc on stdout is inconvenient in any context where the output is being piped to something other than a terminal.  This change makes gopass more scripting-friendly, especially when using the age backend.  It also removes a redundant password prompt message when the age backend asks for a password, since pinentry will display its own password prompt immediately afterward.

RELEASE_NOTES=[ENHANCEMENT] Move password prompts to stderr

Signed-off-by: Faye Duxovni <duxovni@duxovni.org>
2021-10-08 14:18:31 +02:00
Faye Duxovni
566d227123
Don't prompt to retype password unnecessarily with age backend (#1983)
When gopass can't find a pinentry binary to use for prompting for a
password to unlock an age keyring, it uses its own barebones fallback
pinentry mechanism to prompt for a password in the terminal.  This
fallback pinentry always asked the user to retype their password and
required the password match, even when decrypting a file using an
already-existing password.  I've updated it to only prompt for a repeat
when necessary, and also made the password prompte messages less
awkward.

RELEASE_NOTES=[BUGFIX] Don't prompt to retype password unnecessarily
with age backend when pinentry binary is unavailable.

Signed-off-by: Faye Duxovni <duxovni@duxovni.org>
2021-09-12 13:35:02 +02:00
Dominik Schulz
8586105f27
Update deps (#1981)
RELEASE_NOTES=n/a

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2021-08-28 16:01:27 +02:00
Dominik Schulz
906557c145
Add bytes option to the progress bar (#1958)
This commit adds the option to format the progress bar numbers as human
readable bytes.

RELEASE_NOTES=n/a

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2021-07-04 13:14:17 +02:00
Dominik Schulz
a259c18510
Ensure 8-byte alignment of progressbar counters (#1855)
Fixes #1854

RELEASE_NOTES=[BUGFIX] Fix progress bar on 32 bit archs

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2021-03-20 07:32:20 +01:00
Dominik Schulz
49ad0eef19
Honor Ctrl+C while waiting for user input (#1805)
Fixes #1800

RELEASE_NOTES=[BUGFIX] Honor Ctrl+C while waiting for user input

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2021-02-22 11:03:06 +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
ce8498cd98
Enable updater for windows (#1790)
Fixes #1789

RELEASE_NOTES=[BUGFIX] Enable updater on Windows
RELEASE_NOTES=[BUGFIX] Fix progress bar nil pointer access

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2021-02-15 13:26:32 +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
327d4b9302
Do not exit on non-empty second pw (#1719)
RELEASE_NOTES=[BUGFIX] The empty password must now be confirmed too

Fixes #1718

Signed-off-by: Yolan Romailler <yolan@romailler.ch>
2021-01-17 16:45:20 +01:00
Dominik Schulz
a0f6005276
Remove references to internal packages (#1708)
This should cut all remaining ties and allow binaries in cmd/ to be
moved out.

RELEASE_NOTES=n/a

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2021-01-14 07:59:36 +01:00
Dominik Schulz
55ad6bd394
Reduce usage of internal packages in non-core binaries (#1677)
This commit reduces the usage of internal/ packages in auxiliary
binaries so we can get closer to eventually moving them to their own
repos.

RELEASE_NOTES=n/a

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2021-01-02 16:31:41 +01:00
Dominik Schulz
d0be4054ca
Unexport more internal packages (#1377)
RELEASE_NOTES=n/a

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2020-05-22 18:26:01 +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
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
Dominik Schulz
330d23da28
Redirect errors to stderr (#880)
Fixes #877

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2018-06-28 21:24:43 +02:00
Dominik Schulz
ba281c4942 Rewrite imports paths 2018-05-28 15:51:21 +02:00
Dominik Schulz
5bd26fb8a5
Add local recipient intregrity checking (#800)
Related to #305 and #413
2018-05-24 17:11:55 +02:00
Christian Muehlhaeuser
753045fc66 Follow import ordering & grouping conventions (#762)
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.
2018-05-05 09:40:02 +02:00
Dominik Schulz
6ef61ae548
Improve test coverage (#732) 2018-03-28 12:06:58 +02:00
Dominik Schulz
da436e6a79
Refactor and cleanup codebase (#715) 2018-03-16 14:22:47 +01:00