Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add passphrase to init options #197

Merged
merged 1 commit into from
Jan 30, 2018
Merged

add passphrase to init options #197

merged 1 commit into from
Jan 30, 2018

Conversation

richardschneider
Copy link
Contributor

See #194

@ghost ghost added the status/in-progress In progress label Jan 29, 2018
Copy link
Member

@dryajov dryajov left a comment

Choose a reason for hiding this comment

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

@richardschneider I don't think we really need this changes for the daemons (js and go), but we do for the in-proc node.

if (initOpts.directory && initOpts.directory !== this.path) {
this.path = initOpts.directory
}

run(this, ['init', '-b', keySize], { env: this.env }, (err, result) => {
const args = ['init', '-b', initOpts.keysize || 2048]
if (initOpts.pass) {
Copy link
Member

Choose a reason for hiding this comment

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

@richardschneider this should already happen since args just get forwarded to the daemon.

@dryajov
Copy link
Member

dryajov commented Jan 29, 2018

@richardschneider I see we already addressed passing the --pass options to in-proc nodes here - #187.

@richardschneider
Copy link
Contributor Author

@dryajov Yes --pass works when spawing the daemon. This PR is to allow it when initing the repo.

@dryajov
Copy link
Member

dryajov commented Jan 29, 2018

@richardschneider init() taks an args array, that should allow you to pass the --pass option already, so no need for that.

@richardschneider
Copy link
Contributor Author

Seems like my bad. So something like the below will add -pass to all commands generated to init.

const options = {
  args: ['--pass ipfs-is-awesome-software']
}
df.spawn(options, (err, _ipfsd) => { ... })

@dryajov
Copy link
Member

dryajov commented Jan 29, 2018

@richardschneider - actually my bad. You're right, init takes an initOpts object, and if pass is a flag for init then we do need this change.

@richardschneider
Copy link
Contributor Author

@dryajov Don't you have PR to fix the jenkins port sharing issue? If so can we merge it.

@dryajov
Copy link
Member

dryajov commented Jan 29, 2018

@richardschneider yes, it's here - #196.

Just need to make sure that we don't start non disposable nodes with the default config (https://github.com/ipfs/js-ipfsd-ctl/pull/196/files#diff-b7c01f8fb93cfc68f6e35c7af488a039R192).

i.e.

use something like this when starting non disposable nodes:

const config = {
            Addresses: {
              Swarm: [
                '/ip4/127.0.0.1/tcp/0/ws',
                '/ip4/127.0.0.1/tcp/0'
              ],
              API: '/ip4/127.0.0.1/tcp/0',
              Gateway: '/ip4/127.0.0.1/tcp/0'
            }
          }

Copy link
Member

@dryajov dryajov left a comment

Choose a reason for hiding this comment

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

LGTM

@daviddias daviddias merged commit 7cf6384 into master Jan 30, 2018
@daviddias daviddias deleted the init-passphrase branch January 30, 2018 04:43
@ghost ghost removed the status/in-progress In progress label Jan 30, 2018
dryajov pushed a commit that referenced this pull request Feb 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants