28 Commits

Author SHA1 Message Date
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
Ludovic Fernandez
b8f0ff8ff2
[chore]: linting (#2840)
Signed-off-by: Fernandez Ludovic <ldez@users.noreply.github.com>
2024-03-25 19:32:57 +01:00
Yolan Romailler
2268d7d13d
[n/a] Patching our Linter GHA (#2801)
Signed-off-by: Yolan Romailler <anomalroil@users.noreply.github.com>
2024-02-14 11:43:10 +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
5f18942781
[BUGFIX] Try to always honor local config for mounts (#2724)
* [BUGFIX] Try to always honor local config for mounts

Signed-off-by: Yolan Romailler <anomalroil@users.noreply.github.com>

* [BUGFIX] Better propagate mount to config

Signed-off-by: Yolan Romailler <anomalroil@users.noreply.github.com>

* [n/a] CR nit fix

Signed-off-by: Yolan Romailler <anomalroil@users.noreply.github.com>

---------

Signed-off-by: Yolan Romailler <anomalroil@users.noreply.github.com>
2023-11-25 17:48:37 +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
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
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
Dominik Schulz
0d07b0908b
Deduplicate key selection (#1868)
RELEASE_NOTES=n/a

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2021-03-24 21:14:19 +01:00
Dominik Schulz
d00c29a0e8
Add -f flag to gopass create (#1867)
This new flag allows overriding the default secret name
computation with a custom secret name passed as the first
argument.

Fixes #1811

RELEASE_NOTES=[ENHANCEMENT] Add -f flag to create

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2021-03-22 20:35:29 +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
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
ddfe7bfc97
Remove final references to internal packages (#1709)
RELEASE_NOTES=n/a

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2021-01-14 09:15:29 +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
Yolan Romailler
333a76a06b
Patch pw prompt on Windows (#1632)
Fixes #1333

RELEASE_NOTES=[BUGFIX] Password insert prompt now works on Windows but
stil not in Git Bash. Only CMD and Powershell.

Signed-off-by: Yolan Romailler <yolan@romailler.ch>
2020-10-30 19:49:05 +01:00
Feresey
4087ff8c02
Fix nil error panic (#1604)
RELEASE_NOTES=[BUGFIX] Nil dereference in cui

Signed-off-by: Feresey <p.milko1999@yandex.ru>
2020-10-01 19:55:07 +02:00
Dominik Schulz
794feb0d42
Remove config option confirm (#1512)
Fixes #1503

RELEASE_NOTES=[CLEANUP] Remove config option confirm

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2020-08-13 08:33:39 +02:00
Dominik Schulz
3a6810baef
Retire editrecipients config option (#1492)
Fixes #1487

RELEASE_NOTES=[DEPRECATION] Retire editrecipients option

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2020-08-11 07:34:30 +02:00
Dominik Schulz
d6c62d869e
Add more tests and subtests (#1418)
RELEASE_NOTES=n/a

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2020-06-13 23:08:07 +02:00
Dominik Schulz
a6a34b46a4
Do not fail if crypto is nil (#1408)
Fixes #1407

RELEASE_NOTES=n/a

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2020-06-01 22:27:54 +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
0549c36ab0
Cleanup config (#1391)
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 #569
Fixes #1225

RELEASE_NOTES=[DEPRECATION] Remove askformore, autosync,
check_recipient_hash and concurrency options.

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2020-05-28 22:35:30 +02:00
Dominik Schulz
264d139fe5
Add initial draft of the gopass API (#1385)
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>
2020-05-24 21:03:54 +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