-
Notifications
You must be signed in to change notification settings - Fork 2
Description
In order to reduce the dependency on the DNS it would be great if an IPFS URL like ipfs://<CID> could be returned as a fallback URL for files by Route96 so that it can be written as part of a media attachment (see NIP-92. The CID format is described here - here are also different tools mentioned that can create CIDs, including one for Rust)
This would allow to pin the files at some point in the future to IPFS and make them available via any IPFS gateway even if the original domains don't exist anymore and all regular URLs don't work anymore.
Maybe an even more generic approach could allow to run arbitrary external commands in Route96 after upload?
This should work for IPFS:
Installation
IPFS installation
Command to be run after a file is uploaded:
#!/bin/bash
# Usage: ./get-ipfs-url.sh yourfile.txt
if [ -z "$1" ]; then
echo "Usage: $0 <file>"
exit 1
fi
CID=$(ipfs add --only-hash -Q "$1")
echo "ipfs://$CID"
Run it on an uploaded file:
./get-ipfs-url.sh uploaded.webp
Generated fallback URL:
ipfs://QmAbC123xyz...