From 7611f3d2663ad91c206f93aa01067067449db972 Mon Sep 17 00:00:00 2001 From: SkateSpots Date: Mon, 12 Oct 2026 13:12:14 +0700 Subject: [PATCH] feat(media): self-host Blossom at blossom.skate-spots.org (primary upload target) Newlay's Blossom enabled on the relay box (blobs inside the data volume); Caddy + DNS + TLS wired. The app now uploads there first, keeping blossom.primal.net and blossom.band as mirrors, and includes it in BLOSSOM_MIRROR_HOSTS for read fallback. --- AGENTS.md | 14 ++++++++++++-- src/hooks/useUploadFile.ts | 13 +++++++------ src/lib/imageFallback.ts | 2 +- 3 files changed, 20 insertions(+), 9 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 87b3401..42ffab3 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -2079,8 +2079,8 @@ The community relay moved off the hosted relay.tools instance the proxy for ai/push/relay. - **Repo on the box:** `~/newlay`; config `~/newlay/deploy/docker/newlay.toml` (bind-mounted read-only into the container). `sudo docker compose up -d`. -- **Config choices:** `[tier.anon]` open read+write (no WoT gate, no spider, no - Blossom); `created_at_msecs_ago = 315360000000` (10 years — the default 365-day +- **Config choices:** `[tier.anon]` open read+write (no WoT gate, no spider); + `created_at_msecs_ago = 315360000000` (10 years — the default 365-day window silently dropped an old spot on restore); publishing/filter limits raised from the tight defaults. The relay is keyless (no NIP-43/NIP-29 membership). - **Data:** restored from the archive — **115/115 events, 17 authors**, every kind @@ -2105,6 +2105,16 @@ The community relay moved off the hosted relay.tools instance "recovered" message). The topic is in `/home/ubuntu/skatespots-health.env` (mode 600, not tracked) — subscribe to it in the ntfy app. Units tracked at `scripts/systemd/skatespots-health.{service,timer}`. +- **Media / Blossom (2026-10-12):** the relay also serves Newlay's Blossom at + **`blossom.skate-spots.org`** (a Caddy site block → the same `127.0.0.1:7777`; + blobs stored at `/var/lib/newlay/data/blobs`, INSIDE the data volume so they + survive container recreation). `[blossom] enabled = true`, + `upload_requires_membership = false` (no membership model), `public_base_url` + set. The app uploads there first (`useUploadFile` `UPLOAD_SERVERS`) and keeps + `blossom.primal.net` + `blossom.band` as mirrors; `BLOSSOM_MIRROR_HOSTS` + (`lib/imageFallback.ts`) includes it so reads fall back across all three. + Verified end-to-end (signed PUT /upload → 201, GET / → 200). To fully + self-host media later, drop the two public hosts from both lists. - **Cutover (2026-10-12):** `SKATE_RELAY` (`src/lib/types.ts`) → the new relay; the default pools, the DM/CVM/zap relay arrays, the `cvm-server` + `push-service` defaults, and the archive default all point at the new relay. diff --git a/src/hooks/useUploadFile.ts b/src/hooks/useUploadFile.ts index 200e53a..c12e329 100644 --- a/src/hooks/useUploadFile.ts +++ b/src/hooks/useUploadFile.ts @@ -4,13 +4,14 @@ import { BlossomUploader } from '@nostrify/nostrify/uploaders'; import { useCurrentUser } from "./useCurrentUser"; /** - * Two Blossom hosts. `BlossomUploader` signs ONE auth event and PUTs to every - * server in parallel, resolving with the first success — so the same bytes - * normally land on both from a single signature (no double Amber prompt). We then - * record a mirror URL on the returned tags so photo redundancy is explicit in the - * event; the read side also derives it from the sha256 (lib/imageFallback). + * Our own Blossom (blossom.skate-spots.org, on our relay box) plus two public + * mirrors. `BlossomUploader` signs ONE auth event and PUTs to every server in + * parallel, resolving with the first success — so the same bytes normally land on + * all of them from a single signature (no double Amber prompt). We then record a + * mirror URL on the returned tags so photo redundancy is explicit in the event; + * the read side also derives it from the sha256 (lib/imageFallback). */ -const UPLOAD_SERVERS = ['https://blossom.primal.net/', 'https://blossom.band/']; +const UPLOAD_SERVERS = ['https://blossom.skate-spots.org/', 'https://blossom.primal.net/', 'https://blossom.band/']; function hostOf(url: string): string { try { diff --git a/src/lib/imageFallback.ts b/src/lib/imageFallback.ts index 8f8e954..031fb0d 100644 --- a/src/lib/imageFallback.ts +++ b/src/lib/imageFallback.ts @@ -11,7 +11,7 @@ */ /** Hosts the app uploads to, and therefore the hosts we can mirror across. */ -export const BLOSSOM_MIRROR_HOSTS = ['blossom.primal.net', 'blossom.band']; +export const BLOSSOM_MIRROR_HOSTS = ['blossom.skate-spots.org', 'blossom.primal.net', 'blossom.band']; /** `<64-hex>` or `<64-hex>.` */ const HASH_RE = /^([0-9a-f]{64})(\.[a-z0-9]+)?$/i;