These are quite... simple, and cover little, but it's more than nothing!
While there, enable tests in the Nix package, so they're run in CI too.
Signed-off-by: Gergely Nagy <me@gergo.csillger.hu>
Thanks to @redshiftltd for test driving the nginx setup, and providing
very valuable feedback & the updated configurations.
Signed-off-by: Gergely Nagy <me@gergo.csillger.hu>
With the previous nginx configuration, all requests that matched
`$badagent` were rewrote to `/ai`, without the original URL anywhere.
This resulted in `iocaine` only seeing `/ai`, and thus, every page ended
up being rendered the same.
The rewrite should take the original request URI into account, which is
what this patch does.
Signed-off-by: Gergely Nagy <me@gergo.csillger.hu>
Added a few words about compiling Iocaine, added a docker example with a
TOML configuration file (vs the existing environment variable-based
example), and collected a mistake describing the shape of
`IOCAINE__SOURCES__MARKOV`.
These together should largely address #2.
Signed-off-by: Gergely Nagy <me@gergo.csillger.hu>
This rebuilds the templating so that the *content* is no longer
pre-generated, only the parameters. It is up to the template (and some
newly implemented helper functions) to construct the output from those.
Signed-off-by: Gergely Nagy <me@gergo.csillger.hu>
This was originally an embedded string in Rust, which needed to escape
the quotation mark. The escaping is no longer needed in raw HBS.
Signed-off-by: Gergely Nagy <me@gergo.csillger.hu>
Reconfigured the build & lint workflows, so that the source is only
compiled if there are changes committed to files that might alter the
output.
Signed-off-by: Gergely Nagy <me@gergo.csillger.hu>
When configuring iocaine via environment variables, sections and
settings were separated by two underlines, but the `IOCAINE_` prefix
only had one. This felt weird, so now iocaine supports an `IOCAINE__`
prefix too, and keeps recognizing the old one too.
Documentation and examples updated to use the new naming. No mention of
the backwards compatibility - I'll just silently support that.
Signed-off-by: Gergely Nagy <me@gergo.csillger.hu>
When calling `axum::serve`, use `.with_graceful_shutdown()` to register
a `ctrl+c` handler, so that Iocaine can be gracefully shut down. This
also allows gracefully shutting it down when running inside a container.
Fixes#1, thanks @alciregi!
Signed-off-by: Gergely Nagy <me@gergo.csillger.hu>
The initial seed is used by the RNG, and the intended use is to allow
modifying the generated output without otherwise modifying the
configuration, while still being a static, controllable seed that can be
shared between instances if need be.
Thanks to @buherator@infosec.place for the idea!
Signed-off-by: Gergely Nagy <me@gergo.csillger.hu>
Moved the reverse proxy examples out of the README, into
`docs/deploying.md`. Also wrote the reverse proxy section for the
deployment docs.
Signed-off-by: Gergely Nagy <me@gergo.csillger.hu>
This adds plenty of documentation: describing what iocaine is, how it
does what it does, and how to deploy it in various scenarios.
Not complete yet, but reasonably detailed nevertheless.
Signed-off-by: Gergely Nagy <me@gergo.csillger.hu>
This is expected to run through a systemd system service, with the
config file explicitly specified. Using XDG for the default config makes
little sense in that case, and ends up causing issues with a strict
systemd service file.
Signed-off-by: Gergely Nagy <me@gergo.csillger.hu>