ts-odd icon indicating copy to clipboard operation
ts-odd copied to clipboard

Internal symlinks/softlinks

Open icidasset opened this issue 4 years ago • 3 comments

We have external symlinks already, pointing to a public or private part of another filesystem.

This would look something like this:

{
  ipns: "icidasset.files.fission.name",
  name: "example.file",
  key: aes_key,
  privateName: "..."
}

There's several routes we can take here:

  1. We could check if this ipns address is ours (check our username + tld in webnative setup)
  2. We replace ipns with an "internal property", like wnfs for example.
  3. We could set ipns to a constant, identifying an internal link, eg. ipns: "internal"

(1) requires the least amount of code, but has the downside of being restricted to a specific TLD. The external lookup will still work however, and I don't think this is a big issue with the current architecture.

What needs to happen

  1. Implement one of the internal link structures suggested above.
  2. The resolveSoftLink methods in the filesystem need to do the internal lookup when needed. Here: https://github.com/fission-suite/webnative/blob/fa245a0a550b62c1322485a70851b0fe16841c83/src/fs/v1/PublicTree.ts#L204 And here: https://github.com/fission-suite/webnative/blob/fa245a0a550b62c1322485a70851b0fe16841c83/src/fs/v1/PrivateTree.ts#L255

icidasset avatar Nov 25 '21 16:11 icidasset

(1) requires the least amount of code, but has the downside of being restricted to a specific TLD.

To add to that: (1) means the filesystem contains information about where it's supposed to be hosted. So e.g. if we had some way to rename fission accounts or ways to transfer a fission filesystem between usernames, then the filesystem would break more than if the links were agnostic about that.

matheus23 avatar Nov 29 '21 09:11 matheus23

@icidasset did this get shipped as part of shared private files? 🤞

expede avatar Jul 08 '22 19:07 expede

It didn’t sadly, only external symlinks.

icidasset avatar Jul 08 '22 20:07 icidasset