Fosi Fossil Service
Small teams. Open source. Built on Fossil.

CaaS / Lamina

Unified Management for Fossil Repositories

Public | Owner: CaaS | Default branch: trunk | Last update: 2026-10-25 00:41

Artifact b28178d2a637d0ba69194671d3196204f6b8e168e3cae1f71952362f5fec9894:


-module(nova_erlydtl_inventory).
-moduledoc false.
-behaviour(erlydtl_library).

-include_lib("kernel/include/logger.hrl").

-export([
         version/0,
         inventory/1,
         url/2
        ]).

version() -> 1.

inventory(filters) -> [];
inventory(tags) -> [url].

url([Url|Variables], _Options) ->
    App = proplists:get_value(application, Variables),
    Apps = nova:get_apps(),
    case proplists:get_value(binary_to_atom(App, utf8), Apps) of
        undefined ->
            ?LOG_WARNING(#{msg => <<"Template could not find application">>, application => App}),
            <<"#">>;
        Prefix ->
            PrefixBin = list_to_binary(Prefix),
            maybe_remove_starting_slash(<< PrefixBin/binary, Url/binary >>)
    end.

maybe_remove_starting_slash(<<"/", "/", Rest/binary>>) ->
    <<"/", Rest/binary>>;
maybe_remove_starting_slash(Url) ->
    Url.

Clone

You can clone this repository with the following command:

fossil clone https://fosi.dev/CaaS/Lamina

Contribute

The best way to contribute is through e-mail. See the project documentation for more details.