Slack integration: links on self-hosted domains never unfurl (parseCapShareUrl only accepts cap.so / cap.link)
Los mantenedores suelen responder en 1 día
Ya se ha fusionado un pull request relacionado.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 72/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- nextjs, typescript
Línea de trabajo
Empieza con parseCapShareUrl en apps/web/lib/oembed.ts, que llaman tanto processSlackEvent como /api/oembed, y revisa cómo ya se lee serverEnv().WEB_URL en otras partes de apps/web. Confirma que un enlace /s/<id> en un host distinto de cap.so devuelve null actualmente. Está terminado cuando un enlace para compartir en el host configurado de WEB_URL se resuelve a un ID de video en ambas rutas, y los enlaces en otros hosts siguen devolviendo null.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Description
On a self-hosted Cap server, the Slack integration never shows a preview or inline player for share links on the server's own domain.
The Slack app installs and connects fine, Slack sends link_shared events, and /api/integrations/slack/events returns 200, but Cap never calls chat.unfurl. Nothing is logged, so it fails silently.
Expected: a public link like https://video.example.com/s/<id> unfurls in Slack with the title, thumbnail and inline player, the same as cap.so links.
Actual: Slack shows a plain link. Because the app claims the domain, Slack also skips its own Open Graph preview, so it's worse than having no app installed.
Cause: processSlackEvent passes each link through parseCapShareUrl (apps/web/lib/oembed.ts), which only accepts Cap's hosted domains:
if (hostname === "cap.so" && segments.length === 2 && segments[0] === "s") {
videoId = segments[1];
}
if (hostname === "cap.link" && segments.length === 1 && segments[0] !== "video") {
videoId = segments[0];
}
For any other host it returns null, so the link is dropped before the video is looked up. /api/oembed uses the same function, so it returns 400 for the server's own links, even though the share page advertises that oEmbed URL.
Suggested fix: also accept the host of WEB_URL with the /s/<id> path:
const webHost = new URL(serverEnv().WEB_URL).hostname.toLowerCase().replace(/^www\./, "");
if ((hostname === "cap.so" || hostname === webHost) && segments.length === 2 && segments[0] === "s") {
videoId = segments[1];
}
This fixes both Slack unfurls and /api/oembed on self-hosted servers.
Reproduction
- Run Cap self-hosted with
WEB_URL=https://video.example.com(officialcap-webDocker image). - Create a Slack app from
apps/web/slack-app-manifest.json, replacingcap.sowithvideo.example.comin the unfurl domain, redirect URL and event URL. - Set
SLACK_CLIENT_ID,SLACK_CLIENT_SECRETandSLACK_SIGNING_SECRET, restart cap-web, and verify the event URL in Slack (it verifies). - In Cap: Organization Settings → Integrations → Slack → Connect (it connects).
- Use a public video with no password; the organization has no access email domain.
- Paste
https://video.example.com/s/<id>in a Slack channel. - No preview appears. The server receives the Slack event (200), and Slack never loads
/embed/<id>.
Quick check without Slack:
curl -s -o /dev/null -w "%{http_code}\n" \
"https://video.example.com/api/oembed?url=https%3A%2F%2Fvideo.example.com%2Fs%2F<id>&format=json"
# returns 400 (expected 200 with oEmbed JSON)
Additional Context
- Cap version: official
ghcr.io/capsoftware/cap-webDocker image built 2026-09-07 (arm64sha256:5b65d137f7f7ddd767e1acb37380a4609f43287458410515a013157b56cfa83d). The sameparseCapShareUrlcode is onmaintoday. - Operating system, version: server is Linux arm64 (AWS ECS Fargate), self-hosted with Aurora MySQL and S3,
NEXT_PUBLIC_IS_CAPnot set. Slack desktop app on macOS. - Device (optional): n/a (server-side issue)
- Related: #2058 (Slack integration), #2122 / #2123 (share metadata on custom domains). Those fixed the Open Graph tags; this is the separate Slack-app path.
- Lenguaje dominante
- Rust
- Estrellas
- 23.2k
- Forks
- 2k
- Merge medio
- 1 d 6 h
- PR fusionados (30 d)
- 127
Preparar el entorno
- Incluye un Dockerfile o un archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de CapSoftware/Cap
-
Web player intercepts ⌘⇧M and blocks Chrome profile-menu shortcutPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 80/100
CapSoftware/Cap#2596 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
CapSoftware/Cap#2384 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dashboard pagination causes full page reloads on self-hosted CapPosiblemente ocupada @Dewin la tomó hace 28 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
CapSoftware/Cap#2305 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
CapSoftware/Cap#1714 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
-
macOS: main-thread panic in tauri-runtime-wry 2.8.1 freezes Cap mid Instant recording; the crashed recording then can't be recovered or reuploadedPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 18/100
CapSoftware/Cap#2606 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
Todos los issues de CapSoftware/Cap
Issues similares
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
area:cli bug good first issue priority:medium
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
rtk-ai/rtk#4589 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 85/100
Los mantenedores suelen responder en 1 día
-
dependencies effort:low flow:chore rust
Dificultad 2/5 1-3 horas Aptitud para principiantes 64/100
jaroslawherod/micold-ai-ide#875 ·
Los mantenedores suelen responder en 1 día
-
priority: low
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
storytold/photocraft#6286 · 1 comentario ·
Los mantenedores suelen responder en 1 día