mirror of
https://git.v0l.io/florian/bouquet.git
synced 2025-03-17 16:43:00 +01:00
chore: Removed auth token for thumb generation
This commit is contained in:
parent
40c3dfa907
commit
b7c27ddc8a
@ -6,6 +6,8 @@ A tool to manage your content on blossom severs (Upload, Distribution, Posting)
|
||||
|
||||
## TODO / Ideas
|
||||
|
||||
Add cancel button for upload stream
|
||||
|
||||
Add Blurhash
|
||||
https://github.com/verbiricha/filestr/blob/master/src/blur.tsx
|
||||
|
||||
|
@ -98,9 +98,44 @@ const FileEventEditor = ({ data }: { data: FileEventData }) => {
|
||||
// await ev.publish();
|
||||
};
|
||||
|
||||
/*
|
||||
async function createDvmBlossemAuthToken() {
|
||||
const pubkey = ndk.activeUser?.pubkey;
|
||||
if (!ndk.signer || !pubkey) return;
|
||||
const tenMinutes = () => dayjs().unix() + 10 * 60;
|
||||
const authEvent = ({
|
||||
pubkey,
|
||||
created_at: dayjs().unix(),
|
||||
kind: 24242,
|
||||
content: 'Upload thumbail',
|
||||
tags: [
|
||||
['t', 'upload'],
|
||||
['name', `thumb_${Math.random().toString(36).substring(2)}`], // make sure the auth events are unique
|
||||
['expiration', String(tenMinutes())],
|
||||
],
|
||||
});
|
||||
const ev = new NDKEvent(ndk, authEvent);
|
||||
await ev.sign();
|
||||
console.log(JSON.stringify(ev.rawEvent()));
|
||||
return btoa(JSON.stringify(ev.rawEvent()));
|
||||
}
|
||||
*/
|
||||
|
||||
const getThumbnails = async (data: FileEventData) => {
|
||||
if (!ndk.signer) return;
|
||||
|
||||
const thumbCount = 3;
|
||||
|
||||
/*s
|
||||
const authTokens = [];
|
||||
for (let i = 0; i < thumbCount; i++) {
|
||||
const uploadAuth = await createDvmBlossemAuthToken();
|
||||
if (uploadAuth) {
|
||||
authTokens.push(['param', 'authToken', uploadAuth]);
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
const e: NostrEvent = {
|
||||
created_at: dayjs().unix(),
|
||||
content: await ndk.signer?.encrypt(
|
||||
@ -108,19 +143,15 @@ const FileEventEditor = ({ data }: { data: FileEventData }) => {
|
||||
JSON.stringify([
|
||||
['i', data.url[0], 'url'],
|
||||
['output', 'image/jpeg'],
|
||||
['param', 'thumbnailCount', '3'],
|
||||
['param', 'imageFormat', 'jpg'],
|
||||
['param', 'thumbnailCount', `${thumbCount}`],
|
||||
['relays', user?.relayUrls.join(',') || ndk.explicitRelayUrls?.join(',') || ''],
|
||||
])
|
||||
),
|
||||
tags: [['p', dvm.pubkey], ['encrypted']],
|
||||
/*tags: [
|
||||
['i', data.url[0], 'url'],
|
||||
['output', 'image/jpeg'],
|
||||
['param', 'thumbnailCount', '5'],
|
||||
['param', 'imageFormat', 'jpg'],
|
||||
['relays', user?.relayUrls.join(',') || ndk.explicitRelayUrls?.join(',') || ''],
|
||||
],*/
|
||||
tags: [
|
||||
['p', dvm.pubkey],
|
||||
['encrypted'],
|
||||
// TODO set expiration
|
||||
],
|
||||
kind: 5204,
|
||||
pubkey: user?.pubkey || '',
|
||||
};
|
||||
@ -133,7 +164,7 @@ const FileEventEditor = ({ data }: { data: FileEventData }) => {
|
||||
|
||||
useEffect(() => {
|
||||
if (fileEventData.m?.startsWith('video/') && fileEventData.thumbnails == undefined) {
|
||||
// getThumbnails(fileEventData); skip for now, until the DVM is properly hosted
|
||||
getThumbnails(fileEventData);
|
||||
}
|
||||
}, [fileEventData]);
|
||||
|
||||
@ -143,7 +174,7 @@ const FileEventEditor = ({ data }: { data: FileEventData }) => {
|
||||
<>
|
||||
{thumbnailRequestEventId &&
|
||||
(fileEventData.thumbnails && fileEventData.thumbnails.length > 0 ? (
|
||||
<div className='w-2/6'>
|
||||
<div className="w-2/6">
|
||||
<div className="carousel w-full">
|
||||
{fileEventData.thumbnails.map((t, i) => (
|
||||
<div id={`item${i + 1}`} key={`item${i + 1}`} className="carousel-item w-full">
|
||||
@ -157,7 +188,7 @@ const FileEventEditor = ({ data }: { data: FileEventData }) => {
|
||||
key={`link${i + 1}`}
|
||||
href={`#item${i + 1}`}
|
||||
onClick={() => setFileEventData(ed => ({ ...ed, thumbnail: t }))}
|
||||
className={'btn btn-xs ' + (t==fileEventData.thumbnail ? 'btn-primary':'')}
|
||||
className={'btn btn-xs ' + (t == fileEventData.thumbnail ? 'btn-primary' : '')}
|
||||
>{`${i + 1}`}</a>
|
||||
))}
|
||||
</div>
|
||||
@ -200,7 +231,13 @@ const FileEventEditor = ({ data }: { data: FileEventData }) => {
|
||||
placeholder="Caption"
|
||||
></textarea>
|
||||
<span className="font-bold">URL</span>
|
||||
<div className=''>{fileEventData.url.map((text,i) => <div key={i} className='break-words mb-2'>{text}</div>)}</div>
|
||||
<div className="">
|
||||
{fileEventData.url.map((text, i) => (
|
||||
<div key={i} className="break-words mb-2">
|
||||
{text}
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
<button className="btn btn-primary" onClick={() => publishFileEvent(fileEventData)}>
|
||||
Publish
|
||||
</button>
|
||||
|
58
userstories.md
Normal file
58
userstories.md
Normal file
@ -0,0 +1,58 @@
|
||||
|
||||
I am currently thinking about the use cases I want to support with bouquet for UPLOADING to blossom servers.
|
||||
|
||||
As a primal web user I want to upload an image to multiple blossom servers to post it on the primal web app.
|
||||
|
||||
As a user I want to upload and share an arbitrary file (kind 1063) publicly so the file can be found by querying for the SHA-256 hash (x tag).
|
||||
|
||||
As a photographer I want to upload multiple images to multiple blossom servers and publish them as an image album (list of images, maybe slide sets 30388). [3]
|
||||
|
||||
As a tiktok user I want to upload a vertical video and post it to nostr (kind: 34236) [1]
|
||||
|
||||
As a video creator I want to upload a video (16:9) and post it to nostr (flare.pub kind 34235) [1]
|
||||
|
||||
As a music creator I want to upload a single audio track and publish it to nostr. (kind: 31137) [2]
|
||||
|
||||
As a music collector I want to upload a complete album to nostr incl. album art and metadata (audio: 31137, playlist: 30029). [2]
|
||||
|
||||
As a builder I want to upload 3D printing models to ...
|
||||
|
||||
|
||||
|
||||
[1] https://github.com/nostr-protocol/nips/pull/923/files
|
||||
|
||||
[2] https://github.com/nostr-protocol/nips/pull/1043
|
||||
|
||||
[3] https://cornychat.com/datatypes#kind30388slideset
|
||||
|
||||
|
||||
|
||||
Bouquet
|
||||
|
||||
Overview
|
||||
|
||||
bouquet.slidestr.net is a tools for blossom servers that allows a user to upload content and manage his/her blobs.
|
||||
|
||||
The following are example use cases for Bouquet.
|
||||
|
||||
Usecases
|
||||
|
||||
As a primal web user I want to upload an image to multiple blossom servers to post it on the primal web app.
|
||||
|
||||
As a user I want to upload and share an arbitrary file (kind 1063) publicly so the file can be found by querying for the SHA-256 hash (x tag).
|
||||
|
||||
As a photographer I want to upload multiple images to multiple blossom servers and publish them as an image album (list of images, maybe slide sets 30388). [3]
|
||||
|
||||
As a tiktok user I want to upload a vertical video and post it to nostr (kind: 34236) [1]
|
||||
|
||||
As a video creator I want to upload a video (16:9) and post it to nostr (flare.pub kind 34235) [1]
|
||||
|
||||
As a music creator I want to upload a single audio track and publish it to nostr. (kind: 31137) [2] As a music collector I want to upload a complete album to nostr incl. album art and metadata (audio: 31137, playlist: 30029). [2]
|
||||
|
||||
References
|
||||
|
||||
https://github.com/nostr-protocol/nips/pull/923/files
|
||||
|
||||
https://github.com/nostr-protocol/nips/pull/1043
|
||||
|
||||
https://cornychat.com/datatypes#kind30388slideset
|
Loading…
x
Reference in New Issue
Block a user