Use pictrs instead of pictshare #47

Closed
nutomic wants to merge 0 commits from use-pictrs into master
Owner

Like I mentioned in the chat, for some reason nginx doesnt route uploads to pictrs, even though its the exact same config we used for pictshare.

Ansible should be good to go (only tested lemmy_dev.yml). The frontend will need more changes to handle the pictrs API properly.

Like I mentioned in the chat, for some reason nginx doesnt route uploads to pictrs, even though its the exact same config we used for pictshare. Ansible should be good to go (only tested lemmy_dev.yml). The frontend will need more changes to handle the pictrs API properly.
nutomic reviewed 2020-06-08 17:55:35 +00:00
@ -1,5 +1,6 @@
[defaults]
inventory=inventory
interpreter_python=/usr/bin/python3
Author
Owner

This is needed to make it work on Ubuntu 20.04, but I think it breaks on 18.04.

This is needed to make it work on Ubuntu 20.04, but I think it breaks on 18.04.
nutomic reviewed 2020-06-08 17:57:46 +00:00
@ -28,2 +28,2 @@
pictshare:
image: hascheksolutions/pictshare:latest
pictrs:
image: asonix/pictrs:amd64-v0.1.0-r9
Author
Owner

This isnt gonna work for ARM or other architectures.

This isnt gonna work for ARM or other architectures.
nutomic reviewed 2020-06-08 17:58:17 +00:00
@ -29,1 +28,3 @@
image: hascheksolutions/pictshare:latest
pictrs:
image: asonix/pictrs:amd64-v0.1.0-r9
user: 991:991
Author
Owner

Asonix says this isnt needed, but in my tests it didnt work if I comment it out.

Asonix says this isnt needed, but in my tests it didnt work if I comment it out.
Author
Owner

Should be fixed in the latest image version, need to update.

Should be fixed in the latest image version, need to update.
Owner

I need to test this out on the front end to make sure it works, and I think we need to add some migration scripts to move all the pictures over.

Both a code one (in advanced migrations), that updates all the thumbnail and urls that contain pictshare to the new pictrs endpoint, and a manual one that moves all the pictures over to that folder.

I need to test this out on the front end to make sure it works, and I think we need to add some migration scripts to move all the pictures over. Both a code one (in advanced migrations), that updates all the thumbnail and urls that contain pictshare to the new pictrs endpoint, and a manual one that moves all the pictures over to that folder.
Owner

I can't get this to work on the front end, were you able to?

I'm getting

nginx_1     | 2020/06/09 18:27:45 [error] 19#19: *1 writev() failed (32: Broken pipe) while sending request to upstream, client: 172.
24.0.1, server: 127.0.0.1, request: "POST /pictrs/image HTTP/1.1", upstream: "http://172.24.0.5:8080/image", host: "localhost", refer
rer: "http://localhost:8535/create_post"
I can't get this to work on the front end, were you able to? I'm getting ``` nginx_1 | 2020/06/09 18:27:45 [error] 19#19: *1 writev() failed (32: Broken pipe) while sending request to upstream, client: 172. 24.0.1, server: 127.0.0.1, request: "POST /pictrs/image HTTP/1.1", upstream: "http://172.24.0.5:8080/image", host: "localhost", refer rer: "http://localhost:8535/create_post" ```
Owner

NM, I figured it out, btw I added a PR to yours from a branch I've been working on.

NM, I figured it out, btw I added a PR to yours from a branch I've been working on.
Owner

BTW this also needs to fix the image thumbnailing currently in lib.rs

BTW this also needs to fix the image thumbnailing currently in `lib.rs`
Author
Owner

Not a fan of making a PR for another PR lol. I didnt think of having to write a DB migration, thats annoying. But I can take care of the migration for image files no problem.

Not a fan of making a PR for another PR lol. I didnt think of having to write a DB migration, thats annoying. But I can take care of the migration for image files no problem.
Owner

I can do the code migration. It needs to be done because every image right now is stored in the DB as http://url/pictshare/hash, and needs to go to http://url/pictrs/image/hash.

I can do the code migration. It needs to be done because every image right now is stored in the DB as `http://url/pictshare/hash`, and needs to go to `http://url/pictrs/image/hash`.
nutomic closed this pull request 2020-06-11 13:33:58 +00:00

Pull request closed

Sign in to join this conversation.
No reviewers
No Label
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: LemmyNet/lemmy#47
No description provided.