Conversation
schomatis
left a comment
There was a problem hiding this comment.
The code in general LGTM (but I can't really comment on the design decision of extracting all of the IpfsNode attributes here).
core/coreapi/coreapi.go
Outdated
|
|
||
| // TODO: this can be generalized to all functions when we implement some | ||
| // api based security mechanism | ||
| isPublishAllowed func() error |
There was a problem hiding this comment.
This method isn't really about security. Really, we should allow publishing IPNS records while /ipns is mounted. We don't currently because we haven't implemented that yet.
There was a problem hiding this comment.
I know, I just wanted to hint that something like this may be useful (but a full security layer implementing coreapi interface would probably be better)
core/commands/cmdenv/env.go
Outdated
| } | ||
|
|
||
| return ctx.GetAPI() | ||
| local, _ := req.Options["local"].(bool) |
There was a problem hiding this comment.
So, this'll apply this option (correctly) to all commands fixing part of #4182. I wonder if we should fix the "confusing" part while we're at it by renaming this option to "offline" (keeping a hidden alias for compatibility).
That would also allow us to share the same option with ipfs daemon --offline which should help to further reduce confusion.
There was a problem hiding this comment.
I'm fine with doing that (the hidden alias could throw warnings at people). This will probably need support on the js side too
There was a problem hiding this comment.
I didn't realize js replicated that option.
@alanshaw how would you feel about switching from --local to --offline (keeping --local as a backcompat alias)?
There was a problem hiding this comment.
Implemented, waiting for @alanshaw's opinion (assuming js-ipfs implements --local)
a16a5ba to
7ddb45f
Compare
4eccfa9 to
6de9b03
Compare
core/coreapi/coreapi.go
Outdated
|
|
||
| cs := cfg.Ipns.ResolveCacheSize | ||
| if cs == 0 { | ||
| cs = 128 |
There was a problem hiding this comment.
We should lift this to a constant.
| dserv := dag.NewDAGService(bserv) | ||
|
|
||
| fileAdder, err := coreunix.NewAdder(ctx, n.Pinning, n.Blockstore, dserv) | ||
| fileAdder, err := coreunix.NewAdder(ctx, pinning, addblockstore, dserv) |
There was a problem hiding this comment.
Is this a bugfix or a bug? It's now using addblocksore where it used to use the unmodified blockstore.
There was a problem hiding this comment.
bugfix - coreunix.NewAdder uses it only for the GCLock, which we don't want/need to take from the 'real' node when we do add with OnlyHash set.
|
Mostly nits at this point but you should take a look at #5825 (comment). |
|
@ipfs/go-team this is an interface change (but not a breaking one). It replaces Suggestions? Objections? |
00dddb3 to
81fa251
Compare
|
(rebased) |
License: MIT Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
License: MIT Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
License: MIT Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
License: MIT Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
License: MIT Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
License: MIT Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
License: MIT Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
License: MIT Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
License: MIT Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
License: MIT Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
License: MIT Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
81fa251 to
6044d2a
Compare
License: MIT Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
CoreAPI: Global offline option This commit was moved from ipfs/kubo@28dabc7
For #5654. This implements the 'Functional options on the constructor' approach.
I decided to not use
core.IpfsNodedirectly in coreapi as this way we have much better control over how the internals are used. Longer term, after coreapi interface is extracted form go-ipfs, I plan on merging a lot of core node and coreapi functionality, but I want to do that together with go-ipfs constructor cleanup as it will be quite breaking for people usingcore.IpfsNodedirectly (there still are good reasons to do that)A few bugs and todos are still left, reviews welcome