Skip to content
This repository has been archived by the owner on Oct 23, 2022. It is now read-only.

feat(http): add default values for --bits and --profile in ipfs init #502

Merged
merged 2 commits into from
Apr 6, 2022

Conversation

rand0m-cloud
Copy link
Contributor

@rand0m-cloud rand0m-cloud commented Apr 5, 2022

This PR adds default values for the ipfs init command to be more like the go-ipfs ipfs init. --bits 2048 and --profile default are the default flags if they not overridden.

I've also included an profiles length check that is more accurate and injects the default profile if none was provided. Plus a small update to an error print statement because 1024 bits for a RSA key is too low.

with a expanded profiles length check that is more accurate
@@ -95,7 +95,7 @@ fn main() {
std::process::exit(1);
}
Err(config::InitializationError::InvalidRsaKeyLength(bits)) => {
eprintln!("Error: --bits out of range [1024, 16384]: {}", bits);
eprintln!("Error: --bits out of range [2048, 16384]: {}", bits);
Copy link
Collaborator

@koivunej koivunej Apr 6, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good spotting! Unsure how this got left in, the 1024-bit rsa keys never worked with ring, which was an issue in the beginning as ipfs bootstrap nodes were using those.

@koivunej
Copy link
Collaborator

koivunej commented Apr 6, 2022

Thanks for this @rand0m-cloud. In near-term it would be nice to get rid of the RSA keys. I think I saw there being some support for ipfs' or libp2p compatible ec key serialization in rust-libp2p as well, which would allow removal of lot of complications.

bors r+

@bors
Copy link
Contributor

bors bot commented Apr 6, 2022

Build succeeded:

@bors bors bot merged commit 2ca9704 into rs-ipfs:master Apr 6, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants