Skip to content
This repository was archived by the owner on Dec 13, 2025. It is now read-only.
/ WebP-S3-API Public archive

Convert media files from S3-Like buckets into WebP on-the-fly. Simple, no bloat, no fluffs.

License

Notifications You must be signed in to change notification settings

Saihex/WebP-S3-API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Notice: Saihex's public repositories are moving to Codeberg https://codeberg.org/saihex/WebP-S3-API

🌀 Saihex Studios' WebP S3 API


SaihexWare Collection Logo

A tiny, nimble Deno-powered API that connects to any S3-compatible storage and delivers WebP conversions on the fly — because modern formats deserve modern delivery.


💼 Why Saihex uses it (a tale for the busy)

This API was born out of a single irritation: Discord not playing nice with SVGs in embeds. So we built this to fix that. Drop in an SVG (or other supported formats), and get back a shiny WebP ready for the web. ✨

  • Perfect with MinIO (Community Edition)
  • SVG in, WebP out — HRT be like 🏳️‍⚧️
  • Designed for simplicity, for devs who don’t want a whole circus of config files just to get image conversion working

🚀 So, what does it actually do?

  • Connects to an S3-compatible (or S3-like) API endpoint
  • Accepts supported image file types
  • Converts them to WebP on demand
  • Returns the image as if it had always been that way — like magic, but with bytes

🧠 Bonus fox-fact:
This works even with plain static file hosting — as long as the server supports HEAD requests!
The API sends a HEAD request first to verify content-type and avoid downloading junk.
If the server doesn't respond to HEAD properly, this clever optimization becomes a deoptimization, and performance goes poof. 🪦


📎 Tiny Usage Docs (Because You Asked)

The API responds to any path, using the same logic every time.

You must provide a src header like:

src: public/hormone/estrogen.svg

That points to the path of the file in your S3 bucket (or static media host).

🔧 Configuration (via compose.yaml)

  • s3endpoint: Set this to your S3-compatible URL (e.g. MinIO endpoint)
  • allowedPathRegex: A JSON array of regex strings that restrict which object paths are allowed for fetching.

🧠 Example:
Set allowedPathRegex = ["^public/.*", "^assets/.*"] to allow only paths starting with public/ or assets/.
Useful when your storage contains internal assets you want to block from public access.

No magic, no middle-layer SDK wrappers — just raw fetches and direct WebP transition— I mean, transformation...
Isn’t that the same thing...? 🏳️‍⚧️

🫥 Note: The only exception is /health, which is reserved for Docker Compose health checks.
Don’t expect it to return WebP… unless you're into that kind of diagnostic kink.


🔒 PSA: No Authentication Built In

This API is built only for accessing public assets. That means:

  • No token system
  • No credentials
  • No access keys
  • No secrets

Just publicly accessible S3/static URLs, like a dumb fox fetching shiny things from the open.

🛠️ Want auth?
Clone it, fork it, bolt OAuth on, scream at Deno, and make it your own. We’re not your boss.


🧪 Documentation? Pfft.

Look, it does one thing and it does it well. If you're expecting a 40-page manual, this isn’t that kind of project.

But hey, it’s MIT licensed, so feel free to:

  • Fork it
  • Hack it
  • Rewrite it in Rust or Go
  • Or even feed it estrogen and let it become your own thing

Yes, we’re that generous.


🐾 In summary...

Fast, simple, effective — like a caffeinated fox handling your image assets.

Built by Saihex Studios for internal use, but shared with you because we're nice like that.
Meow~ 🦊


This README was co-written with ChatGPT because I value my time, and I’m not about to manually write markdown like some kind of productivity war criminal. Transparency-first

About

Convert media files from S3-Like buckets into WebP on-the-fly. Simple, no bloat, no fluffs.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors