Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
197 changes: 196 additions & 1 deletion common/config/rush/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions common/scripts/docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ rush docker:build -p 20 \
--to @hcengineering/pod-export \
--to @hcengineering/pod-media \
--to @hcengineering/pod-preview \
--to @hcengineering/pod-link-preview \
--to @hcengineering/pod-external \
--to @hcengineering/pod-backup \
--to @hcengineering/backup-api-pod \
Expand Down
12 changes: 12 additions & 0 deletions dev/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,17 @@ services:
ports:
- 4040:4040
restart: unless-stopped
link-preview:
image: 'hardcoreeng/link-preview'
extra_hosts:
- 'huly.local:host-gateway'
container_name: link-preview
environment:
- SECRET=secret
- PORT=4041
ports:
- 4041:4041
restart: unless-stopped
cockroach:
image: cockroachdb/cockroach:latest-v24.3
extra_hosts:
Expand Down Expand Up @@ -306,6 +317,7 @@ services:
- DATALAKE_URL=http://huly.local:4030
- HULYLAKE_URL=http://huly.local:8096
- EXPORT_URL=http://huly.local:4009
- LINK_PREVIEW_URL=http://huly.local:4041
restart: unless-stopped
transactor_cockroach:
image: hardcoreeng/transactor
Expand Down
3 changes: 2 additions & 1 deletion dev/prod/public/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,6 @@
"PULSE_URL": "ws://huly.local:8099/ws",
"HULYLAKE_URL": "http://huly.local:8096",
"EXCLUDED_APPLICATIONS_FOR_ANONYMOUS": "[\"chunter\", \"notification\"]",
"ANALYTICS_COLLECTOR_URL": "http://huly.local:4017"
"ANALYTICS_COLLECTOR_URL": "http://huly.local:4017",
"LINK_PREVIEW_URL": "http://huly.local:4041"
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@
getClient,
isLinkPreviewEnabled,
uploadFile,
LinkPreviewAttachmentMetadata
LinkPreviewAttachmentMetadata,
generateFileId
} from '@hcengineering/presentation'
import { EmptyMarkup, isEmptyMarkup } from '@hcengineering/text'
import textEditor, { type RefAction } from '@hcengineering/text-editor'
Expand Down Expand Up @@ -383,9 +384,10 @@
for (const url of urls) {
try {
const meta = await fetchLinkPreviewDetails(url)
if (canDisplayLinkPreview(meta) && meta.url !== undefined) {
if (canDisplayLinkPreview(meta)) {
const uuid = generateFileId()
const blob = new Blob([JSON.stringify(meta)])
const file = new File([blob], meta.url, { type: 'application/link-preview' })
const file = new File([blob], uuid, { type: 'application/link-preview' })
const metadata: LinkPreviewAttachmentMetadata = {
title: meta.title,
image: meta.image,
Expand Down
Loading