Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
What namespaces are supported here? can you add from an
/ipns
path? We do more to normalise the user input in the ipld path explorer, which might be something worth extracting and reusingsee: https://github.com/ipfs-shipyard/ipld-explorer-components/blob/adceb5f6760cb88165d026b65fb38f491fb4f843/src/lib/parse-ipld-path.js
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.
ipns
paths are not supported, as we are using:https://github.com/ipfs-shipyard/ipfs-webui/blob/1e2c58fee899009cf68bc4c903d4eed9dbbe1f0b/src/files/file-input/ByPathModal.js#L14
See https://github.com/ipfs/is-ipfs#usage.
I agree this should be more robust, but if we want to enable ipns paths we'll have to resolve them to an ipfs cid and then add that path right?
One more thing,
Add by path
usesipfs.files.cp
to move stuff around. We should be able to add a CID directly of a file that isn't on our repo yet, I tried that the first time I sawAdd by path
.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.
Doesn't the underlying IPFS API parse ipns paths? Or am I being a bit far fetched?
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.
@fsdiogo the first argument ot cp can be an ipfs address that isn't currently in your repo. You can copy in remote files.
@hacdias looks like cp only supports MFS -> MFS and /ipfs -> MFS copying... js-ipfs-mfs only has a special case for paths that start with
/ipfs
see: https://github.com/ipfs/js-ipfs-mfs/blob/b4f6083557276650d030c7172b94a6847425f228/src/core/utils/to-mfs-path.js#L52
and go-ipfs from the command line fails on:
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.
What if we detect ´/ipns´ and call ipfs.dns? We could show an indicator so the user knows what's going on.
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.
Could do, but it sounds like something that we should push for support for in go/js-ipfs rather than working around it at the app layer