Skip to content

feat: simple, but not stupid, uploader for IPFS

This is a simple but not stupid implementation of an upload system for attachments using IPFS.

This requires to have a PUSH Gateway configured in your localhost server, where Pleroma runs too, we will call this PUSH-G. We will call the Public GET Gateway as GET-G.

Example config:

config :pleroma, Pleroma.Uploaders.IPFS,
  post_gateway_url: "http://localhost:5001/",
  get_gateway_url: "{CID}"

The parameter get_gateway_url expects a cid placeholder to be replaced by the real Content ID. So you can try to adjust to your Gateway configuration. Other examples:

To simplify the process, the uploader appends to the POST URL the ?cid-version=1 parameter. Why this choice? Because by using the cid version 1, we can allow more Gateway configurations. If we use the standard CID version, 0 to understand, only this one would work:{CID}

I'm looking forward to your feedback. Happy Hacking.

Edited by Claudio Maradonna

Merge request reports