openlibhums / openlibhums/janeway
Non-standard clients (e.g. API/CLI apps) cannot access article header images due to Anubis: suggest /image/ endpoint exempted from Anubis as fix
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 239
- Forks
- 97
- Avg merge
- 9d 1h
- Merged PRs (30d)
- 8
Description
Is your feature request related to a problem? Please describe.
I have an app (LinkedInConnect) that posts to all my social media channels from the command line. But this bug is applicable to any user who is using a non-standard client to post Janeway or Open Library of Humanities links to social media.
Basically, if I go to post a Janeway URL, my custom client is unable to fetch the image that is needed for a thumbnail on BlueSky. This is because Anubis sits between me and the request, and if you are not using a full browser client, Anubis assumes you're a bot that must be blocked. I get a 403 error. See screenshot below.
This means that if I use my client to post to BlueSky from a Janeway or OLH link, it doesn't have a nice open graph thumbnail anymore.
Describe the solution you'd like
I would like you to add a hard-coded /image/ endpoint on article routes. So https://orbit.openlibhums.org/article/id/24920/image/ for example. This route should return the header image for the article. Routes ending in /image/ should be exempted from Anubis. I can then add this as a check in my client to see if we can get an image via this route.
Describe alternatives you've considered
The alternative is using Puppeteer or Playwright inside my app to create a full browser running in headless mode that can circumvent Anubis just so that I can pull down the thumbnail image. This seems ridiculously heavy, just to do something that is innocuous and harmless.
Additional context
This is both a bug and a feature request: the bug is the inability for non-standard clients to retrieve header images for thumbnails due to Anubis. The feature request is to implement an /image/ endpoint exempt from Anubis as a fix.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Locate the article route handling the example URL and the existing Anubis configuration or exemption rules. Trace how an article's header image is selected, then verify that an /image/ article endpoint returns that image to non-browser clients without Anubis blocking it.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api, backend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100