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

[Bug]: Internal pictrs request tries to connect via external proxy #5270

Closed
5 tasks done
rayes0 opened this issue Dec 18, 2024 · 0 comments
Closed
5 tasks done

[Bug]: Internal pictrs request tries to connect via external proxy #5270

rayes0 opened this issue Dec 18, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@rayes0
Copy link

rayes0 commented Dec 18, 2024

Requirements

  • Is this a bug report? For questions or discussions use https://lemmy.ml/c/lemmy_support
  • Did you check to see if this issue already exists?
  • Is this only a single bug? Do not put multiple bugs in one issue.
  • Do you agree to follow the rules in our Code of Conduct?
  • Is this a backend issue? Use the lemmy-ui repo for UI / frontend issues.

Summary

9184800 avoids proxying pictrs requests, useful when running in docker (see #3489). However, some pictrs requests are still attempted through the proxy from here:

let fetch_url = format!(
"{}image/download?url={}&resize={}",
pictrs_config.url,
encode(image_url.as_str()),
context.settings().pictrs_config()?.max_thumbnail_size
);
let res = context
.client()
.get(&fetch_url)
.timeout(REQWEST_TIMEOUT)
.send()
.await?
.error_for_status()?
.json::<PictrsResponse>()
.await?;

Currently, the requests fail when running in docker and using the system proxy. It should be set to not use the proxy like the other pictrs requests.

Steps to Reproduce

  1. Run lemmy in docker with proxy environment variables set
  2. Observe attempts like the following being passed to the proxy: TCP_MISS/502 4070 GET http://pictrs:8080/image/download?

Technical Details

n/a

Version

BE: 0.19.7

Lemmy Instance URL

No response

@rayes0 rayes0 added the bug Something isn't working label Dec 18, 2024
dessalines pushed a commit that referenced this issue Jan 15, 2025
* Split image endpoints into API v3 and v4

* Move into subfolders

* Upload avatar endpoint and other changes

* Various other changes

fixes #1772
fixes #4001

* clippy

* config options

* fix ts bindings

* fix api tests

* Add option to disable image upload (fixes #1118)

* split files into upload, download

* move sitemap to top level, not in api

* simplify code

* add upload user banner

* community icon/banner

* site icon/banner

* update js client

* wip

* add delete endpoints

* change comment

* optimization

Co-authored-by: dullbananas <[email protected]>

* move fn

* 1024px banner

* dont use static client

* fix api tests

* shear

* proxy pictrs in request.rs (fixes #5270)

* clippy

* Get rid of pictrs delete token

* remove delete token params

* try to fix api tests

* fmt

* skip api tests

* clippy

* create user

* debug

* dbg

* ignore test

* test

* image

* run another

* fixed?

* clippy

* fix

* migration with column order

* drop default

* fix health check

* update client

* remove unused

* fix

* reuse delete_image_from_pictrs

* update lib

---------

Co-authored-by: dullbananas <[email protected]>
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

1 participant