AFFiNE icon indicating copy to clipboard operation
AFFiNE copied to clipboard

​Self-hosted: Link preview is not working

Open oolxg opened this issue 1 year ago • 5 comments

What happened?

When inserting Github link to a document(Card view), it fails to preload the content

image

Distribution version

Linux

v0.16.3

What browsers are you seeing the problem on if you're using web version?

Chrome, Other

Are you self-hosting?

  • [X] Yes

Relevant log output

affine_selfhosted  | [Nest] 117  - 08/27/2024, 12:10:19 AM   ERROR [HTTP] Internal server error
affine_selfhosted  | NotFoundException: Cannot POST /api/worker/link-preview
affine_selfhosted  |     at callback (/app/node_modules/@nestjs/core/router/routes-resolver.js:77:19)
affine_selfhosted  |     at /app/node_modules/@nestjs/core/router/router-proxy.js:9:23
affine_selfhosted  |     at Layer.handle [as handle_request] (/app/node_modules/express/lib/router/layer.js:95:5)
affine_selfhosted  |     at trim_prefix (/app/node_modules/express/lib/router/index.js:328:13)
affine_selfhosted  |     at /app/node_modules/express/lib/router/index.js:286:9
affine_selfhosted  |     at Function.process_params (/app/node_modules/express/lib/router/index.js:346:12)
affine_selfhosted  |     at next (/app/node_modules/express/lib/router/index.js:280:10)
affine_selfhosted  |     at serveStatic (/app/node_modules/serve-static/index.js:75:16)
affine_selfhosted  |     at Layer.handle [as handle_request] (/app/node_modules/express/lib/router/layer.js:95:5)
affine_selfhosted  |     at trim_prefix (/app/node_modules/express/lib/router/index.js:328:13)


### Anything else?

_No response_

oolxg avatar Aug 27 '24 00:08 oolxg

Issue Status: 🆕 *Untriaged

*🆕 Untriaged

The team has not yet reviewed the issue. We usually do it within one business day. Docs: https://github.com/toeverything/AFFiNE/blob/canary/docs/issue-triaging.md

This is an automatic reply by the bot.

affine-issue-bot[bot] avatar Aug 27 '24 00:08 affine-issue-bot[bot]

@Brooooooklyn @darkskygit we need to make worker a part in selfhost instance

forehalo avatar Aug 27 '24 01:08 forehalo

@Brooooooklyn @darkskygit we need to make worker a part in selfhost instance

will do this later

darkskygit avatar Aug 27 '24 03:08 darkskygit

@Brooooooklyn @darkskygit we need to make worker a part in selfhost instance

will do this later

I would greatly appreciate if you guys could check this issue again and add the worker: link preview in the affine.pro website has always failed for me in the websites that I need the canvas for, probably due to bot detection, and I was hoping self-hosting would fix this (I checked the library that you use for the link preview and it was able to extract the website metadata properly from my network)

teynar avatar Dec 27 '24 13:12 teynar

@Brooooooklyn @darkskygit we need to make worker a part in selfhost instance

will do this later

I would greatly appreciate if you guys could check this issue again and add the worker: link preview in the affine.pro website has always failed for me in the websites that I need the canvas for, probably due to bot detection, and I was hoping self-hosting would fix this (I checked the library that you use for the link preview and it was able to extract the website metadata properly from my network)

please follow #8722

darkskygit avatar Dec 27 '24 14:12 darkskygit

even with #10085 merged, link previews still don't show up for me. I get a 404 on /api/worker/link-preview

Meimax avatar Feb 24 '25 09:02 Meimax

even with #10085 merged, link previews still don't show up for me. I get a 404 on /api/worker/link-preview

after update, please edit ~/.affine/self-host/config/affine.js and remove the comments from the illustrated section

if upgrading from an older version, you may need to manually add this code snippet

Image

I will update the relevant documentation later

darkskygit avatar Feb 24 '25 09:02 darkskygit