Skip to content
This repository has been archived by the owner on Mar 29, 2023. It is now read-only.

return url as AbsPath from WebFile to implement FileInfo #13

Merged
merged 1 commit into from
Mar 21, 2019
Merged

return url as AbsPath from WebFile to implement FileInfo #13

merged 1 commit into from
Mar 21, 2019

Conversation

jmank88
Copy link
Contributor

@jmank88 jmank88 commented Mar 19, 2019

This PR extends WebFile to implement FileInfo, causing the url to be sent in the abspath header (to be used in subsequent PRs to go-ipfs-cmds and go-ipfs).
Towards ipfs/kubo#6065

@Jorropo
Copy link

Jorropo commented Mar 19, 2019

I don't get where is it use full, I'm working on ipfs/kubo#6065 (like you), personaly I'm close to finish (I'm in trouble with the post run function of add when it is an url because it wait a lot of things that not here.) and I don't need that.
Please can you tell me when is use full please ?

@jmank88
Copy link
Contributor Author

jmank88 commented Mar 19, 2019

I'm following the method describe here, which is different than how urlstore works. This PR indirectly adds the url to the abspath header. Then go-ipfs-cmds will need an update to use files.WebFile when it encounters a url path. Then go-ipfs will need an update to set DagBuilderParams.URL from files.FileInfo.AbsPath(). All together those changes enable using urls and also supports --nocopy. It's a small change overall, but it crosses multiple repos and each piece depends on the last.

@Jorropo
Copy link

Jorropo commented Mar 19, 2019

Ok :)

@Stebalien Stebalien requested a review from magik6k March 20, 2019 07:12
Copy link
Member

@Stebalien Stebalien left a comment

Choose a reason for hiding this comment

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

@magik6k I think this is the right way to do this but it's kind of weird. Basically, setting AbsPath like this (and tweaking the cmds library to create WebFiles) should make ipfs add --nocopy magically work with URLs. Does that sound right?

@ghost ghost assigned Stebalien Mar 20, 2019
@ghost ghost added the status/in-progress In progress label Mar 20, 2019
@jmank88
Copy link
Contributor Author

jmank88 commented Mar 20, 2019

And a third step to set DagBuilderParams.URL to FileInfo.AbsPath() in go-ipfs/core/coreunix/add.go (urlstore manages its own DagBuilderParams directly).
Here is all three pieces ipfs/kubo#6065 (comment)

Copy link
Member

@magik6k magik6k left a comment

Choose a reason for hiding this comment

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

LGTM.

(another way to approach this would be to make MultipartReader just send the URL with type like application/x-url, and parse that into WebFiles in MultipartFile, but that's much more involved change to save a bit of bandwidth between client and daemon)

@Stebalien Stebalien merged commit 6b8782d into ipfs:master Mar 21, 2019
@ghost ghost removed the status/in-progress In progress label Mar 21, 2019
@jmank88 jmank88 deleted the webfile-abspath branch March 21, 2019 04:45
hacdias pushed a commit to ipfs/boxo that referenced this pull request Jan 11, 2023
return url as AbsPath from WebFile to implement FileInfo

This commit was moved from ipfs/go-ipfs-files@6b8782d
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.

4 participants