2022-08-18 17:26:45 +02:00
# Akkoma module for IPFS as uploader
2022-08-18 17:53:05 +02:00
## Important, please read
**This module replaces the default `upload.ex` file to implement the IPFS uploader,
2022-08-18 17:26:45 +02:00
this because Elixir doesn't implement Monkey Patching and without the
2022-08-18 17:53:05 +02:00
modified `upload.ex` Akkoma won't return the right base url back.**
2022-08-18 17:26:45 +02:00
### Installation
2022-08-18 17:53:05 +02:00
* Enter in the module folder of akkoma (defined in the `config.exs` , by default Akkoma uses this: `/var/lib/akkoma/modules` )
* Clone this repo inside (only the .ex files will be loaded by Akkoma)
2022-08-18 17:26:45 +02:00
### Cheatsheet
* `post_gateway_url` : URL with port of POST Gateway (unauthenticated)
* `get_gateway_url` : URL of public GET Gateway
2022-09-23 15:32:14 +02:00
* `api_add_params` : List of params compatible with `/api/v0/add` : https://docs.ipfs.tech/reference/kubo/rpc/#api-v0-add, if not provided will be default to `['cid-version': 1]`
2022-08-18 17:26:45 +02:00
### Example
2022-08-18 17:53:05 +02:00
*config.exs*
2022-08-18 17:26:45 +02:00
```elixir
config :pleroma, :modules, runtime_dir: "instance/modules"
config :pleroma, Pleroma.Uploaders.IPFS,
post_gateway_url: "http://localhost:5001",
2022-09-23 15:32:14 +02:00
get_gateway_url: "https://{CID}.ipfs.mydomain.com",
api_add_params: ['cid-version': 1, hash: "blake3"]
2022-08-18 17:26:45 +02:00
config :pleroma, Pleroma.Upload,
uploader: Pleroma.Uploaders.IPFS
```
2023-03-18 10:19:43 +01:00
### Akkoma commit alignment group by branch
- master: fef4bae0067fcd6e102e3d625390e8ae909c6bb8
- develop: fef4bae0067fcd6e102e3d625390e8ae909c6bb8