Open emengweb opened 4 months ago
*🆕 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.
might be a duplicate of https://github.com/toeverything/AFFiNE/issues/5944 web clipboard api is not usable without using https
i think its not the same, because paste image the url route access return homepage code. Looks like some url mapping is missing couse this happen.
Peng Xiao @.***> 于 2024年4月8日周一 17:06写道:
might be a duplicate of #5944 https://github.com/toeverything/AFFiNE/issues/5944 web clipboard api is not usable without using https
— Reply to this email directly, view it on GitHub https://github.com/toeverything/AFFiNE/issues/6485#issuecomment-2042238784, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHQDBK52XQW234XG5QWR4EDY4JMYZAVCNFSM6AAAAABF4JF3XKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANBSGIZTQNZYGQ . You are receiving this because you authored the thread.Message ID: @.***>
might be a duplicate of #5944 web clipboard api is not usable without using https
i used https, it still can not work
might be a duplicate of #5944 web clipboard api is not usable without using https
i used https, it still can not work
can you explain how did you integrate https? I would like to.
might be a duplicate of #5944 web clipboard api is not usable without using https
i used https, it still can not work
can you explain how did you integrate https? I would like to.
nginx
What happened?
Self-host Affine can not Paste images copied from other web pages, and download of images not work.
Judgment reason: The following url mapping is missing: imageProxyUrl: '/api/worker/image-proxy', linkPreviewUrl: '/api/worker/link-preview',
Distribution version
macOS x64 (Intel)
What browsers are you seeing the problem on if you're using web version?
Chrome
Are you self-hosting?
- [x] Yes
Relevant log output
No response
Anything else?
No response
i found the repository https://github.com/toeverything/affine-workers
but can only deploy in Cloudflare
you can make wheel by yourself in other programming languages
Some updates about that? I'm having the same issue.
https://discordapp.com/channels/959027316334407691/1231935115303718953
I see. Sorry about the statement I made about https. It clearly related to the image-proxy issue. It looks like we haven't including workers in the self-host version. Before we do, you need to either deploy https://github.com/toeverything/affine-workers onto a cloud service like Cloudflare, or adopt the code to make it running on your server somehow, which should not be too difficult.
i tried to deploy the cloudflare worker but there were too many obstacles along the way. i have rewritten the worker now as a simple express app which can be deployed locally via docker. i only tried out the link-preview endpoint (is the image proxy used anywhere else apart from within the link preview endpoint?) and it works flawlessly now. https://github.com/eikaramba/affine-workers
我尝试部署 cloudflare worker,但一路上遇到了太多障碍。我现在已经将 worker 重写为一个简单的 express 应用程序,可以通过 docker 在本地部署。我只尝试了 link-preview 端点(除了在 link preview 端点内,图像代理是否在其他地方使用?)现在它运行完美。https ://github.com/eikaramba/affine-workers
it worked!
@eikaramba how did you change default base url for image-proxy? My self hosted affine still trying to call app.affine.pro instead of my hosting domain, but other urls works properly.
@picolino i didn't needed to change anything in my self hosted affine. it was by default calling the local endpoint, resp. trying to. e.g. https://my.local.affine.domain/api/worker/link-preview
then i added a manual redirect in nginx to let this redirect to the docker container running this worker and voila, it worked.
are you sure it is trying to connect to app.affine.pro ? add a youtube link and then click on the link and switch to card view instead inline and observe with the browser tools in the network tab what is going on then.
i'm on latest affine as of today: 0.15.7 editor 0.16.0-canary-202407200848-42035fe
i now see you are talking about the image-proxy. i honestly haven't tried this out and frankly i don't know how. how do you test this?
@eikaramba
To test this just press Reload on link block
It is ok for link-preview, it is my host:
But not for image-preview:
As you can see - no images on link block persists.
I don't understand why is this happening...
strange i tested to embed https://github.com/toeverything/AFFiNE as a link
works fine. it has to be because of what the link-preview is returning for you.
Did you set the host name in the docker environment correctly?
services:
worker:
build: .
expose:
- 9930
ports:
- 9930:3000
environment:
- HOST_NAMES=${HOST_NAMES}
networks: {}
where HOST_NAMES is a variable i have set. e.g. HOST_NAMES=https://my.affine.instance
@eikaramba Nah, I used app.affine.pro workers, because of that these workers gave me back that url.
I deployed your affine workers in docker - everything is fine.
Just to mention, if you gonna use it too:
src/utils/headers.ts
, add your host to allowed origins.Also, you could inject workers compose.yaml in basic affine compose to launch both in one command:
services:
workers:
container_name: affine_workers
extends:
file: ../affine-workers/compose.yaml
service: worker
What happened?
Self-host Affine can not Paste images copied from other web pages, and download of images not work.
Judgment reason: The following url mapping is missing: imageProxyUrl: '/api/worker/image-proxy', linkPreviewUrl: '/api/worker/link-preview',
Distribution version
macOS x64 (Intel)
What browsers are you seeing the problem on if you're using web version?
Chrome
Are you self-hosting?
Relevant log output
No response
Anything else?
No response