37 Commits

Author SHA1 Message Date
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
Parham Alvani
46dfddaef0
Handle referencing in passwords (#3163)
* feat: handle referencing in passwords

Signed-off-by: Parham Alvani <parham.alvani@gmail.com>

* feat: use seq over slice to improve performance

Signed-off-by: Parham Alvani <parham.alvani@gmail.com>

* feat: handle error during reference following

Signed-off-by: Parham Alvani <parham.alvani@gmail.com>

* feat: provide a flag for not following references

Signed-off-by: Parham Alvani <parham.alvani@gmail.com>

* feat: disable ref following on edit and remove the flag

Signed-off-by: Parham Alvani <parham.alvani@gmail.com>

* feat: provide a configuration for follow-references

Signed-off-by: Parham Alvani <parham.alvani@gmail.com>

* fix: correct configuration tests

Signed-off-by: Parham Alvani <parham.alvani@gmail.com>

* fix: correct tests and document the new flag

Signed-off-by: Parham Alvani <parham.alvani@gmail.com>

* fix: correct integration test

Signed-off-by: Parham Alvani <parham.alvani@gmail.com>

* fix: correct tests

Signed-off-by: Parham Alvani <parham.alvani@gmail.com>

---------

Signed-off-by: Parham Alvani <parham.alvani@gmail.com>
2025-05-28 18:10:54 +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
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
bc658d5d2b
Use custom multi error type for fsck instead of string concat (#2505)
* Use custom multi error type for fsck instead of string concat

RELEASE_NOTES=n/a

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

* Fix lint issues

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

* Address comments

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

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2023-01-04 15:03:17 +01:00
niacdoial
cdda40db36
Improve fsck handling and output (#2492)
* Fsck: Improved message handling and decreased commit spam.

* Merge upstream changes with local changes (part 2: manual fixes)

* pgp keyring: Do not import a pgp public key into the user's private keyring if the key there is identical to the one in the store's keyring

* fsck.go: made the code more go-idiomatic

* more changes to make code more go-idiomatic

* Fsck: fixed misleading messages caused by previous refactor

(also clarified the roles of the values in ErrorSeverity)

* Fsck: even smoother git use (pubkey updates now in the same git commit as the rest of fsck's changes)

Also removed dupeicate check of public keys, and added more tests around commit messages

* Ctxutil: Pruning unused functions, more go idiomaticity (and some tweaks regarding errors)

* Formatted files with gofmt

* fixed misc. error management

* More fixes and formatting

(plus one fixed text for the `link` action)

* unblock CI (attempt 1)

* fix problems discovered by CI

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
Co-authored-by: Dominik Schulz <dominik.schulz@gauner.org>
2023-01-01 14:52:55 +01:00
Dominik Schulz
d9199cd9c2
Incorporate cleanup and simplifications ideas from kpitt/gopass (#2468)
* Improve test isolation

These test shouldn't pick up user configs.

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

* Use correct flag names for rcs init test

These flags must use the canonical names since they are not processed
by the CLI library and as such aliases are not applied.

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

* Remove obsolete warning in fsck help

The default format should be fully compatible with other
password store implementations.

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

* Remove unused "Verbose" context property

This was never set anywhere, so we can safely remove it.

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

* Remove --clip option for the find command

When this is invoked as `gopass find` there is actually no
code path that leads to this flag being used.

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

* Remove mount versions from the `version` command

The `version` command should generally only print the version and not
load the full config, trigger auto-sync and other operations the
happend when initializing the mounts.

Moving the mount point information to the new `mounts versions` command.

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

* Update find integration test

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

* Do not run auto-sync if the command is `sync`

Otherwise sync might run twice.

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

* Reset auto-sync if a full `sync` succeeds

Since a `gopass sync` without the `--store` option is the same
operation as an auto-sync we should reset the interval if it
was successfull.

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

* Remove sync messages about importing and exporting keys

These usually don't take a lot of time and don't need a mention unless
they fail.

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

* Refactor OTP action to reduce code complexity and duplication

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

* Clean up outdated Git documentation

`gopass` isn't configuring `git` to sign commits anymore.

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

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2022-12-11 23:08:46 +01:00
Dominik Schulz
18ffee354f
Add .gitconfig parser (#2395)
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 #1567
Fixes #1764
Fixes #1819
Fixes #1878
Fixes #2387
Fixes #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>
2022-11-25 10:50:34 +01:00
Faye Duxovni
d068995d38
Purge incorrect passwords from age's askpass cache (#2314)
Signed-off-by: Faye Duxovni <duxovni@duxovni.org>

Signed-off-by: Faye Duxovni <duxovni@duxovni.org>
2022-09-03 11:19:50 +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
0eff31a8ce
Enable additional golangci-lint godot checks (#2077) 2021-12-29 22:47:53 +01:00
Dominik Schulz
1131dbf5fb
Remove GOPASS_NOCOLOR (#1937)
Fixes #1936

RELEASE_NOTES=[CLEANUP] Remove GOPASS_NOCOLOR in favor of NO_COLOR

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2021-08-05 22:33:31 +02:00
Dominik Schulz
877c3d8f19
Remove useless uses of ctxutil (#1806)
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>
2021-02-25 16:09:52 +01:00
Dominik Schulz
a527a9ab0b
Confirm passphrase when saving age keyring (#1747)
RELEASE_NOTES=[ENHANCEMENT] Confirm new age keyring passphrases

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2021-01-25 22:10:23 +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
Yolan Romailler
fb2553bba0
Disable input parsing (#1681)
Fixes #1602
Fixes #1614
Fixes #1600
Fixes #1594
Fixes #1601
Fixes #1650

RELEASE_NOTES=[BUGFIX] Disabling all kind of parsing of the input
RELEASE_NOTES=[ENHANCEMENT] Adding the flag show -n to disable output parsing
RELEASE_NOTES=[ENHANCEMENT] Adding the option parsing to disable all parsing

Signed-off-by: Yolan Romailler <yolan@romailler.ch>
2021-01-07 21:53:06 +01:00
Dominik Schulz
3b76f24218
Set author date on git commit (#1519)
RELEASE_NOTES=n/a

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2020-08-14 18:18:19 +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
59076facd0
Use the new Age API (#1439)
This migrates from calling age as an external binary to using
age as a library using it's new API.

The implementation is still ugly, hacky and likely buggy.
But it should be as secure as age and provides a nice proof
of concept. It also has an encrypted keyring and when using
the (highly experimental) ondisk backend it's possible to
have an fully encrypted store without any external dependencies.

RELEASE_NOTES=n/a

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2020-06-29 22:34:20 +02:00
Dominik Schulz
6c53574275
Add more tests (#1410)
RELEASE_NOTES=n/a

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2020-06-03 20:35:27 +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
c2448abbf3
Remove autoprint (#1386)
This config option conflicts with autoclip.

RELEASE_NOTES=[DEPRECATION] Remove AutoPrint

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2020-05-25 21:17:53 +02:00
Dominik Schulz
5a61e331bd
Replace sub.WithReason with ctxutil.WithCommitMessage (#1372)
RELEASE_NOTES=n/a

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2020-05-18 21:22:06 +02:00
Dominik Schulz
e6beee928d
Add experimental ondisk storage and rcs backend (#1366)
RELEASE_NOTES=n/a

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2020-05-17 22:45:46 +02:00
Dominik Schulz
b11c3688d8
Refactor command setup (#1299)
This commit refactors the configuration of the gopass subcommands in
order to simplify further change to the command structure.

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2020-04-29 10:03:11 +02:00
Dominik Schulz
f150ff277f
Allow creating secrets matching existing folders with --force (#1154)
Fixes #1149

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2019-07-26 10:39:38 +02:00
Dominik Schulz
db722a047d
Avoid unrelated git histories (#1084)
Fixes #1082

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2019-03-03 11:57:10 +01:00
Dominik Schulz
dcee623d7a
Add AutoPrint option (#1065)
Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2019-02-10 22:20:07 +01:00
Dominik Schulz
cd157a0f46
Introduce build tags (#1000)
Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2018-12-26 12:58:36 +01:00
Chris Bargmann
c0a7820021 Comment spelling in ctxutil.go (#878)
To be honest, this PR does not improve functionality.
I changed some comments from german "explizit" to english "explicit".

That's it! :-)
2018-06-28 07:25:59 +02:00
Dominik Schulz
d0f56ae6eb
Improve fsck output (#859)
Fixes #858

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2018-06-08 17:14:56 +02:00
Yolan Romailler
6e35952324 Adding concurrency for reencrypt (#475)
* Adding concurrency on reencrypt

* Adding tests for the new concurrency setting
2018-05-24 15:01:49 +02:00
Dominik Schulz
da436e6a79
Refactor and cleanup codebase (#715) 2018-03-16 14:22:47 +01:00