1 Dec 2021 |
mauve | In reply to @_discord_215865804040699904:ipfs.io I just watched, good stuff! I hope soon I won't have to ask the user to install ipfs and configure the node to interact with my website. edit it's also not secure at all js-ipfs-fetch should be able to start an IPFS node right in your webapp, but the reliability isn't as good as running a go-ipfs node locally. Also not 100% sure how good the IPNS stuff is in a browser js-ipfs node. | 17:20:55 |
mauve | Could you elaborate on what you mean by it not being secure at all? (like, no access restrictions between web pages?) | 17:21:23 |
SionoiS#5373 | I'm ask the user to allow my website access to their node via http which means that If I'm a bad guy I could unpin/pin stuff or change their config. | 17:23:46 |
SionoiS#5373 | * I'm asking the user to allow my website access to their node via http which means that If I'm a bad guy I could unpin/pin stuff or change their config. | 17:23:53 |
SionoiS#5373 | defluencer.eth.limo | 17:24:06 |
mauve | Ah yeah absolutely. Having a permissions prompt might be useful here. Not sure how fine-grained it should be since too much access control could annoy users and make them accept absolutely whatever. | 17:24:58 |
SionoiS#5373 | I think the blockstore could be separated per origin it would help with the pinning/unpin | 17:25:41 |
SionoiS#5373 | We already have promts for webcam and mics so maybe one for ipfs IDK | 17:26:18 |
mauve | How do you feel about the auto-pinning via IPNS stuff? I'm thinking it'd look like this: a website wants to save data to IPNS. They ask to POST into an IPNS directory with a given key name, the user agent prompts the user to allow or deny access. If allowed then data can be posted in there and the user can either have it auto-pinned to a remote service or locally via the MFS functionality | 17:27:39 |
SionoiS#5373 | DO you have an example? | 17:28:57 |
SionoiS#5373 | any data a website would need to save like cookies? | 17:29:22 |
mauve | This is a hypothetical at the moment.
I'm basing the UX from what the Beaker Browser did for Hyperdrive.
A concrete example would be a "photos" app for IPFS. The app would want to save to ipns://my-photos/photos/ where my-photos is the name for a Public key
| 17:30:12 |
mauve | A user would drag and drop a photo into the app. Then the app would do a fetch('ipfs://my-photos/photos', {method: 'POST', body: formDataWithThePhoto}) APi call | 17:31:00 |
mauve | The user agent would then prompt the user "Such and such app wants to add data to ipns://my-photos , Allow/deny?" | 17:31:29 |
mauve | If allowed, any data saved to my-photos will be persisted in MFS locally | 17:31:46 |
mauve | The user can then pin the full public key IPNS URL to a service somewhere (once IPNS pinning is a thing) | 17:32:02 |
SionoiS#5373 | Yes that could work. the problem I see is that it's never just one file. If you add a photo, some metadata, how would that work? 2 calls? | 17:32:38 |
mauve | You can add a bunch of files with a FormData object | 17:33:28 |
mauve | https://github.com/RangerMauve/js-ipfs-fetch#await-fetchipfsexample-method-post-body-new-formdata | 17:33:51 |
SionoiS#5373 | Ah yes that would fine I guess | 17:34:00 |
mauve | But once you have been granted access to that IPNS domain, the website should be allowed to do whatever with it | 17:34:11 |
mauve | Kinda like how with camera prompts you can get acess to a camera for the rest of the session or forever | 17:34:37 |
mauve | At the moment (at least in Agregore) there's no prompts at all though and it's a free-for-all. :P | 17:35:09 |
SionoiS#5373 | That is good I can see it work very well. | 17:35:28 |
SionoiS#5373 | What about pubsub any ideas? | 17:36:26 |
mauve | The latest thoughts I had on that are here: https://github.com/AgregoreWeb/agregore-browser/issues/110#issuecomment-925205165 | 17:37:19 |
mauve | tl;dr using the EventSource API and a custom pubsib:// protocol. | 17:37:31 |
mauve | You can subscribe to events using the EventSource API, and use POST to a pubsub://Some_Topic_Here to broadcast events out | 17:38:06 |
SionoiS#5373 | That would be fantastic! | 17:39:21 |
mauve | Currently my IPFS work is focused on making a mobile version of Agregore and deploying it to a mesh network, but if anyone would be interested in getting changes into js-ipfs-fetch I'd be more than happy to help them figure it out. 😁 | 17:40:37 |