Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When choosing to log in to access the site, uploaded photos will not be displayed due to insufficient permissions. #1214

Open
xingbaokeji opened this issue Dec 30, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@xingbaokeji
Copy link

When choosing to log in to access the site, uploaded photos will not be displayed due to insufficient permissions. When the user logs in normally, photos, videos, and attachments cannot be displayed
image
image

@xingbaokeji xingbaokeji added the bug Something isn't working label Dec 30, 2024
@LinkinStars
Copy link
Member

Maybe the following two issues can help you. #502 #667

@xingbaokeji
Copy link
Author

Thank you very much for your help. I basically understand the reason now. My current setup is: deploying Answer on a local network with an internal IP, and then using DDNS to map this to a domain name. I access Answer officially through the domain name and port number. However, after logging in, the images cannot be displayed. Is there any good solution?

Chinese(I don't know which country you are from, so I'm sending it in both languages to avoid not understanding the content):
非常感谢你的帮助,基本我也明白了原因。我现在的模式是:局域网部署answer,ip是内网的,然后用DDNS把这个解析映射到域名上,通过域名+端口号的方式正式访问answer的。登录之后就是图片无法显示。有没有什么好的方法么

@LinkinStars
Copy link
Member

@xingbaokeji Sorry, I took a look, and it seems that there isn't currently a suitable solution to handle this particular scenario. Perhaps in future versions, we could disable this security measure through a special environment variable or setting.

@xingbaokeji
Copy link
Author

ok,Thank you.。You can try to revoke the permission for the images in the issue, or make them selectable in the background for users to self manage risks. At present, users cannot see the specific content of the website without logging in, so I believe that revoking their image viewing permission is safe.

@nabekhan
Copy link

nabekhan commented Jan 12, 2025

If you are okay with your images being publicly available, I resolved this by NGIX proxy. Here is my config.

server {
    server_name answer.msa.com;

    # Serve static files directly
    location /uploads/ {
	# Use the symlink path to /var/lib/docker/volumes/root_answer-data/_data/uploads
        alias /var/www/uploads/; 
        autoindex off;
        allow all;
    }

    # Proxy all other requests to the application on port 9080
    location / {
        proxy_pass http://127.0.0.1:9080;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }

    # SSL settings managed by Certbot
    listen 443 ssl;
    ssl_certificate /etc/letsencrypt/live/answer.msa.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/answer.msa.com/privkey.pem;
    include /etc/letsencrypt/options-ssl-nginx.conf;
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
}

server {
    if ($host = answer.msa.com) {
        return 301 https://$host$request_uri;
    }

    listen 80;
    server_name answer.msa.com;
    return 404;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants