kubo/core/commands
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
..
cmdenv code review changes 2021-01-14 02:29:11 -08:00
dag Merge pull request #7753 from ipfs/fix/dag-import-export-coreapi 2020-11-24 13:14:53 -05:00
e Fix typo in an error.go comment: "is adds" -> "adds". 2018-01-17 15:25:54 -08:00
keyencode fix: remove the (empty) alias for --ipns-base 2020-09-09 11:30:45 -04:00
name additional escape 2020-12-18 17:23:30 -08:00
object Escape non-printable characters in user output 2020-12-17 18:16:34 -08:00
pin Merge pull request #7887 from ipfs/docs/clarify-repeated-options 2021-01-28 13:31:24 -05:00
unixfs Escape non-printable characters in user output 2020-12-17 18:16:34 -08:00
active.go refactor: get rid of cmdDetails awkwardness 2020-08-04 18:28:40 -04:00
add.go Escape non-printable characters in user output 2020-12-17 18:16:34 -08:00
bitswap.go fix: move away from deprecated peer ID functions 2019-12-14 19:48:31 +01:00
block.go fix: block put helptext 2019-06-12 12:44:01 -04:00
bootstrap.go chore: deprecate go-ipfs-addr 2019-05-31 23:46:11 -07:00
cat.go fix: migrate from deprecated warning function 2020-01-28 21:20:21 -08:00
cid.go refactor: get rid of cmdDetails awkwardness 2020-08-04 18:28:40 -04:00
commands_test.go add remote pinning to ipfs command (#7661) 2020-12-08 20:32:33 -05:00
commands.go refactor: get rid of cmdDetails awkwardness 2020-08-04 18:28:40 -04:00
config.go add remote pinning to ipfs command (#7661) 2020-12-08 20:32:33 -05:00
dht_test.go migrate to go-libp2p-core. 2019-05-31 23:23:52 -07:00
dht.go fix: ipfs dht put/get commands now work on keys encoded as peerIDs and fail early for namespaces other than /pk or /ipns 2020-08-30 02:16:15 -04:00
diag.go cmdkit -> cmds 2019-05-10 23:00:20 -07:00
dns.go Escape non-printable characters in user output 2020-12-17 18:16:34 -08:00
external.go refactor: get rid of cmdDetails awkwardness 2020-08-04 18:28:40 -04:00
extra.go refactor: get rid of cmdDetails awkwardness 2020-08-04 18:28:40 -04:00
files.go Update core/commands/files.go 2020-11-24 13:42:36 +05:30
filestore.go Update imports to go-filestore 2019-07-15 15:52:34 +02:00
get_test.go cmdkit -> cmds 2019-05-10 23:00:20 -07:00
get.go fix build on Plan 9 2020-09-23 22:27:01 -04:00
helptext_test.go gx: unrewrite 2019-03-05 18:33:56 +01:00
id.go fix: remove the (empty) alias for --peerid-base 2020-09-17 13:52:18 -04:00
keystore.go Improve error message when running key command that locks repo (#7821) 2021-01-28 15:15:49 -05:00
log.go refactor: get rid of cmdDetails awkwardness 2020-08-04 18:28:40 -04:00
ls.go Escape non-printable characters in user output 2020-12-17 18:16:34 -08:00
mount_nofuse.go cmdkit -> cmds 2019-05-10 23:00:20 -07:00
mount_unix.go Escape non-printable characters in user output 2020-12-17 18:16:34 -08:00
mount_windows.go cmdkit -> cmds 2019-05-10 23:00:20 -07:00
p2p.go doc: update documentation for /ipfs -> /p2p multiaddr switch 2019-12-14 19:39:59 +01:00
ping.go fix: move away from deprecated peer ID functions 2019-12-14 19:48:31 +01:00
pubsub.go Escape non-printable characters in user output 2020-12-17 18:16:34 -08:00
refs.go fix: use bitswap sessions for ipfs refs 2020-05-28 17:15:56 -07:00
repo.go refactor: get rid of cmdDetails awkwardness 2020-08-04 18:28:40 -04:00
resolve.go use b36 keys by default for keys and IPNS 2020-08-17 21:43:01 -07:00
root_test.go pre-populate required arguments from request body 2018-03-18 13:04:25 -07:00
root.go add remote pinning to ipfs command (#7661) 2020-12-08 20:32:33 -05:00
shutdown.go cmdkit -> cmds 2019-05-10 23:00:20 -07:00
stat_dht.go feat: add a stats dht command 2020-05-14 23:32:18 -07:00
stat.go feat: add a stats dht command 2020-05-14 23:32:18 -07:00
swarm.go chore: update libp2p 2020-05-20 16:56:22 -07:00
sysdiag.go chore: update go-multiaddr and go-multiaddr-net 2020-08-25 15:24:48 -04:00
tar.go cmds/tar: use the coreapi 2020-03-02 09:22:58 -08:00
urlstore.go Update imports to go-filestore 2019-07-15 15:52:34 +02:00
version.go refactor: get rid of cmdDetails awkwardness 2020-08-04 18:28:40 -04:00