The InitializeKeyspace functionality is go-ipfs specific but lives in the
go-namesys repo.
It is only called from initializeIpnsKeyspace, and therefore the code is
directly added to this function. The original function will be removed from
go-namesys.
Namesys is a very useful submodule. Given a ValueStore and a Datastore it can
resolve and publish /ipns/ paths.
This functionality does not need to be sequestered inside go-ipfs as it can
and should be used without IPFS, for example, for implementing lightweight
IPNS publishing services or for resolving /ipns/ paths.
"keystore" extraction was necessary, as there is a dependency to it in
namesys. Keystore is also a useful module by itself within the stack.
Fixes#6537
We've had a reliable and enabled by default TLS implementation since
0.4.23 (over a year ago) and turned off SECIO in September of last year.
We might as well remove support entirely in the next release and
encourage users to upgrade their networks.
Noise is faster, anyways.
The code in this PR finds the necessary mirgations, downloads the latest version of them from the distribution site, unpacks the executables, and runs the migrations in order.
This code is also used to build the ipfs-update tool and the fs-repo-migrations tool. Note: the fs-repo-migrations tool is only used to run stand-alone migrations now and is not used by either go-ipfs or ipfs-update.
Additional utility is provided by this PR, that is not specific to migrations:
- Find local ipfs directory
- Get current repo version
- Check for ipfs daemon availability
- Get version information about any distribution on distribution site
- Fetch and unpack any binary executable over ipfs or http
* 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
* add support for choosing a peer key type (e.g. RSA or Ed25519) when initializing the repo
* test all variants of ipfs init: RSA, Ed25519 and default
* update subdomain gateway sharness test to publish IPNS using RSA and
Ed25519 keys
* use default identity bit lengths defined in config repo instead of
having separate defaults in go-ipfs
* update config repo dependency
Co-authored-by: Will Scott <will@cypherpunk.email>
Co-authored-by: Petar Maymounkov <petarm@gmail.com>
Adds `ipfs_info` prometheus metric with version and commit info
```prometheus
ipfs_info{commit="9ea7c6a11-dirty",version="0.5.0-dev"} 1
```
This follows the same pattern as go and other systems, adding a gauge metric that is set to 1, with the version info addeds as labels.
This is a common pattern for prometheus. It lets operators merge version info into other prometheus metrics by multiplying it with the other stat, as described in https://www.robustperception.io/exposing-the-software-version-to-prometheus
For example, we already expose the go version info as
```prometheus
go_info{version="go1.12.9"} 1
```
License: MIT
Signed-off-by: Oli Evans <oli@tableflip.io>
For now, configs specified in `daemon --init-config` and `init CONFIG` are not
available. We should fix this eventually but isn't necessary for now (and
supporting this will be annoying).