Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

Running daemon in CLI screws up config #868

Closed
victorb opened this issue May 25, 2017 · 1 comment · Fixed by #914
Closed

Running daemon in CLI screws up config #868

victorb opened this issue May 25, 2017 · 1 comment · Fixed by #914
Labels
exp/novice Someone with a little familiarity can pick up help wanted Seeking public contribution on this issue kind/bug A bug in existing code (including security flaws)

Comments

@victorb
Copy link
Member

victorb commented May 25, 2017

If I initialize a new repo, look at the config, run jsipfs daemon and then look at the config, they look different. There is some mumbo-jumbo being added in the bottom of the config. Steps to reproduce:

jsipfs init
# look at the config
jsipfs daemon
# ctrl+c to exit
# look at the config again

Log

$ IPFS_PATH=$(mktemp -d) ./node_modules/.bin/jsipfs init
initializing ipfs node at /tmp/tmp.mfw7OkcfUC
generating 2048-bit RSA keypair...done
peer identity: QmepNLSw4Ly5RNTP1sCwVLSbb6fsf2owJWtDPCUpYigg9b
WARNING: Your platform does not have native WebRTC support, it won' use any WebRTC transport
to get started, enter:

	 jsipfs files cat /ipfs/QmPZ9gcCEpqKTo6aq61g2nXGUhM4iCL3ewB6LDXZCtioEB

$ cat /tmp/tmp.mfw7OkcfUC/config
{
  "Addresses": {
    "Swarm": [
      "/ip4/0.0.0.0/tcp/4002",
      "/ip4/127.0.0.1/tcp/4003/ws"
    ],
    "API": "/ip4/127.0.0.1/tcp/5002",
    "Gateway": "/ip4/127.0.0.1/tcp/9090"
  },
  "Discovery": {
    "MDNS": {
      "Enabled": true,
      "Interval": 10
    },
    "webRTCStar": {
      "Enabled": true
    }
  },
  "Bootstrap": [
    "/ip4/104.131.131.82/tcp/4001/ipfs/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ",
    "/ip4/104.236.176.52/tcp/4001/ipfs/QmSoLnSGccFuZQJzRadHn95W2CrSFmZuTdDWP8HXaHca9z",
    "/ip4/104.236.179.241/tcp/4001/ipfs/QmSoLPppuBtQSGwKDZT2M73ULpjvfd3aZ6ha4oFGL1KrGM",
    "/ip4/162.243.248.213/tcp/4001/ipfs/QmSoLueR4xBeUbY9WZ9xGUUxunbKWcrNFTDAadQJmocnWm",
    "/ip4/128.199.219.111/tcp/4001/ipfs/QmSoLSafTMBsPKadTEgaXctDQVcqN88CNLHXMkTNwMKPnu",
    "/ip4/104.236.76.40/tcp/4001/ipfs/QmSoLV4Bbm51jM9C4gDYZQ9Cy3U6aXMJDAbzgu2fzaDs64",
    "/ip4/178.62.158.247/tcp/4001/ipfs/QmSoLer265NRgSp2LA3dPaeykiS1J6DifTC88f5uVQKNAd",
    "/ip4/178.62.61.185/tcp/4001/ipfs/QmSoLMeWqB7YGVLJN3pNLQpmmEk35v6wYtsMGLzSr5QBU3",
    "/ip4/104.236.151.122/tcp/4001/ipfs/QmSoLju6m7xTh3DuokvT3886QRYqxAzb1kShaanJgW36yx"
  ],
  "Identity": {
    "PeerID": "QmepNLSw4Ly5RNTP1sCwVLSbb6fsf2owJWtDPCUpYigg9b",
    "PrivKey": "CAASqAkwggSkAgEAAoIBAQDnW+b3NkRp2++gutnwbk892Ld+5u45wwTGnjRELGWvcClZ0+0C4RH4GOwOEOrrmGhlLuoreg+0P1/GmJ6Ov6XT6TLbC+zcCmUSSWGfKDXRwVtralURAWT/KgUDcoMczDVx57BKC+Gb07paIlP5HVy8b+6MLiI8zwoonP1ol3glGFK1qHoPgvN4KoOb/QHpbMs9+X39VTzAHjH5OLGX3tmuZ3o1x/RG1xJV0Bfo3Jivi3G7tFt4FzVLWxvrsT5Z/IkCDRWG15cNddzRsylKfaMbzEUOF/jCcTWHuHaNlffbBX5i3JD98ATT2v2oxcJGl16hJOG6OWwNUSGxgbfC/VaHAgMBAAECggEBAMHDJ0ltiph52VPsiXAign0SjoNalrOLj+lkP/PElxj6P7d6lOovY2Q8Qx54rrbHes8bHoVxAcv8s5LY6Ro2iYRTrwLjFukmT4WkLX0lKQXWAWGRuVK3r0VAhNhhREuO/0e5OdyZ3MYr6ctpKpjdLXin6co/LO9umlxvNpA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S_PATH=/tmp/tmp.mfw7OkcfUC ./node_modules/.bin/jsipfs daemon
Initializing daemon...
Swarm listening on /ip4/127.0.0.1/tcp/4003/ws/ipfs/QmepNLSw4Ly5RNTP1sCwVLSbb6fsf2owJWtDPCUpYigg9b
Swarm listening on /ip4/127.0.0.1/tcp/4002/ipfs/QmepNLSw4Ly5RNTP1sCwVLSbb6fsf2owJWtDPCUpYigg9b
Swarm listening on /ip4/10.185.197.123/tcp/4002/ipfs/QmepNLSw4Ly5RNTP1sCwVLSbb6fsf2owJWtDPCUpYigg9b
API is listening on: /ip4/127.0.0.1/tcp/5002
Gateway (readonly) is listening on: /ip4/127.0.0.1/tcp/9090
Daemon is ready
^CReceived interrupt signal, shutting down..

$ cat /tmp/tmp.mfw7OkcfUC/config
{
  "Addresses": {
    "Swarm": [
      "/ip4/0.0.0.0/tcp/4002",
      "/ip4/127.0.0.1/tcp/4003/ws"
    ],
    "API": "/ip4/127.0.0.1/tcp/5002",
    "Gateway": "/ip4/127.0.0.1/tcp/9090"
  },
  "Discovery": {
    "MDNS": {
      "Enabled": true,
      "Interval": 10
    },
    "webRTCStar": {
      "Enabled": true
    }
  },
  "Bootstrap": [
    "/ip4/104.131.131.82/tcp/4001/ipfs/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ",
    "/ip4/104.236.176.52/tcp/4001/ipfs/QmSoLnSGccFuZQJzRadHn95W2CrSFmZuTdDWP8HXaHca9z",
    "/ip4/104.236.179.241/tcp/4001/ipfs/QmSoLPppuBtQSGwKDZT2M73ULpjvfd3aZ6ha4oFGL1KrGM",
    "/ip4/162.243.248.213/tcp/4001/ipfs/QmSoLueR4xBeUbY9WZ9xGUUxunbKWcrNFTDAadQJmocnWm",
    "/ip4/128.199.219.111/tcp/4001/ipfs/QmSoLSafTMBsPKadTEgaXctDQVcqN88CNLHXMkTNwMKPnu",
    "/ip4/104.236.76.40/tcp/4001/ipfs/QmSoLV4Bbm51jM9C4gDYZQ9Cy3U6aXMJDAbzgu2fzaDs64",
    "/ip4/178.62.158.247/tcp/4001/ipfs/QmSoLer265NRgSp2LA3dPaeykiS1J6DifTC88f5uVQKNAd",
    "/ip4/178.62.61.185/tcp/4001/ipfs/QmSoLMeWqB7YGVLJN3pNLQpmmEk35v6wYtsMGLzSr5QBU3",
    "/ip4/104.236.151.122/tcp/4001/ipfs/QmSoLju6m7xTh3DuokvT3886QRYqxAzb1kShaanJgW36yx"
  ],
  "Identity": {
    "PeerID": "QmepNLSw4Ly5RNTP1sCwVLSbb6fsf2owJWtDPCUpYigg9b",
    "PrivKey": "CAASqAkwggSkAgEAAoIBAQDnW+b3NkRp2++gutnwbk892Ld+5u45wwTGnjRELGWvcClZ0+0C4RH4GOwOEOrrmGhlLuoreg+0P1/GmJ6Ov6XT6TLbC+zcCmUSSWGfKDXRwVtralURAWT/KgUDcoMczDVx57BKC+Gb07paIlP5HVy8b+6MLiI8zwoonP1ol3glGFK1qHoPgvN4KoOb/QHpbMs9+X39VTzAHjH5OLGX3tmuZ3o1x/RG1xJV0Bfo3Jivi3G7tFt4FzVLWxvrsT5Z/IkCDRWG15cNddzRsylKfaMbzEUOF/jCcTWHuHaNlffbBX5i3JD98ATT2v2oxcJGl16hJOG6OWwNUSGxgbfC/VaHAgMBAAECggEBAMHDJ0ltiph52VPsiXAign0SjoNalrOLj+lkP/PElxj6P7d6lOovY2Q8Qx54rrbHes8bHoVxAcv8s5LY6Ro2iYRTrwLjFukmT4WkLX0lKQXWAWGRuVK3r0VAhNhhREuO/0e5OdyZ3MYr6ctpKpjdLXin6co/LO9umlxvNpAtIzM0dtFCCE5XswlahLFJ5YLZLu+cV+JetQGJLYkvnbCi7GTV3kG/0IbS/FUfS0rVsOe0J4muR7ZWRjq3CtYA7sC31XuW0RCYVC0qXFG5YAUrnRYFkrCGLAn/UqgxXvfSEyPCmVqYbN9PNhgaAaY27zKpKhAbCN8psIR+mMboTVVoakECgYEA/DAw+r/9zxFh8TW+Eukr6S6oHO9kBVDeGoiaoWSuEEXu2Akl28Gacgebdk2le8xi8/bAgYi6sRx05kuq+RZz1nRaSnMqIHvcaUi5LQIBWylLy6TLX21NBaQtlMbumWcpNTH6coD89PDmYhBk1pxLr6OEYxyBIcFT0KK3Ca/mJCcCgYEA6tsdaDPpwBXOlW6WU4hlZ3gGuQfUWTc5V5yo+4qWvDDqYvCcNVd/fFlmt6hfdD/QwgZkH9aMXOzfYh7jzcU9mqSpxkL173mBtprWPaTJHd+2MA2v4uPHLTfy+HTtwWhRaAK2z3vQ0O7v6rY4vLfOUVfV22OsFL4RoxCWSDO41qECgYBvOi4QGieucWM6SNLJcm/8i6h4ApmhwpYDK+bPciFXahC61eYNs6kTzAkkN4DaRj4KjfU/7Hcy8HMas5r3+5AhsPW1ym91HkwLX5jUogLJG0Cj084jC4kiCNRVvxuzKw3AuYdVg1COE8X40HQ5N3wmPj+AmyzVH3iBF5MVQbCGlwKBgF5VbNZyI634FGaJaPBclP6eg3TG5FCBkhLS5j1DSZCFxV/Abb4vSxHThyK2CsFS8LM+hfET6IVaz89FwRLh6wC2q0rrkoWCNMv4HZ3dFrtdJHzgwolMHLDZDEsoDGfnUuuIS43DmfiSQOPyFZAX9FNQCKJ6wqACSGtLOlH+FHyBAoGBAPeyTkMWjgs9cRZlkoYcA7YXcQMRHdjXboVOUQ48vVuAk/DHl/DccAUK9NOEKHCu7M1lwIZM0aD/S80xzN85MBAt4K9iYNZP5MdjdAU8iQmtlgftdNPAPpNl8XfPeiqf/F8iS7OaVIqGuEGoRr7YT1UTQyvQdeHcwNHPmoJjzSFG"
  },
  "_": [
    "daemon"
  ],
  "help": false,
  "enable-sharding-experiment": false,
  "enableShardingExperiment": false,
  "enable-pubsub-experiment": false,
  "enablePubsubExperiment": false,
  "$0": "node_modules/.bin/jsipfs"
}
@victorb victorb added the kind/bug A bug in existing code (including security flaws) label May 25, 2017
@victorb victorb changed the title Running daemon screws up config Running daemon in CLI screws up config May 25, 2017
@daviddias daviddias added exp/novice Someone with a little familiarity can pick up help wanted Seeking public contribution on this issue labels May 25, 2017
@daviddias
Copy link
Member

It doesn't necessarily "screw" the config, it is just serializing stuff that is not required to be in the config. Looks like it needs to be sanitized before stored. @victorbjelkholm can you PR a fix for this?

@daviddias daviddias added the status/deferred Conscious decision to pause or backlog label Jul 3, 2017
sktt added a commit to sktt/js-ipfs that referenced this issue Jul 18, 2017
  - Respect `--enable-experimental-pubsub`
  - Don't overload repo config with cli args (fixes ipfs#868)
  - Typo
daviddias pushed a commit that referenced this issue Jul 19, 2017
* Fix js-ipfs daemon config params

  - Respect `--enable-experimental-pubsub`
  - Don't overload repo config with cli args (fixes #868)
  - Typo

* Treat cli args and config overload as seperate

- Add an extra parameter for `HttpAPI` for `cliArgs`
@daviddias daviddias removed the status/deferred Conscious decision to pause or backlog label Jul 19, 2017
sktt added a commit to sktt/js-ipfs that referenced this issue Jul 20, 2017
  - Respect `--enable-experimental-pubsub`
  - Don't overload repo config with cli args (fixes ipfs#868)
  - Typo
dryajov pushed a commit that referenced this issue Sep 1, 2017
* Fix js-ipfs daemon config params

  - Respect `--enable-experimental-pubsub`
  - Don't overload repo config with cli args (fixes #868)
  - Typo

* Treat cli args and config overload as seperate

- Add an extra parameter for `HttpAPI` for `cliArgs`
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
exp/novice Someone with a little familiarity can pick up help wanted Seeking public contribution on this issue kind/bug A bug in existing code (including security flaws)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants