Open jbenet opened 10 years ago
@groundwater you'll want this in NodeOS, i think :) -- give me two weeks and IPFS may be stable enough for it.
This is kind of like a lazy install of modules.
I'm also interested in what things we can dream up when file-systems and mounts are easy and safe to hack on. Kinda like FUSE, but without the constant segfaults :smile:
Kinda like FUSE, but without the constant segfaults
FUSE gives you segfaults!? I've yet to see this-- perhaps I'll run into it shortly. Is this osx or linux?
It gives me segfaults because I'm causing them. Basically I'm a shitty FUSE developer =]
@mlovci precisely. The divide between web and fs is really stupid and it's time to end it. We don't do http requests on ever file open, and with good reason. Need a better protocol :)
Retrieving and caching content is pretty straight forward. How would you deal with directory listing?
@groundwater I wouldn't. Don't list root (-r+x on dir). Do list under keywords/
, author/<username>/
, etc.
Would you use FUSE?
More like, i will use FUSE ;)
Too bad we can't just patch the fs
module.
For @mikolalysenko:
Below, it could easily be foo@version
or foo/version
. I'm opting for foo@version
because i like it more. You can also keep the node_modules/
but i took it out below. Con
/ipns/npmjs.org/package/foo@1.0.0
/ipns/npmjs.org/package/foo@1.0.1
/ipns/npmjs.org/package/bar@1.0.0
/ipns/npmjs.org/package/bar@1.0.0/foo@1.0.0 (same object as .../foo@1.0.0 above)
/ipns/npmjs.org/package/baz@1.0.0
/ipns/npmjs.org/package/baz@1.0.0/foo@1.0.1 (same as .../foo@1.0.1)
/ipns/npmjs.org/package/bork@1.0.0/bar@1.0.0 (same as .../bar@1.0.0)
/ipns/npmjs.org/package/bork@1.0.0/baz@1.0.0 (same as .../baz@1.0.0)
cc @mafintosh and @maxogden
@jbenet wouldn't I need to list the /ipns/npmjs.org/package (which can be HUGE) to match a semver using the above approach?
@mafintosh where match here means resolve something like >=1.2.3
? Ah, then maybe we do want name/version
in top level:
/ipns/npmjs.org/package/foo/1.0.0
/ipns/npmjs.org/package/foo/1.0.1
/ipns/npmjs.org/package/bar/1.0.0/foo@>=1.0.0 # only needs to list /ipns/npmjs.org/package/foo/
/ipns/npmjs.org/package/baz/1.0.0/foo@^1.0.1
Yes this makes it a lot easier :) I would probably also not include sub dependencies. I don't really see the benefit of having them.
@mafintosh we get subdependencies for free.
/ipns/npmjs.org/package/foo/1.0.0
/ipns/npmjs.org/package/bar/1.0.0
/ipns/npmjs.org/package/bar/1.0.0/foo@>=1.0.0
/ipns/npmjs.org/package/bork/1.0.0/bar@>=1.0.0
# \o this resolves to bar/1.0.0 above, which already has foo@>=1.0.0
content-addressed deduplication :) !
Nice!!
Random stranger stopping by to say that these are awesome thoughts :) .
@jbenet
- Jonathan
check the nix package managed and nixos - http://nixos.org/ - https://nixos.org/nix/
Why would this only be at that layer?
If you want to go that route, create a Linux distro that mounts IPFS early enough in the chain, then symlink all the normal filenames to IPNS addresses that always have the latest released version. Instant always up to date system.
You need reproducible builds to do this securely, along with Guix or NixOS tool for keeping package options straight.
Today's paradigm includes installing software. It's really silly, having to go find a particular package, and then download it manually. Our package managers should just make the code available. If it can be found in the registry, it should be importable in the code.
How?
Easy, mount the registry:
Or, in my world:
Concerns
Security is not about installing software X at time Y, but about checking integrity (hash the code) and authenticity (sign the code). This could be done on import, every single time you run the code, which would be much safer than just hoping all your files are the same as when you last looked at them. You did look at all the modules you imported, right? You are sure that
foobar
module you used doesn't actually open a back door, right?Not at all, things will be cached locally, and just make sure things stay local, why not pin them?
Basically, make your "mounted registry" save things locally that you're going to use regularly. (IPFS will do this for you).
And you should! Lock your local files to exactly the modules you want: