32 Commits

Author SHA1 Message Date
Dominik Schulz
792f8b07e2
[chore] Initial fixes and added a warning for CryptFS and JJFS (#3270)
These backends are not ready, yet.

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2025-11-12 21:04:55 +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
google-labs-jules[bot]
c0f278095a
feat: Clone remote on init (#3247)
* feat: Clone remote on init

When a remote is provided to the init command, try to clone it first.
If the cloned repository is not empty, use it as the password store.
Otherwise, initialize a new password store.

* feat: Clone remote on setup

When a remote is provided to the setup command, try to clone it first.
If the cloned repository is not empty, use it as the password store.
Otherwise, initialize a new password store.

* [fix] Remove init during clone

When we clone a repo we never want to initialize it automatically.

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

---------

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Co-authored-by: Dominik Schulz <dominik.schulz@gauner.org>
2025-09-22 18:21:16 +02:00
google-labs-jules[bot]
65b7b1cb95
Fix(store): Honor nested .gpg-id files on key cleanup (#3207)
When cleaning up the public keys in the .public-keys directory, we were
previously only considering the top-level .gpg-id file. This could lead
to the removal of public keys that were still in use in sub-stores.

This commit fixes this by changing the `idFiles` function to correctly
find all .gpg-id files in the store, including nested ones.

It also introduces a new `AllRecipients` function that gathers all
recipients from the main store and all sub-stores by using the corrected
`idFiles` logic.

The `UpdateExportedPublicKeys` function is refactored to use
`AllRecipients` to get the complete list of recipients, removing the need
to pass them as an argument. All call sites of `UpdateExportedPublicKeys`
are updated accordingly.

Finally, the logic for finding extra keys to remove is extracted into a
standalone `extraKeys` function, and a new unit test `TestExtraKeys` is
added to verify its behavior.

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
2025-09-13 20:30:33 +02:00
Dominik Schulz
1e05f6a618
[chore] Move set from internal to pkg (#3129)
Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2025-04-19 20:29:24 +02:00
Willem
b6140bcba0
[BUGFIX] Check if any usable key matches on clone (#3027)
This commit changes the check whether we have access to the cloned
repository from checking whether *all* of our usable keys are included
to whether *any* of our usable keys are included.

Signed-off-by: Willem Mulder <willemmaster@hotmail.com>
2025-01-08 16:47:21 +01:00
Dominik Schulz
02f9b17ce8
Reduce dependencies on stringset (#2450)
See #2441

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

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2022-12-07 09:08:22 +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
Dominik Schulz
453e106686
Clean up exported public keys if a recipient is removed (#2328)
Fixes #2315

RELEASE_NOTES=[BUGFIX] Remove exported public keys of removed
recipients.

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

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2022-09-07 12:24:43 +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
c47cb8fd72
Automatically export creators key to the store (#2159)
* Automatically export creators key to the store

Fixes #1919

RELEASE_NOTES=[ENHANCEMENT] Automatically export creators key to the
store.

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

* Fix config tests

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2022-03-16 15:37:09 +01:00
Dominik Schulz
f2cac9f3b3
Refactor action.ExitError into its own package (#2114)
RELEASE_NOTES=n/a

Fixes #2107

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2022-01-16 14:34:12 +01:00
Dominik Schulz
61c2e438ac
Support cloning Fossil repos (#2096)
This commit adds rudimentary support for cloning Fossil repositories.
It also adds auto-generation of new encryption keys on clone, in case
none are present.

RELEASE_NOTES=n/a

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2022-01-11 20:41:45 +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
de9f3a38a5
Add getting started docs (#1865)
This commit adds a getting started section to the readme and improves
the gopass clone UX a little it. It also fixes the call depth for nested
debug.Log invocations (e.g. during ExitError) and adds debug logging
for every out invocation.

Fixes #1839

RELEASE_NOTES=n/a

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2021-03-24 21:13:44 +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
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
8525a071d1
Sync and fix out of sync flags (#1727)
Some flags were not in sync with their definition. Fix this.

RELEASE_NOTES=n/a

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2021-01-19 10:37:29 +01:00
Dominik Schulz
2d1b87514c
UX update (#1715)
Streamline command output, add unicode icons and ask for passphrase
during onboarding.

Fixes #1698

RELEASE_NOTES=[ENHANCEMENT] UTF-8 emojis
RELEASE_NOTES=[BUGFIX] Ask passphrase upon key generation


Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2021-01-18 13:54:49 +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
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
5f4f645e18
Fix some regressions (#1463)
Fixes #1460
Fixes #1462

This commit fixes broken shadowing in the new tree implementation
as well as removing the broken init flag to mounts add.

RELEASE_NOTES=[BUGFIX] Fix tree shadowing.

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2020-07-20 23:00:25 +02:00
Dominik Schulz
4d75c3cb47
Merge Storage and RCS backends into the Storage backend (#1455)
Fixes #1454
Fixes #1457

RELEASE_NOTES=[CLEANUP] Merge Storage and RCS backends

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2020-07-19 21:32:53 +02:00
Dominik Schulz
0ecb71877d
Print RCS error message (#1452)
Fixes #1119

RELEASE_NOTES=[BUGFIX] Print RCS error message

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2020-07-17 20:47:33 +02:00
Dominik Schulz
b2ac17677d
Increase test coverage (#1413)
RELEASE_NOTES=n/a

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2020-06-05 21:50:35 +02:00
Dominik Schulz
55082027e6
Properly initialize crypto during onboarding (#1411)
Fixes #1409
Fixes #1220

RELEASE_NOTES=[BUGFIX] Properly initialize crypto during onboarding and
clone

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2020-06-03 23:31:25 +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
5977752c7c
Unexport more internal packages (#1380)
RELEASE_NOTES=n/a

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2020-05-22 21:38:08 +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
Dominik Schulz
09c9031fb4
Unexport interal packages (#1363)
RELEASE_NOTES=[CLEANUP] Move internal packages to internal.

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2020-05-16 20:27:56 +02:00