Media Server¶
The media server implements Blossom and NIP-96. Users authenticate with their Nostr key.
deploy/scripts/blossom.sh
| Service | Port | Role |
|---|---|---|
blossom |
7800 | Uploads, lists, deletion |
blossom-edge |
7801 | Cache for downloads |
Set BLOSSOM_URL and BLOSSOM_EDGE_URL to the addresses that users see. Signatures of requests contain the address, so they must match.
Upload¶
A client sends the file with an authorization event (kind 24242 for Blossom, 27235 for NIP-98) that covers its digest. The server verifies the digest, stores the file and returns a descriptor with address, size and type. The response includes an event of kind 1063 signed by the server as a receipt.
Files are owned by their uploaders. If several users upload the same file, it is stored once and removed when the last owner deletes it.
Restrict¶
| Variable | Meaning |
|---|---|
BLOSSOM_WRITERS |
Keys that may upload. All if empty |
BLOSSOM_TYPES |
Accepted types, for example image/*,video/mp4. All if empty |
BLOSSOM_MAX_BYTES |
Largest file. 1 GiB by default |
Mirror¶
PUT /mirror copies a file from another server by address. The digest is verified. Private addresses are refused unless BLOSSOM_ALLOW_PRIVATE=true.
Edges¶
Edges cache files by digest up to BLOSSOM_CACHE_BYTES and serve them with ranges. When a file is deleted, the server purges it from all edges in EDGES.