I wanted to create a React web app, where users could join Rooms (WebSockets), and all have access to all the files uploaded to the rooms.
Upon loading of the rooms, when a new user joins in, they could have access to the files (CIDs), and thus download them.
I wanted to know whether this idea makes sense in theory, or whether there are inherent security flaws which I might have overlooked due to my limited understanding😅
What would be the right way of approaching this technically too?
Welcome to the IPFS forum,
While it’s possible to do something like your idea, the details of how you do this can affect the implementation significantly.
Some pointers/open questions to think about:
- CIDs are public by default in the IPFS network. How important is access control? You could achieve this by adding a layer of encryption but that would increase the complexity significantly
- Where do you store the files and application state?
- Do you intend on rely on a long running IPFS node, i.e. Kubo, for file storage? For browsers to connect to Kubo nodes using Websockets you will need to ensure you have a TLS certificate for your Kubo node.
I’d recommend checking out the following guide Create a simple chat app | IPFS Docs to get some inspiration (source: GitHub - TheDiscordian/browser-ipfs-chat: Simple demo showing off browser js-ipfs capabilites.).
Thanks a lot for the quick reply!
I wanted to store the files on web3.storage
Access Control is important, and I think I can achieve this by using a layer of AES Encryption before uploading it to the storage, but it increases the complexity, like you mentioned.
Another idea I had is to implement verification using tokens from session storage in the browser
So if the user’s have the tokens with values matching the room, they would be allowed to view the content in the room.
The token could be set by the link shared by the uploader in this case.
The idea is for users to join the room, and then allow a file transfer to take place using web3.storage, the file can be accessible from the IPFS via a gateway, but I’m not sure how to connect my room to the storage.
Does this sound right?
Will I need a TLS certificate if I use a HTTP gateway?
What would the recommended technical approach to create rooms and connect them with the storage be if I use web3.storage?