Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add image to post from local device #93

Open
sondreb opened this issue Feb 14, 2023 · 12 comments
Open

Add image to post from local device #93

sondreb opened this issue Feb 14, 2023 · 12 comments
Assignees

Comments

@sondreb
Copy link
Member

sondreb commented Feb 14, 2023

While we should add support for pasting images directly into the content editor, we should also add a file browser option:

https://web.dev/progressively-enhance-your-pwa/

@vr-varad
Copy link
Contributor

vr-varad commented Apr 2, 2024

@sondreb , I hope you're doing well! I'm eager to contribute to this issue. If you could provide a bit more clarity on where exactly this feature needs to be integrated, I'd greatly appreciate it. Thank you kindly for your assistance.

@sondreb
Copy link
Member Author

sondreb commented Apr 2, 2024

The idea is basically similar to how GitHub supports uploading images, if you copy an image anywhere on your computer you can go into the chat box here and paste it in. It will upload and fill in the link to the image in the text.

Since we don't do live preview support on Notes (and neither does text editor on GitHub), implementing it similar to GitHub would be OK.

@vr-varad
Copy link
Contributor

vr-varad commented Apr 2, 2024

@sondreb could u assign me this issue I would like to work on it.

@miladsoft
Copy link
Member

I suggest that you think about uploading files to IPFS

@vr-varad
Copy link
Contributor

vr-varad commented Apr 4, 2024

@miladsoft which infrastructure service should I use as Infura is a prominent one and is currently out of service for ipfs?

@miladsoft
Copy link
Member

Fleek:

  • Fleek offers a JavaScript client library called @fleekhq/fleek-storage-js that facilitates interaction with their IPFS hosting and storage services.
  • You can install Fleek's npm package using the following command:
    npm install @fleekhq/fleek-storage-js
    

@miladsoft
Copy link
Member

I found out you can actually set up your own IPFS node using Docker, which makes it surprisingly easy. Think of Docker like a magic box that lets you run programs in these isolated environments. Pretty neat!

Here's what you'd need to do:

Grab Docker: First things first, you'll need Docker installed on your machine.

Download IPFS: With Docker set up, you can download the IPFS image using a simple command in your terminal (that's the command prompt thingy). It's like getting all the IPFS stuff ready to use.

Run Your Own Node: This is the exciting part! Another command in the terminal will fire up your very own IPFS node. You can customize where you want to store your IPFS data too. By the way, running your own node is way better than relying on services like Infura or Fleek – trust me!

Web Interface (Optional): If you prefer a more user-friendly way to interact with your node, there's actually a web interface you can access through your browser.

Use IPFS Commands: Once your node is up and running, you can use special commands to upload and download files. It's pretty straightforward!

That's it! You'll have your own IPFS node running on Docker, ready to explore the world of decentralized storage. If you get stuck anywhere or have any questions, feel free to ask – I'm happy to help!

@miladsoft
Copy link
Member

  1. Install Docker: First things first, make sure you have Docker installed on your computer. Docker lets you run applications in isolated environments called containers.

  2. Pull the IPFS Docker Image: Once Docker is set up, pull the IPFS Docker image from Docker Hub by running this command in your terminal:

    docker pull ipfs/go-ipfs
    

    This will download the IPFS image and get it ready for you to use.

  3. Run the IPFS Container: Time to fire up your IPFS node! Run this command in your terminal:

    docker run -d --name ipfs-node -v /path/to/ipfs-data:/data/ipfs -p 4001:4001 -p 5001:5001 -p 8080:8080 ipfs/go-ipfs
    

    Replace /path/to/ipfs-data with the directory where you want to store your IPFS data. This command will create a new container named ipfs-node running the IPFS node, and you can access it through ports 4001, 5001, and 8080.

  4. Access the IPFS Web UI (Optional): If you want a user-friendly interface, you can access the IPFS Web UI by going to http://localhost:5001/webui in your web browser.

  5. Use IPFS Commands: With your IPFS node up and running, you can start using IPFS commands to upload and download files. For example, to add a file, use:

    docker exec ipfs-node ipfs add /path/to/file
    

    And to download a file, use:

    docker exec ipfs-node ipfs get <CID>
    

    Replace <CID> with the Content Identifier (CID) of the file you want to download.

@vr-varad
Copy link
Contributor

vr-varad commented Apr 5, 2024

Thanks @miladsoft I have some experience with docker I will try to implement it and share the results.

@vr-varad
Copy link
Contributor

@miladsoft I was able to upload files at docker container of ipfs-go and was able to retrieve it how could I implement it to the code base could u give help me with that.

@miladsoft
Copy link
Member

Great work! I admire your perseverance.
Could you please share your code on GitHub here and specify that uploading files to IPFS requires running the IPFS in Docker first? Additionally, consider adding a section in the settings for inserting the addresses of servers implementing IPFS in Docker. I believe this would create a more comprehensive scenario.
Absolutely, @sondreb's input is invaluable, and I'm eager to hear his perspective on this matter too.

@vr-varad
Copy link
Contributor

@miladsoft I found doing it with docker a bit difficult so I did it with pinata and pushed in the pr.
I will try doing it with docker.
Thanks for guidance @miladsoft

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants