ipfs / kubo

An IPFS implementation in Go
https://docs.ipfs.tech/how-to/command-line-quick-start/
Other
16.18k stars 3.02k forks source link

Support storing UnixFS Owner #10577

Closed yuzhou-nj closed 1 week ago

yuzhou-nj commented 1 week ago

Checklist

Description

The ipfs add command supports --preserve-mode and --preserve-mtime. Is it possible to also support --preserve-owner? This would allow changes made by chown to be preserved when adding files with ipfs add.

for example:

# ipfs add --preserve-mode --preserve-mtime test.json
added QmbwaAtVk282BkCwK18FDXniC26sTmZqSJvwRAVPAm3fV8 test.json

# chown oracle test.json
# ipfs add --preserve-mode --preserve-mtime test.json
added QmbwaAtVk282BkCwK18FDXniC26sTmZqSJvwRAVPAm3fV8 test.json  <--not changed

thank you!

lidel commented 1 week ago

No, owner is not part of Unixfs 1.5 (only mode and mtime), so it is not possible atm.

If you want to preserve owner information, wrap your data in a TAR, and store that.

Adding support for it would require IPIP spec proposal in https://github.com/ipfs/specs/ and requires https://github.com/ipfs/specs/pull/331 to land first.

I'm closing this, because there is no spec for Kubo to implement, but if you would like to kick-off discussion about adding owner support to UnixFS specs, feel free to open issue in https://github.com/ipfs/specs/issues, or even propose an IPIP yourself.

If there is a spec, open issuer in Kubo to implement it.