incubator-answer icon indicating copy to clipboard operation
incubator-answer copied to clipboard

picture not diplay normally

Open notfresh opened this issue 1 year ago • 8 comments

Describe the bug The picture in comment not display normally

To Reproduce Steps to reproduce the behavior:

  1. install the answer by docker run -d -p 9080:80 -v answer-data:/data --name answer apache/answer:latest
  2. update my avartar, it shows normally
  3. post an answer
  4. the picture in the answer post did not diplay normally but I can find it in the volume /data/upload/post

Expected behavior The image shows normally

Screenshots image

image

Platform (please complete the following information):

  • Device: [e.g. Desktop, Mobile]
  • OS: LSB Version: core-11.1.0ubuntu2-noarch:security-11.1.0ubuntu2-noarch Distributor ID: Ubuntu Description: Ubuntu 20.04.6 LTS Release: 20.04 Codename: focal
  • Browser: microsoft Edge
  • Version: docker image apache/answer latest d3da45f971e2 21 hours ago 110MB

notfresh avatar Dec 01 '23 03:12 notfresh

image

notfresh avatar Dec 01 '23 03:12 notfresh

@notfresh You can check as follows.

  1. Confirm that the image url can be accessed directly from your browser.
  2. Is there any error log output?

LinkinStars avatar Dec 01 '23 04:12 LinkinStars

@LinkinStars the image can't be visited from brower, it redirect to another page with a tip 403

image

I use docker ps CONTAINER_NAME , only to find some log:

2023-12-01 05:01:36.106 ERROR   gin/context.go:891      net/http: invalid Cookie.Domain "MyIP:9080"; dropping domain attribute
2023-12-01 05:01:38.155 ERROR   gin/context.go:891      net/http: invalid Cookie.Domain "MyIP:9080"; dropping domain attribute
2023-12-01 05:02:09.515 ERROR   gin/context.go:891      net/http: invalid Cookie.Domain "MyIP:9080"; dropping domain attribute

which was too old and not match the image error

I run docker deamon and docker container with the only user root.

notfresh avatar Dec 01 '23 05:12 notfresh

@notfresh This issue has been asked before. FYI: https://github.com/apache/incubator-answer/issues/502#issuecomment-1818481179

LinkinStars avatar Dec 01 '23 05:12 LinkinStars

@LinkinStars I have aquestions:

Why does the picture I set as my avatar which I upload could show on the web page normally?

As you said in the #502 issue, the problem could be settled with domain name , but why the avatar could show normlly IN IP VISIT MODE ?

Is there any authentication mechanism to block the picture by ip visit but no such a check on avatar? I have logged in the brower and with cookie open

notfresh avatar Dec 06 '23 01:12 notfresh

@LinkinStars I have aquestions:

Why does the picture I set as my avatar which I upload could show on the web page normally?

As you said in the #502 issue, the problem could be settled with domain name , but why the avatar could show normlly IN IP VISIT MODE ?

Is there any authentication mechanism to block the picture by ip visit but no such a check on avatar? I have logged in the brower and with cookie open

@notfresh Thank you for your question. Yes, the two have different validation rules. Since avatars may come from different sources such as gravatar. So it is currently left open for avatars. Since the essential aspect of this requirement is actually that we don't want the content of the user's question or answer to be posted somewhere else in private mode. Surely, we will consider your point about private access for avatars though.

LinkinStars avatar Dec 06 '23 02:12 LinkinStars

20240130223211 Turning off this configuration allows the images to be displayed correctly

yuanjinger avatar Jan 30 '24 14:01 yuanjinger

So, this is a bug?, there is another way to solve it?, and keep the setting as "login required=true"?

magjogui avatar Jul 25 '24 23:07 magjogui