Proxy pictrs requests through Lemmy (fixes #371) #77
Loading…
Reference in New Issue
No description provided.
Delete Branch "pictrs-proxy"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Not sure which thumbnail sizes or other features we are using, but everything seems to work fine in the frontend.
I might also add rate limit and auth check for uploads while I'm at it, but not sure how to make it send the jwt string.
I'll try this out too. The main thing is that the urls don't change, and that its still accessible to the front end, and back end.
Take a look at the
lib.rs fetch_pictrs
function. I think that might need to be checked too, cause its required for thumbnails.edit: actually maybe its fine, the docker pictrs didn't change.
The thumbnail fetching seems good.
One issue I did notice tho, is that I'm getting timeouts when I try to upload any file larger than ~1 MB.
Okay I added a rate limit for image uploads, but it doesnt seem to work, I can still upload as many images in a row as I want...
I also tried to upload a 5.7 MB image (from this site) and it worked without problems in the
docker/dev/
setup.I think I know why image rate limiting isn't working, check the mod.rs
impl RateLimit
.And then the image route needs image, not message.
Also I tried a few more pictures, and about 75% of them failed, with the same timeout error as above. It seems to stop working after the first few uploads go through.
Fixed the rate limit, but strangely I could still upload more than 20 images in a row, without any problems. So neither is the rate limit working, nor am I seeing the upload errors that you get.
Maybe its my local machine, I'll try deploying to test.lemmy.ml to see if it works.
Figured out the rate limit issue:
rate_limit/mod.rs
, line 114 should be falseOtherwise its a check only.
Thanks, fixed. About your upload error, we could try how it goes running it on a server, or ask asonix if he has some idea.
I was wrong, I shouldn't have merged this. I'm getting that timeout error in production now.