Slack integration: links on self-hosted domains never unfurl (parseCapShareUrl only accepts cap.so / cap.link)
Maintainers usually reply within 1 day
A pull request for this has already been merged.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 72/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- nextjs, typescript
Research direction
Start with parseCapShareUrl in apps/web/lib/oembed.ts, which processSlackEvent and /api/oembed both call, and check how serverEnv().WEB_URL is already read elsewhere in apps/web. Confirm that a /s/<id> link on a non-cap.so host returns null today. Done when a share link on the configured WEB_URL host resolves to a video ID in both paths, and links on other hosts still return null.
Written by the indexing model from the issue text.
Description
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.
- Dominant language
- Rust
- Stars
- 23.2k
- Forks
- 2k
- Avg merge
- 1d 6h
- Merged PRs (30d)
- 127
Getting set up
- Ships a Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from CapSoftware/Cap
-
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
CapSoftware/Cap#2596 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
CapSoftware/Cap#2384 · 1 comment ·
Maintainers usually reply within 1 day
-
Dashboard pagination causes full page reloads on self-hosted CapPossibly taken @Dewin claimed this 27 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
CapSoftware/Cap#2305 · 2 comments ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
CapSoftware/Cap#1714 · 3 comments ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 18/100
CapSoftware/Cap#2606 · 2 comments ·
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
wormhole-foundation/wormhole#5062 ·
Maintainers usually reply within 1 day
-
RUSTSEC-2026-0348: Brotli certificate decompression can allocate up to 1 GiB before authenticationOpen
Difficulty 2/5 1-3 hours Newbie friendliness 60/100
-
Difficulty 1/5 1-3 hours Newbie friendliness 62/100
-
core: Amount::from_str panics on values above 21M BTC instead of returning an errorPossibly taken @bhuvan-somisetty claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
crate: spate-s3
Difficulty 2/5 Half a day Newbie friendliness 62/100
Maintainers usually reply within 1 day