51 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
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
GLoby
c32ec32a52
[TESTING/CLEANUP] Replace deprecated tenv linter for usetesting (#3087)
* [CLEANUP] Comply to linters about blank lines

Signed-off-by: Ilya Eryomenko <ilya@eryomenko.com>

* [TESTING] Replace tenv linter with usetesting as it's deprecated

Signed-off-by: Ilya Eryomenko <ilya@eryomenko.com>

* [TESTING] Replace os.MkdirTemp with t.TempDir for improved test isolation and comply with usetesting linter

Signed-off-by: Ilya Eryomenko <ilya@eryomenko.com>

* [TESTING] Ensure temporary directories are not empty in tests

Signed-off-by: Ilya Eryomenko <ilya@eryomenko.com>

---------

Signed-off-by: Ilya Eryomenko <ilya@eryomenko.com>
2025-03-14 13:22:36 +01:00
Dominik Schulz
9b72a1c76c
Improve test coverage (#3077)
* [chore] Add more tests

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

* [fix] Fix most tests

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

* [fix] Fix remaining tests

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

* [fix] Fix lint issues.

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

* [fix] Fix more lint issues.

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

* [fix] Fix more lint issues.

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

* [fix] Fix the final lint issue.

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

---------

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2025-03-04 13:01:01 +01:00
Dominik Schulz
01b6ff1dde
Roll over self-updater key for 2025 (#3048)
* chore: Update release signing key
* fix: Fix signature verification test and update docs. Should be good now.
* fix: Fix some typos
* Remove the expired key

---------

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2025-02-13 15:52:25 +01:00
Alexander D. Kanevskiy
6ecca43a2f
[BUGFIX]: Respect HTTP proxy environment variables in downloader (#2978)
`gopass update` fails on the hosts behind HTTP proxies and without direct
Internet connectivity. Fix is setting up proxy from environment variables
similarly to default golang HTTP client.

Signed-off-by: Alexander D. Kanevskiy <kad@kad.name>
2024-10-24 20:11:04 -07:00
Dominik Schulz
d6669e15e5
chore: Switch to static list of linters (#2882)
* chore: Switch to static list of linters

The old approach was prone to random CI failures when a golangci-lint
was updated and did enable new linters. This approach means we will have
to update the include list from time to time but won't get random CI
failures.

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

* fix: Update enabled linters to be compatible with GHA

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

---------

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2024-06-10 13:54:49 +02:00
Mikel Olasagasti Uranga
68c930c0b1
[chore] Update dependency to github.com/cenkalti/backoff/v4 (#2864)
Signed-off-by: Mikel Olasagasti Uranga <mikel@olasagasti.info>
2024-04-10 21:11:07 +02: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
guangwu
acc80494c9
chore: remove refs to deprecated io/ioutil (#2609)
Signed-off-by: guoguangwu <guoguangwu@magic-shield.com>
2023-07-29 01:08:46 +02:00
Dominik Schulz
4b7be8f212
Fix tests and roll over updater key (#2532)
Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2023-02-05 12:24:03 +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
31630220d6
Introduce config option to disable update checks (#2436)
RELEASE_NOTES=n/a

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

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2022-12-03 22:28:11 +01:00
Eng Zer Jun
d2f64457fb
test: use T.TempDir to create temporary test directory (#2377)
This commit replaces `os.MkdirTemp` with `t.TempDir` in tests. The
directory created by `t.TempDir` is automatically removed when the test
and all its subtests complete.

Prior to this commit, temporary directory created using `os.MkdirTemp`
needs to be removed manually by calling `os.RemoveAll`, which is omitted
in some tests. The error handling boilerplate e.g.
	defer func() {
		if err := os.RemoveAll(dir); err != nil {
			t.Fatal(err)
		}
	}
is also tedious, but `t.TempDir` handles this for us nicely.

Reference: https://pkg.go.dev/testing#T.TempDir
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2022-10-04 21:14:46 +02:00
Dominik Schulz
7962f08c92
Allow updating gopass.exe on Windows (#2345)
Windows will lock files being executed but we should be able to rename
them.

Fixes #2011

RELEASE_NOTES=[BUGFIX] Fix updater on Windows.

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

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2022-09-20 21:56:42 +02:00
Dominik Schulz
4dfb6492d8
Update deps. Bump to Go 1.19 (#2296)
RELEASE_NOTES=[CLEANUP] Use Go 1.19

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2022-08-02 21:41:43 +02:00
Yolan Romailler
22bae0d5a9
Migrating to ProtonMail/openpgp (#2193)
RELEASE_NOTES=[CLEANUP] Migrating to a maintained version of openpgp

Fixes #2192

Signed-off-by: Yolan Romailler <anomalroil@users.noreply.github.com>
2022-04-20 22:28:28 +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
5eceae1f86
Try gocritic (#2169)
RELEASE_NOTES=n/a

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2022-03-17 21:07:55 +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
9c3e8ffa7c
Enforce TLSv1.3 for outgoing HTTPS connections (#2085)
RELEASE_NOTES=[ENHANCEMENT] Enforce TLSv1.3
2022-01-03 20:31:47 +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
13b6c18fe6
Fix fsutil.Shred and other cleanup (#2063)
RELEASE_NOTES=n/a

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2021-12-22 19:05:24 +01: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
01017f8582
Fix gopass update writable check (#1838)
Fixes #1837

RELEASE_NOTES=[BUGFIX] Fix gopass update

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2021-03-17 19:32:35 +01:00
Dominik Schulz
73ed2c189e
Upgrade to Go 1.16 (#1803)
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>
2021-02-17 21:39:07 +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
77343a2d01
Log keyring (#1786)
RELEASE_NOTES=n/a

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2021-02-11 19:50:51 +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
Dominik Schulz
74ea14c323
Remove colored output (#1743)
This confuses some terminals.

Also: fix setup.go condition and validate git setup.

Fixes #1464
Fixes #1467

RELEASE_NOTES=n/a

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2021-01-21 10:32:25 +01:00
Dominik Schulz
d83f943317
Add release helper (#1740)
This PR adds a small release helper along with some documentation.
This should allow anyone with sufficient permissions to cut and push new
releases.

Fixes #1298

RELEASE_NOTES=n/a

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2021-01-21 00:24:07 +01:00
Dominik Schulz
1327ec1e78
Use RSA release signing key (#1735)
ECC has compatability issues so falling back to a plain old RSA key for
automatic release signing.

RELEASE_NOTES=n/a

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2021-01-20 10:44:26 +01:00
Dominik Schulz
fc30b21501
Release signing (#1733)
RELEASE_NOTES=n/a

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2021-01-19 22:43:00 +01:00
Dominik Schulz
78aaad1f5c
Add windows support to the self updater (#1724)
Fixes #1722

RELEASE_NOTES=[ENHANCEMENT] Add windows support to the self updater

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2021-01-18 22:17:31 +01:00
Dominik Schulz
87fb1843fa
Implement signature verification for self updater (#1717)
Fixes #1676

RELEASE_NOTES=[BUGFIX] Add signature verification for updater

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2021-01-18 13:44:42 +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
ff349772ac
Reduce dependencies on internal packages (#1707)
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>
2021-01-13 18:21:09 +01:00
Dominik Schulz
6fae0c29bc
Disable gopass update (#1679)
The updater is insecure since it doesn't check signature of downloaded
binaries (which aren't signed at the moment). It shouldn't be used this
way to the quickest fix is to disable it for the time being.

RELEASE_NOTES=[BUGFIX] Disable gopass update

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2021-01-03 20:40:45 +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
745200baf8
Add custom branded progress bar (#1422)
RELEASE_NOTES=[ENHANCEMENT] New progress bar

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2020-06-16 23:29:11 +02:00
Dominik Schulz
3e09c868e3
Increase test coverage (#1412)
RELEASE_NOTES=n/a

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2020-06-04 22:31:14 +02:00
Dominik Schulz
e623b38665
Cleanup interfaces (#1401)
RELEASE_NOTES=n/a

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2020-05-31 09:52:17 +02:00
Dominik Schulz
0cfa536d28
Add debug package (#1396)
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>
2020-05-29 13:47:35 +02:00
Dominik Schulz
970749a4af
Add two step updates for major version updates (#1378)
RELEASE_NOTES=n/a

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2020-05-22 21:04:17 +02: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