In order to hit shields.io less, make it possible to cache images in-memory. They're small, and if the variety isn't all that big, caching in-memory is good enough. If enabled (which is not the default), the first miss will retrieve the badge from shields.io, and cache it in-memory. Any subsequent hits will use the cache. No redirect occurs here, unless the request fails for one reason or another, in which case, we'll redirect to the original shields.io URL. Signed-off-by: Gergely Nagy <me@gergo.csillger.hu>
ironforge
A lightweight bridge between Forgejo Actions and shields.io.
Usage
In docker-compose-yaml:
version: 3
services:
ironforge:
image: git.madhouse-project.org/algernon/ironforge:latest
environment:
- IRONFORGE__SERVER__LISTEN_ADDR=0.0.0.0:3000
- IRONFORGE__FORGE__URL=https://your.forge
ports:
- "127.0.0.1:3000:3000"
For more information about the available options, see examples/ironforge.toml.
API
The service provides two routes:
-
/actions/:owner/:repo/badge?label=ci&style=for-the-badge&branch=mainRedirects to a shields.io image, based on the latest status of a Forgejo Action on a given repository.
For example:
https://ironforge.madhouse-project.org/actions/algernon/ironforge/badgemight redirect tohttps://img.shields.io/badge/ci-success-brightgreen?style=for-the-badge, assuming the latest build was successful. -
/actions/:owner/:repo/latest-log?branch=mainRedirects to the log of the latest Forgejo action on a given repository.
For example:
https://ironforge.madhouse-project.org/actions/algernon/ironforge/latest-logwould redirect tohttps://git.madhouse-project.org/algernon/ironforge/actions/runs/10/jobs/0(or whatever the latest is, at any given time).
The query parameters in both cases are optional, they can be used to override defaults set in the configuration.