damus icon indicating copy to clipboard operation
damus copied to clipboard

Media uploads: enforce file length limit for non nostr.build accounts before upload

Open jb55 opened this issue 1 year ago • 1 comments

To do this, we need a way to know if the current user has a nostr build account. Maybe some kind of quick http nostr auth to test.

  • [ ] https://github.com/damus-io/damus/issues/2215

Once we know if we have a nostr.build account, then we can know what the size limit on uploads are.

Perhaps this should be generalized with NIP-96 metadata, not sure if it has this

  • [ ] #1564

@fishcake advised:

https://developer.apple.com/documentation/avfoundation/avassetexportsession/1622333-filelengthlimit

jb55 avatar May 06 '24 21:05 jb55

~~@fishcakeday let me know what is the best way to get the file size limit.~~

curl https://nostr.build/api/v2/upload/limit is implemented, it will check based on your NIP98 authentication or return a free upload limit by default with no headers:

  • https://github.com/damus-io/damus/issues/2215#issuecomment-2096986538

jb55 avatar May 06 '24 21:05 jb55