Gergely Nagy f47a770db7 Make it possible to cache images
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>
2023-09-23 15:13:22 +02:00
2023-09-23 15:13:22 +02:00
2023-09-23 15:13:22 +02:00
2023-09-19 12:07:48 +02:00
2023-09-19 12:07:48 +02:00
2023-09-19 12:07:48 +02:00
2023-09-19 12:07:48 +02:00

ironforge

Build status Container badge

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=main

    Redirects 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/badge might redirect to https://img.shields.io/badge/ci-success-brightgreen?style=for-the-badge, assuming the latest build was successful.

  • /actions/:owner/:repo/latest-log?branch=main

    Redirects to the log of the latest Forgejo action on a given repository.

    For example:

    https://ironforge.madhouse-project.org/actions/algernon/ironforge/latest-log would redirect to https://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.

S
Description
Forgejo Actions <-> shields.io bridge
Readme 125 KiB
Languages
Rust 94.3%
Nix 5.7%