-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Conversation
829d0fb
to
c1dc38d
Compare
src/core/index.js
Outdated
waterfall([ | ||
(done) => this._repo.config.get((error, config) => { | ||
if (error) { | ||
this.log('Could not load config', error) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It’s probably not a huge deal since the logs only show if someone’s explicitly set DEBUG=jsipfs
, but this will log even when things are just fine — e.g. if running jsipfs init
. It makes it look like something went wrong even when the error is expected and OK.
Would it be better to check whether the repo exists first or to check this._options.init
? (Are there other situations when this should fail?)
c1dc38d
to
c18f9be
Compare
60525ef
to
d1751ea
Compare
@achingbrain resolved the merge conflict here so we could have a CI run, hope you don't mind (change). |
Doesn't actually solve the issue though, where running Think this PR would feel good by having a test case added to it as well. |
src/http/api/resources/files.js
Outdated
is: 1, | ||
then: Joi.boolean().valid(false).required(), | ||
otherwise: Joi.boolean().valid(false) | ||
}), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Eek, bad merge? This shouldn't be here anymore.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for catching that, resolved.
faa4c61
to
66bdbcb
Compare
Seems to work, at least when setting the Quest goes on for what happens with Edit: opened #1529 for the preload config issue. |
Lets us do things like `jsipfs config --bool EXPERIMENTAL.pubsub true` and have IPFS respect the flags in daemon and non-daemon mode
License: MIT Signed-off-by: Victor Bjelkholm <[email protected]>
b19a39c
to
287d7ae
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks to me as though the best place for reading the config from the repo would be in boot.js
directly after the repo has been opened and initialized.
In the options
passed to the IPFS constructor, the config
property is meant to contain serializable config that you'd usually find in ~/.jsipfs/config
.
So, I think that rather than extending options
with the contents of ~/.jsipfs/config
we should be extending options.config
.
The special case is the "EXPERIMENTAL" config option which is also a top level property of the options
object passed to the constructor, so we need to ensure it is merged with the repo config and that the merged result set on options.EXPERIMENTAL
as well as options.config.EXPERIMENTAL
🙄
Just FYI, in pre-start.js
any additional config passed in options.config
is saved to the config file. Do you think this should be moved to boot.js
as well? It seems like an odd task to perform immediately before the node starts...
If we do this we'll be able to clean up the double options/config checking in libp2p which will be really nice.
Lets us do things like
jsipfs config --bool EXPERIMENTAL.pubsub true
and have IPFSrespect the flags in daemon and non-daemon mode
Attempts to address #738