-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
unixfs symlinks #1104
Comments
Since IPFS is read only, we should just be able to resolve the link right? It would almost be like giving an object the same hash, which is hard, and would break a lot of the hash checking. You wouldn't really want to return what the link points too. |
The other hard part is that we need to be able to support 'broken links' for a variety of reasons. |
One simple solution would be to disallow @chriscool @cryptix thoughts? |
One issue with symlinks in ipfs in general is if they are simply just paths, relative links could cause issues when working in Imagine a symlink point to |
On Mon, Apr 20, 2015 at 06:01:37PM -0700, Jeromy Johnson wrote:
On the one hand, this helps you do things like round-trip a generic One useful case for links (both symbolic and hard) is that the value |
@travisperson yeah, the symlinks can be problematic attack vectors if they can pull out of the ipfs root. (there may be ways around this, but perhaps will be clunky.) @wking makes great points.
could you spell this out in a graph? we may see a straightforward solution. @whyrusleeping maybe you can describe the issue you encountered with git and/or containers very precisely and either we can find how to do it without. i'll add some complicated support. git allows symlinks strictly for the "outside of git" world. meaning that something like: git checkout <branch>
ipfs get -o=<local-path> <ipfs-path>
ipfs mount <ipfs-path> <local-path>
# aside: these syntaxes may not be ideal. experimenting. Either of these could setup symlinks out for me and this may be exactly what i want. it is what we want in git. |
In a normal filesystem, a symlink is just stored as a string containing a path, with a flag set indicating that it's a link. So if IPFS supports something that behaves just like a normal symlink, there should be no problem supporting broken links -- if the stored path points to a place that doesn't exist, the link is broken. Whether 'ipfs cat' should support traversing symlinks, I'm not sure; I think they really only make sense in the context of a filesystem, so perhaps 'ipfs cat' should just issue an error or print the path. (Having it print the path seems like it might confuse tools though.) |
On Mon, Apr 20, 2015 at 07:12:49PM -0700, Juan Batiz-Benet wrote:
I've changed my mind, and decided that it's best to just store the
I had been tripping myself up by thinking about IPFS objects as $ ln -s .bashrc x The solution is just that folks authoring and consuming filesystems |
On Mon, Apr 20, 2015 at 07:13:35PM -0700, gwillen wrote:
It could be an absolute link, and the referenced path might exist on
Yeah. You could follow ‘cp’ and add a ‘--no-dereference’ flag, but I |
@wking so you think that if the symlink isnt broken (in whatever context) we should just follow it? |
@jbenet another question, if i implement symlinks in unixfs, path.Resolve wont understand paths containing symlinks, as path.Resolver doesnt understand unixfs. What do you think we should do there? |
Good question. I'm not sure. we can either:
I'd go with 1. for now but don't close doors on 2. |
On Mon, Apr 20, 2015 at 08:27:26PM -0700, Jeromy Johnson wrote:
Yes, unless an operation decides not to follow symlinks. E.g. if |
@wking If the goal is to be able to store a unix symlink into IPFS, and then retrieve it on another unix machine and have it behave the same, then it better just be a file with a path, in which case it will be (1) and not (2). I was going to propose some other type of object to fulfill (2), like some kind of ipfs-link, except that I can't think when such a thing would be useful -- since objects are content-addressed and immutable, any place you could use a link to an object, you can just use the object itself instead. (Unless you're linking from an ipfs merkledag into ip_ns_ -- that could be a place worth thinking about how a link could work.) |
On Mon, Apr 20, 2015 at 11:05:20PM -0700, Juan Batiz-Benet wrote:
I'm not clear on the unixfs/path.Resolve distinction, but I think { ‘ipfs cat/ls’ should dereference the symlink, but ‘ls’ might learn S_IFLNK 0120000 symbolic link so a symlink implementation might just be “add mode information to the
I think IPNS(-child) references are useful (see 1), and similar to |
On Tue, Apr 21, 2015 at 09:40:37AM -0700, gwillen wrote:
Right, and I want (1) for that reason. I also want (2) for
Exactly. Linking to “child of IPFS ” isn't very useful, |
IPFS doesn't track them yet [1]. [1]: ipfs/kubo#1104
We need to implement symlinks in unixfs. This is non-trivial, so I am opening this issue for some discussion on how we should do it.
We want to store symlinks as a path, just like a normal filesystem, but this presents us with a bit of awkwardness. What if I cat a symlink
ipfs cat <hash of link object>
what does it do?The text was updated successfully, but these errors were encountered: