Skipping proxied images
- Dominant language
- JavaScript
- Stars
- 25
- Forks
- 6
- PR merge metrics
- No merged PRs in 30d
Description
Hello,
I've tried to set up lpp and while it works purging the posts, it is failing with the images. I suspect that as I enabled "ProxyAllImages" for image_mode in lemmy.hjson, lpp is failing with:
`lpp | Purging images older than 200 days
lpp | Processing 75062 posts with thumbnails
lpp | Failed on http://pictrs:8080/internal/aliases?alias=image_proxy
lpp | Processing 1 of 75062 (purged: 0, keeping: 1)
lpp | Failed on http://pictrs:8080/internal/aliases?alias=image_proxy
lpp | ReferenceError: purgeUrl is not defined
lpp | at purgePictrs (/app/pictrs.js:142:36)
lpp | at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
lpp | at async main (/app/index.js:157:11)
`
So lpp thinks that the alias is "image_proxy", so I suspect that lpp is trying to purge a proxied image? Unless I misinterpreted the configuration.
I've configured docker-compose.yml as:
`version: '2.1'
services:
lpp:
image: nowsci/lpp
container_name: lpp
volumes:
- /path/to/lemmy/volumes/pictrs:/mnt
environment:
LOCAL_URL: https://lemmy.stefanoprenna.com
LOCAL_USERNAME: username
LOCAL_PASSWORD: mypassword
PURGE_OLDER_THAN_DAYS: 365
PICTRS_RM_OLDER_THAN_DAYS: 200
PICTRS_SERVER_API_TOKEN: MYAPITOKEN
PICTRS_URL: http://pictrs:8080
PICTRS_FOLDER: /path/to/lemmy/volumes/pictrs
HOURS_BETWEEN_PURGES: 24
PG_HOST: 172.22.0.1
PG_PORT: 5433
PG_DATABASE: lemmy
PG_USERNAME: lemmy
PG_PASSWORD: MYPASSWORD
restart: unless-stopped
`
I'm not sure if this is a configuration issue or a problem with lpp that should skip proxied images. Any thoughts?
Thank you.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start at pictrs.js:142 in purgePictrs and review how the configured ProxyAllImages image mode is handled when the pictrs alias is image_proxy. Reproduce with the supplied docker-compose.yml settings and logs; done means proxied images are skipped without a ReferenceError while regular image purging continues.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker-compose, javascript
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100