-
Notifications
You must be signed in to change notification settings - Fork 111
Let's update the Swarm Manifest #878
Comments
Having default entry as a path in manifest is more intuitive as it is closer to web server configuration. Even if this is something that I would like to see in manifests, there are more reasons against it. Current manifest implementation stores only the hash for the empty path. As manifests are mostly read for getting file content, not for looking up or manipulating manifest structure by the users directly, I am not sure that this change adds more value, except that it makes manifests more flexible for possible future features. Currently, default entry serves more like an index for default entry, not like a reference, for performance reasons I assume, but as manifest structure is not intended for users, this is fine. If changing to path based default entry, I for not changing the manifest entry type, but for adding a field to the manifest type to specify the default entry which has different fields then manifest entry type. But in general, I would still keep the current manifest structure, just for default page performance. For more complex web sites on swarm, and even for single page javascript applications, I think that path matching is a better approach then having an implicit feature to serve the same content for subpaths (overmatch, undermatch). It may be better for users to have the freedom to construct routing, including redirections, for their own web application. Default entry is a special case, but I still do think that it needs to perform the best as possible, with hash reference. |
What is missing of course right now is any tooling to manipulate manifests. Having the path reference instead of the hash is only slower if |
for example for ACTs |
In my endeavor to try and crunch the information a bit more, I can give further input regarding the issues above, and add more on top: no empty directory representation:As of now, except for manually tampering and editing a manifest, there exists no way in swarm to represent an empty directory in a manifest. That is since directory manifests and trie split entries have no distinctions. This is due to the fact that directories have no formal representation in swarm. default entry behaviourDefault entry path has to be manually specified in the CLI. This should be mended and we should at least try to identify a default default entry is a manifest entryThis should not be the case, and it should be specified on the manifest metadata level as this introduces redundant data into the manifest entries data structure. inconsistent naming conventions in the manifest definition
allowing redirections and symlink alignmentCan be resolved with adding a symlink file type as @lmars suggested in ethereum/go-ethereum#14345 (comment) Tasks:
NOTE: Unix FS allows everything except
Trailing slash problem:
Possible solutions:
references:#156 - manifests without a default path should default to list request |
Uh oh!
There was an error while loading. Please reload this page.
We've long talked about updating the Swarm Manifest data structure to allow for more advanced use-cases from path based routing to query string management.
This Issue collects all the changes we discussed over time.
Default entry is a path not a hash
Thus a manifest in which the default is index.html should no longer have the empty path
''
associated with ahash
that happens to be the same hash as that associated withindex.html
but rather it should have adefault
entry which maps toindex.html
. While we might sometimes need more bzz manifest lookups, we gain simplicity in housekeeping.Related issues and discussions
#162 https://gist.github.com/homotopycolimit/7b70436326535ef19028f836680a1f3c
#178 (comment)
https://gist.github.com/homotopycolimit/a83ad855a03190463738e93fcf6aa339
#824
Manifest can define its own routing / path matching
We discussed having a 'directory' type manifest which adheres to specific rules (eg. any entry ending in
/
has to be of type bzz-manifest+json ) and which can always be FUSE mountable. We discussed having other manifests which explicitly state what to do with over / undermatched paths. For example if a manifest contains only'index.html
what should be done withindex.h
or withindex.html?a=b
? If we want to enable apps that use path based routing, then manifests need to be more flexible in how they handle bzz queries - perhaps even allowing regular expressions?We can also imagine allowing manifests to specify HTTP 301 redirect entries which would map to symlinks in fuse. We need discussion on this.
See also ethereum/go-ethereum#14349 (as well as the discussions linked above)
prepare cli commands to work with new manifest
swarm --recursive up
should generate directory manifest typesswarm fs
should warn when attempting to mount non directory manifest types (or even fail).swarm up file
should generate a manifest with a named file and a default entry referring to the file as opposed to an unamed default file only.Related to this question is that of cleaning up the bzz-list output
#726
#156
Docs
The text was updated successfully, but these errors were encountered: