ee9d9 - 1d
GM folks. Khatru devs: Heads up. I'm making some backwards-incompatible changes to Khatru's Blossom API, as previously agreed with nostr:nprofile1qqsrhuxx8l9ex335q7he0f09aej04zpazpl0ne2cgukyawd24mayt8gprfmhxue69uhhq7tjv9kkjepwve5kzar2v9nzucm0d5hszxmhwden5te0wfjkccte9emk2um5v4exucn5vvhxxmmd9us2xuyp. The three things to watch for are: 1. All blob-related events that take a sha256 will also receive a new string field (`ext`) with the file extension: https://github.com/fiatjaf/khatru/blob/v0.18.2/blossom/server.go#L17-L26 2. If khatru can't detect the blob contents, `ext` will be empty and `BlobDescriptor.Type` will be `application/octet-stream`, in accordance with the latest Blossom specs: https://github.com/hzrd149/blossom/blob/master/buds/01.md#get-sha256---get-blob 3. `GET /{sha256}` and `HEAD /{sha256}` will both pretty much ignore the file extension and return the blob with the `Content-Type` from the `BlobDescriptor`. E.g., if you upload a PDF and later request `{sha256}.jpg`, Khatru’s Blossom server will still serve the original PDF with `Content-Type: application/pdf`. (This is the best compromise given the current Blossom API, as agreed with nostr:nprofile1qqszv6q4uryjzr06xfxxew34wwc5hmjfmfpqn229d72gfegsdn2q3fgpzfmhxue69uhkummnw3e82efwvdhk6tcpz4mhxue69uhhyetvv9ujuerpd46hxtnfduhszythwden5te0dehhxarj9emkjmn99urf278z.) I'll ping you again when this is merged. Any thoughts or concerns, please let me know. nostr:nprofile1qqsw9n8heusyq0el9f99tveg7r0rhcu9tznatuekxt764m78ymqu36cpr3mhxue69uhhyetvv9ujucnfw33k76twwpshy6ewvdhk6tcpzdmhxue69uhhwmm59e6hg7r09ehkuef0qy2hwumn8ghj7un9d3shjtn4w3ux7tn0dejj7ne6u4e, nostr:nprofile1qqs2qzx779ted7af5rt04vzw3l2hpzfgtk0a2pw6t2plaz4d2734vngpzamhxue69uhhyetvv9ujumn0wd68ytnzv9hxgtcppemhxue69uhkummn9ekx7mp0qy2hwumn8ghj7un9d3shjtnyv9kh2uewd9hj7hycrvd, nostr:nprofile1qqst6jhruelzn9jdf9qhyfsac3fetjyld0fwwary9cmxzfchrhacragppemhxue69uhkummn9ekx7mp0qy2hwumn8ghj76n9d3k8jenfwd5zumrpdejz7yj9f6t (Feel free to ping anyone else who may be interested.) #devstr #khatru #blossom
It's already implemented (fiatjaf is fast:)). https://github.com/fiatjaf/khatru/blob/master/blossom/handlers.go#L396
And thanks for the zap by the way :)
With fiatjaf and utxo, blink for a second and they’ve already implemented everything. Honestly, folks started bothering fiatjaf about mirroring because of Primal, and 24 hours later it was already on Khatru. Meanwhile, I’m still trying to get GitHub Actions to build some binaries after a couple of months messing with it, lol. If I weren’t older than both of them, I’d say that when I grow up, I want to be like them :) Haven still has a compatibility issue with mirroring on Primal mobile (gracefully fixed by nostr:nprofile1qqsqxcftp6awpmydxqp3c3qt5zrllx73v2tzmla6fdhqy8ky4lt3y9spzemhxue69uhhyetvv9ujumn0wd68ytnzv9hxgqgswaehxw309ahx7um5wghxcctwvsq3qamnwvaz7tmwdaehgu3wwa5kuegrd0eh4 on Khatru). Otherwise, it’s working well (tested with Nak and Primal Web). When fiatjaf cuts the next version (hopefully with the changes I mentioned above) ’ll do some more testing on the mirror endpoint and update Haven. But if you’re using the latest master of Khatru, everything should already be working.
sudocarlos @sudocarlos - 1d
thanks for the shotout, but you and fiatjaf held my hand through all of that
is there a public branch or pr to follow?
The commit has your name in it :). Talk is cheap 🤣
Soon, I'll ping you the PR as soon as I'm more confident about it.