mirror of
https://github.com/block/buzz.git
synced 2026-10-31 22:41:12 +00:00
Add a NIP-98 client for the /api/admin/v1 relay API, surfaced as an "Admin console" section in Settings. Relay operators view deployment-wide moderation reports and product feedback, resolve/dismiss reports, update feedback status, and manage the operator/moderator staffing roster — no browser extension or bearer token required. The console auto-discovers the relay's admin origin from its NIP-11 document (admin_api field): on mount it fetches the connected relay's relay-information document, validates the advertised origin through AdminOrigin::parse, and auto-probes. The manual origin field remains as a pre-filled fallback for relays that do not advertise. Rust: - AdminOrigin value object: validates scheme+host+optional-port, rejects credentials/path/query/fragment; http:// only for loopback hosts - AdminRoute closed enum: no IPC surface accepts arbitrary URLs or paths; the signed URL is byte-identical to the fetched URL - Dedicated no-redirect reqwest client (SSRF guard: relay 3xx surfaced as error, NIP-98 header never forwarded across origins) - admin_probe: typed state enum (Nip98Authorized/Denied, TokenMode, Disabled, NotAdminApi, NetworkOrIntercepted); Nip98Authorized only on authenticated 2xx - NIP-11 admin-origin discovery command; advertised value treated as untrusted input and revalidated before use - NIP-98 signing via AppState::signing_keys() (Err in recovery mode); one retry on 401 with a fresh event - Response bounds enforced by Content-Length preflight and streaming byte counter; per-pubkey origin storage (atomic write, 0o600) TypeScript: - admin-console API wrappers for all Tauri commands; attachments return a Blob URL from caller-supplied MIME - AdminConsoleSettingsCard: auto-discovery + probe flow, per-pubkey state, honest copy for every probe state - AdminConsolePanel with Reports / Feedback / Staffing tabs - Settings panels split under the file-size ratchet Co-authored-by: Will Pfleger <pfleger.will@gmail.com> Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
107 lines
3.8 KiB
JSON
107 lines
3.8 KiB
JSON
{
|
|
"name": "buzz",
|
|
"private": true,
|
|
"version": "0.5.10",
|
|
"type": "module",
|
|
"scripts": {
|
|
"dev": "vite",
|
|
"build": "tsc && vite build",
|
|
"build:e2e": "tsc && vite build --mode e2e",
|
|
"typecheck": "tsc --noEmit",
|
|
"check:file-sizes": "node ./scripts/check-file-sizes.mjs",
|
|
"check:px-text": "node ./scripts/check-px-text.mjs",
|
|
"check:pubkey-truncation": "node ./scripts/check-pubkey-truncation.mjs",
|
|
"lint": "biome lint .",
|
|
"check": "biome check . && pnpm check:file-sizes && pnpm check:px-text && pnpm check:pubkey-truncation",
|
|
"format": "biome format --write .",
|
|
"test": "node --import ./test-loader.mjs --experimental-strip-types --test \"src/**/*.test.mjs\" && node --import ./test-jsdom-setup.mjs --import ./test-loader.mjs --experimental-strip-types --test-force-exit --test \"src/**/*.jsdom-test.mjs\"",
|
|
"preview": "vite preview",
|
|
"tauri": "tauri",
|
|
"test:e2e": "pnpm build:e2e && playwright test",
|
|
"test:e2e:smoke": "pnpm build:e2e && playwright test --project=smoke",
|
|
"test:e2e:integration": "pnpm build:e2e && playwright test --project=integration",
|
|
"test:e2e:report": "playwright show-report",
|
|
"tauri:build": "tauri build"
|
|
},
|
|
"dependencies": {
|
|
"@dnd-kit/core": "^6.3.1",
|
|
"@dnd-kit/sortable": "^10.0.0",
|
|
"@dnd-kit/utilities": "^3.2.2",
|
|
"@emoji-mart/data": "^1.2.1",
|
|
"@emoji-mart/react": "^1.1.1",
|
|
"@fontsource-variable/inter": "^5.2.8",
|
|
"@fontsource/jetbrains-mono": "^5.3.0",
|
|
"@mediapipe/tasks-vision": "^0.10.35",
|
|
"@radix-ui/react-alert-dialog": "^1.1.15",
|
|
"@radix-ui/react-avatar": "^1.1.11",
|
|
"@radix-ui/react-checkbox": "^1.3.3",
|
|
"@radix-ui/react-context-menu": "^2.2.16",
|
|
"@radix-ui/react-dialog": "^1.1.15",
|
|
"@radix-ui/react-dropdown-menu": "^2.1.16",
|
|
"@radix-ui/react-focus-scope": "^1.1.8",
|
|
"@radix-ui/react-popover": "^1.1.15",
|
|
"@radix-ui/react-separator": "^1.1.8",
|
|
"@radix-ui/react-slot": "^1.2.4",
|
|
"@radix-ui/react-switch": "^1.2.6",
|
|
"@radix-ui/react-tabs": "^1.1.13",
|
|
"@radix-ui/react-toggle": "^1.1.10",
|
|
"@radix-ui/react-tooltip": "^1.2.8",
|
|
"@tanstack/react-query": "^5.90.21",
|
|
"@tanstack/react-router": "^1.168.10",
|
|
"@tanstack/react-virtual": "^3.14.2",
|
|
"@tauri-apps/api": "~2.11",
|
|
"@tauri-apps/plugin-notification": "^2.3.3",
|
|
"@tauri-apps/plugin-opener": "~2.5",
|
|
"@tauri-apps/plugin-process": "^2.3.1",
|
|
"@tauri-apps/plugin-updater": "^2.10.0",
|
|
"@tiptap/core": "^3.22.3",
|
|
"@tiptap/extension-link": "^3.22.3",
|
|
"@tiptap/extension-placeholder": "^3.22.3",
|
|
"@tiptap/pm": "^3.22.3",
|
|
"@tiptap/react": "^3.22.3",
|
|
"@tiptap/starter-kit": "^3.22.3",
|
|
"class-variance-authority": "^0.7.1",
|
|
"clsx": "^2.1.1",
|
|
"embla-carousel-react": "^8.6.0",
|
|
"emoji-mart": "^5.6.0",
|
|
"jdenticon": "^3.3.0",
|
|
"lucide-react": "^1.0.0",
|
|
"motion": "^12.38.0",
|
|
"qrcode": "^1.5.4",
|
|
"qrcode.react": "^4.2.0",
|
|
"react": "^19.1.0",
|
|
"react-diff-view": "^3.3.2",
|
|
"react-dom": "^19.1.0",
|
|
"react-markdown": "^10.1.0",
|
|
"remark-breaks": "^4.0.0",
|
|
"remark-gfm": "^4.0.1",
|
|
"shiki": "^4.0.2",
|
|
"sonner": "^2.0.7",
|
|
"tailwind-merge": "^3.5.0",
|
|
"tiptap-markdown": "^0.9.0",
|
|
"upng-js": "^2.1.0",
|
|
"virtua": "0.49.3",
|
|
"yaml": "^2.8.3",
|
|
"zod": "^4.4.3"
|
|
},
|
|
"devDependencies": {
|
|
"@noble/hashes": "^2.0.1",
|
|
"@playwright/test": "^1.58.2",
|
|
"@tailwindcss/postcss": "^4.3.0",
|
|
"@tanstack/router-plugin": "^1.167.12",
|
|
"@tanstack/virtual-file-routes": "^1.161.7",
|
|
"@tauri-apps/cli": "~2.11.4",
|
|
"@testing-library/react": "^16.3.2",
|
|
"@types/react": "^19.1.8",
|
|
"@types/react-dom": "^19.1.6",
|
|
"@vitejs/plugin-react": "^6.0.0",
|
|
"jsdom": "^27.4.0",
|
|
"nostr-tools": "^2.23.3",
|
|
"postcss": "^8.5.8",
|
|
"tailwindcss": "^4.3.0",
|
|
"tw-animate-css": "^1.4.0",
|
|
"typescript": "~6.0.0",
|
|
"vite": "^8.0.0"
|
|
}
|
|
}
|