feat(desktop): add KLIPY GIF search to composers (#5554)

## Summary

- Supersedes #1913 with a KLIPY-hosted URL implementation.
- Adds KLIPY GIF search and trending results to desktop message and
forum composers.
- Keeps selected GIFs hosted by KLIPY; Buzz stores only the external URL
and media metadata (no imeta tag, since relays only accept hash-backed
local `/media/` entries).
- Aligns the Emoji/GIF picker with Buzz's standard segmented control,
theme surfaces, and motion behavior.

## Relay-to-provider boundary

- The relay proxies KLIPY search/share so the `BUZZ_KLIPY_API_KEY` never
reaches the desktop; the key stays server-side behind a redacted `Debug`
impl.
- The dedicated GIF `reqwest` client sets `redirect::Policy::none()`.
Because the API key rides in the request path, following a provider
`3xx` could replay a key-bearing URL to an attacker-chosen host (an
SSRF/key-disclosure primitive). With redirects disabled, a `3xx` returns
as a non-success status that the handlers map to a generic `502`; the
`Location` target is never read or forwarded.
- Admission reuses the established NIP-98, membership, replay, and
per-pubkey rate-limit gates, with an upstream response-size cap and
allowlisting so KLIPY error bodies never cross the relay boundary.

## Accessibility

- Under `prefers-reduced-motion: reduce`, the picker grid renders a
static provider poster (a normalized `jpg` asset) instead of the
animated preview, or a named static placeholder when no poster is
available. It reacts to preference changes while mounted.
`no-preference` keeps the animated preview.
- Selected GIFs carry their title through `ImetaMedia`'s `displayLabel`,
so the composer thumbnail, preview dialog, editor, lightbox, and remove
control all derive one non-empty accessible name instead of an empty
`Attachment ` label. Ordinary hashed uploads keep their existing
hash-derived names.

---------

Signed-off-by: kenny lopez <klopez4212@gmail.com>
Signed-off-by: Kenny Lopez <klopez4212@gmail.com>
Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
Signed-off-by: Duncan <dcfd242e557282d7a1e2cf2e6877522682f1e5c6156dc92ca7d90eaedd3b0f95@buzz.block.builderlab.xyz>
Signed-off-by: Hayt <9e1c23a3fd83f61da34420e4e88ff1b16e45cafcc0cd9019eb07d4ecfa8ca9b0@buzz.block.builderlab.xyz>
Co-authored-by: Princess Donut <b238ea756dee4d98afa5883fc7f1de61eeabe65bf700e3a5a5a80db5e42e2c2b@buzz.block.builderlab.xyz>
Co-authored-by: Duncan <dcfd242e557282d7a1e2cf2e6877522682f1e5c6156dc92ca7d90eaedd3b0f95@buzz.block.builderlab.xyz>
Co-authored-by: Will Pfleger <pfleger.will@gmail.com>
Co-authored-by: Hayt <9e1c23a3fd83f61da34420e4e88ff1b16e45cafcc0cd9019eb07d4ecfa8ca9b0@buzz.block.builderlab.xyz>
This commit is contained in:
klopez4212
2026-08-26 00:09:55 +01:00
committed by GitHub
parent e8cd7516e6
commit 8471049c43
34 changed files with 2215 additions and 146 deletions

View File

@@ -44,6 +44,12 @@ The chart is designed for ArgoCD and Flux. Both render charts with `helm templat
Production deploys MUST use `secrets.existingSecret:`. The Secret is consumed for any keys present and ignored for keys missing — extras are harmless.
To enable relay-proxied KLIPY search, add `BUZZ_KLIPY_API_KEY` to that Secret.
The key stays in the relay pod; clients discover the public `buzz-gif`
extension and `gif` descriptor in NIP-11, then receive KLIPY-hosted media URLs.
See [`docs/gif-search.md`](../../../docs/gif-search.md) for the protocol and
security boundaries.
See:
- [`examples/argocd-app.yaml`](examples/argocd-app.yaml) — ArgoCD Application

View File

@@ -12,6 +12,7 @@
# REDIS_URL — redis://... (required when replicaCount > 1)
# BUZZ_S3_ACCESS_KEY
# BUZZ_S3_SECRET_KEY
# BUZZ_KLIPY_API_KEY — omit to disable relay-proxied GIF search
apiVersion: v1
kind: Secret
metadata:
@@ -25,3 +26,4 @@ stringData:
REDIS_URL: "redis://:REPLACE@redis.buzz.svc.cluster.local:6379"
BUZZ_S3_ACCESS_KEY: "REPLACE"
BUZZ_S3_SECRET_KEY: "REPLACE"
BUZZ_KLIPY_API_KEY: "REPLACE"

View File

@@ -215,6 +215,12 @@ spec:
name: {{ include "buzz.envSecretName" . }}
key: BUZZ_S3_SECRET_KEY
optional: true
- name: BUZZ_KLIPY_API_KEY
valueFrom:
secretKeyRef:
name: {{ include "buzz.envSecretName" . }}
key: BUZZ_KLIPY_API_KEY
optional: true
- name: BUZZ_HUDDLE_AUDIO_AVAILABLE
value: {{ include "buzz.huddleAudioAvailable" . | quote }}

View File

@@ -80,6 +80,27 @@ tests:
optional: true
template: templates/deployment.yaml
- it: Deployment env points BUZZ_KLIPY_API_KEY at existingSecret as optional
set:
relayUrl: wss://buzz.example.com
ownerPubkey: "0000000000000000000000000000000000000000000000000000000000000000"
externalPostgresql.url: postgres://u:p@h:5432/d
s3.endpoint: http://minio:9000
s3.accessKey: a
s3.secretKey: s
secrets.existingSecret: "buzz-secrets"
asserts:
- contains:
path: spec.template.spec.containers[0].env
content:
name: BUZZ_KLIPY_API_KEY
valueFrom:
secretKeyRef:
name: buzz-secrets
key: BUZZ_KLIPY_API_KEY
optional: true
template: templates/deployment.yaml
- it: READ_DATABASE_URL stays optional against the chart-managed Secret
set:
relayUrl: wss://buzz.example.com

View File

@@ -94,6 +94,7 @@ ownerPubkey: ""
# REDIS_URL — full Redis URL with auth
# BUZZ_S3_ACCESS_KEY — S3 access key
# BUZZ_S3_SECRET_KEY — S3 secret key
# BUZZ_KLIPY_API_KEY — KLIPY GIF search key; omit to disable GIF search
secrets:
existingSecret: ""
# Inline overrides (NOT recommended for production; they land in values).