Closed bhstahl closed 7 years ago
IMO, viewing the contents of a subfolder is a feature (being able to browse related files that have been consciously shared together), whereas being able to view the root folder is not.
As I mentioned in #23, I think hiding subfolders or files in the root folder in their own "virtual directory" would solve this. Here's how it could be done on the command line.
➜ ~ echo "Hello" > hello.txt ➜ ~ mkdir hello_example_folder ➜ ~ mv hello.txt hello_example_folder ➜ ~ ipfs add -r hello_example_folder added QmY9cxiHqTFoWamkQVkpmmqzBrY3hCBEL2XNu3NtX74Fuu hello_example_folder/hello.txt added QmbK12JY5ouWwGba4UVibqiKCWq22bRSoZyDaR7mXMUBWz hello_example_folder
You can then view it like this on an IPFS gateway:
as well as being able to link directly to the file.
I believe this can be done using the IPFS API without actually creating a folder on the filesystem, or moving the file.
Agreed @mattseh I saw subfolder browsing as a feature as well but didn't consider that the root would feel like an invasion of privacy. I do agree now that you mention it though. I'll give these rules a shot:
Will a subfolder of the root folder be added inside a virtual folder? I think it should be, so then there is no listing of the root folder at all.
On 31 May 2017, at 12:10, Ben Stahl notifications@github.com wrote:
Agreed @mattseh I saw subfolder browsing as a feature as well but didn't consider that the root would feel like an invasion of privacy. I do agree now that you mention it though. I'll give these rules a shot:
Root files added by themselves in a virtual folder for file names Subfolders added recursively to allow browsing — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.
Yeah, I like that. Anything at the root is private, including folders, but whole folders can still be shared.
Great! This was preventing me from doing more than tests.
However it seems we can't share a folder from the root, and it makes the UX a bit inconsistent.
this is my tree:
Partyshare/
├── cox-2.png
├── seenthis
│ ├── 2017-05
│ │ └── partyshare.gif
…
└── visionscarto
└── projections
├── cox-1.png
…
I can share cox-2.png
file from the root folder, but not seenthis
or visionscarto
. (The seenthis/2017-05/
subfolder is shareable.)
OOps now I understand.
=> the URL given for a file is its "main subfolder"'s URL + path within that subfolder:
QmckjuZUrzudf5iwghpiHFWJVQeVVsVcGftjV4Aq6qK8tZ
+ /projections/lee-1.png
Intuitively I thought this would be something else (which seems way simpler and consistent):
if I share a file, I get $HASH/filename.png
; and if I share a directory, $HASH/dirname/
.
This way sharing a file would never expose anything else than the file itself, and sharing a folder (any folder within the root folder and its subfolders) would expose all the files contained in that folder, and only those.
I just played with this and it looks like how I suggested, thanks :)
Great @mattseh!
@Fil, I'm going to think a bit further about subfolders + subfolder-of-subfolders and come up with an ideal solution. Hearing your use cases is super helpful though!
Rather than recursively adding the entire folder, exposing the hash for the root of every file, each file (especially all files in each sub folder) should be added individually, so you cannot navigate to the root hash and see the list of files.
From #23