kubo/cmd/ipfs
Andrew Gillis 6f6f04543b
Improve error message when running key command that locks repo (#7821)
* Improve error message when running key commands that must be run when the daemon is not already running

Fixes Issue #7814

`ipfs key export` now does a PreRun check like `ipfs key rotate` was to give a better error to the user then "someone else has the lock" in the event that the daemon is running while trying to execute these offline-only commands.

While unlikely the "someone else has the lock" error can still be shown if two processes try and grab the repo lock at the same time.

This PreRun function is also exported so it can be used by `ipfs init` where it was originally copied from.

* Added more `ipfs key` command tests

When daemon is running:
- Test that import works
- Test that export fails
- Test that rotate fails
2021-01-28 15:15:49 -05:00
..
dist Update the license distributed with dist builds to the dual one 2020-02-06 22:27:15 +01:00
util fix build on Plan 9 2020-09-23 22:27:01 -04:00
.gitignore make: rework makefiles for non-recursive make and add sharness coverage 2017-02-12 01:18:40 +01:00
daemon_linux.go chore(dep): update deps 2020-01-28 21:20:17 -08:00
daemon_other.go systemd: add notify support 2019-09-27 16:08:30 -07:00
daemon.go register quic opencensus metrics 2020-12-08 20:22:38 -05:00
dnsresolve_test.go gx: unrewrite 2019-03-05 18:33:56 +01:00
init.go Improve error message when running key command that locks repo (#7821) 2021-01-28 15:15:49 -05:00
ipfs.go move key rotation command to ipfs key rotate 2020-08-17 07:26:47 -04:00
main.go chore: update go-multiaddr and go-multiaddr-net 2020-08-25 15:24:48 -04:00
Rules.mk mk: s/go-build/go-build-relative/ 2019-03-05 18:33:58 +01:00
runmain_test.go make: rework makefiles for non-recursive make and add sharness coverage 2017-02-12 01:18:40 +01:00