Slack integration: links on self-hosted domains never unfurl (parseCapShareUrl only accepts cap.so / cap.link)
I maintainer di solito rispondono entro 1 giorno
@mangeshraut712 ci sta già lavorando.
Dal 14/10/2026.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 72/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- nextjs, typescript
Direzione di ricerca
Inizia da parseCapShareUrl in apps/web/lib/oembed.ts, chiamata sia da processSlackEvent sia da /api/oembed, e verifica come serverEnv().WEB_URL viene già letto altrove in apps/web. Conferma che un link /s/<id> su un host diverso da cap.so restituisce oggi null. È completato quando un link di condivisione sull'host WEB_URL configurato si risolve in un ID video in entrambi i percorsi e i link su altri host continuano a restituire null.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- Rust
- Stelle
- 23.2k
- Fork
- 2k
- Merge medio
- 1g 10h
- PR unite (30g)
- 100
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di CapSoftware/Cap
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
CapSoftware/Cap#2384 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Dashboard pagination causes full page reloads on self-hosted CapForse già presa @Dewin l’ha presa 26 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
CapSoftware/Cap#2305 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
CapSoftware/Cap#1714 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
perf: investigate redundant caption lookup passes during renderingForse già presa @KrishCodesw l’ha presa oggi. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
CapSoftware/Cap#2523 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
GPUI playback hitches during background edits on long recordingsForse già presa @AksharP5 l’ha presa oggi. Aperta
Difficoltà 3/5 Mezza giornata Idoneità per principianti 45/100
CapSoftware/Cap#2506 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di CapSoftware/Cap
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
I maintainer di solito rispondono entro 1 giorno
-
V1 manifest lists written by Java lose added/existing/deleted file countsForse già presa @kacper-li-airspace-intelligence l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
apache/iceberg-rust#3445 ·
I maintainer di solito rispondono entro 4 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
I maintainer di solito rispondono entro 1 giorno
-
area::tern-sync kind::cleanup triage::ready
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
review-bot
Difficoltà 2/5 1-3 ore Idoneità per principianti 64/100
midagedev/bloomery#160 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno