Commit graph

46 commits

Author SHA1 Message Date
Gergely Nagy
ff9c31d326
ci: Run the build workflow when tests change
Some checks failed
build / binary (push) Has been cancelled
build / binary-static (push) Has been cancelled
build / container (push) Has been cancelled
build / clippy (push) Has been cancelled
lint / linting (push) Has been cancelled
Signed-off-by: Gergely Nagy <me@gergo.csillger.hu>
2025-01-30 21:30:39 +01:00
Gergely Nagy
9cb1afb5f0
tests: Add a new test
Signed-off-by: Gergely Nagy <me@gergo.csillger.hu>
2025-01-30 21:29:55 +01:00
Gergely Nagy
aa4c387605
Add a number of tests
Some checks are pending
build / binary (push) Waiting to run
build / binary-static (push) Waiting to run
build / container (push) Waiting to run
build / clippy (push) Waiting to run
lint / linting (push) Waiting to run
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>
2025-01-30 09:18:35 +01:00
Gergely Nagy
a039cf2310
Update rand & rand_chacha to 0.9.0
Signed-off-by: Gergely Nagy <me@gergo.csillger.hu>
2025-01-30 07:47:39 +01:00
Gergely Nagy
22166e0e7c
docs: Further updates & fixes to the nginx docs
Some checks failed
lint / linting (push) Waiting to run
documentation / documentation (push) Has been cancelled
documentation / notification (push) Has been cancelled
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>
2025-01-29 19:24:33 +01:00
Gergely Nagy
2050158c5a
docs: Mention the auto-built binaries
Some checks are pending
build / binary (push) Waiting to run
build / binary-static (push) Waiting to run
build / container (push) Waiting to run
build / clippy (push) Waiting to run
documentation / documentation (push) Waiting to run
documentation / notification (push) Blocked by required conditions
lint / linting (push) Waiting to run
Signed-off-by: Gergely Nagy <me@gergo.csillger.hu>
2025-01-29 08:49:10 +01:00
Gergely Nagy
b73fccda2b
ci: Fix the binary upload, hopefully
Signed-off-by: Gergely Nagy <me@gergo.csillger.hu>
2025-01-29 08:37:33 +01:00
Gergely Nagy
0babaecd80
ci: typo fix
Signed-off-by: Gergely Nagy <me@gergo.csillger.hu>
2025-01-29 08:29:43 +01:00
Gergely Nagy
43af527368
nix: Add zstd to the devshell
Signed-off-by: Gergely Nagy <me@gergo.csillger.hu>
2025-01-29 08:23:40 +01:00
Gergely Nagy
ca1a3eb22a
ci: build & publish a static binary too
Signed-off-by: Gergely Nagy <me@gergo.csillger.hu>
2025-01-29 08:16:36 +01:00
Gergely Nagy
ddd948171c
nix: Provide a static build too
While there, make the container use the statically linked package.

Signed-off-by: Gergely Nagy <me@gergo.csillger.hu>
2025-01-29 07:59:04 +01:00
Gergely Nagy
ea9972dbfc
docs: Fix the nginx rewrite
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>
2025-01-29 07:44:34 +01:00
Gergely Nagy
f486b99984
Improved documentation
Some checks are pending
build / build (push) Waiting to run
build / clippy (push) Waiting to run
documentation / documentation (push) Waiting to run
documentation / notification (push) Blocked by required conditions
lint / linting (push) Waiting to run
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>
2025-01-29 01:14:58 +01:00
Gergely Nagy
ae8b06a4d5
Make templating actually useful
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>
2025-01-29 00:20:21 +01:00
Gergely Nagy
1f5d4c8a5b
ci/build: Trigger the build for templates/** too
Some checks are pending
build / build (push) Waiting to run
build / clippy (push) Waiting to run
documentation / documentation (push) Waiting to run
documentation / notification (push) Blocked by required conditions
lint / linting (push) Waiting to run
Signed-off-by: Gergely Nagy <me@gergo.csillger.hu>
2025-01-28 09:02:21 +01:00
Gergely Nagy
ed1f5d0a3a
templates: Fix the link template
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>
2025-01-28 09:01:45 +01:00
Gergely Nagy
5d60b84300
Make the generated HTML templatable
Use Handlebars to generate the HTML output, to make it easier to change.

Signed-off-by: Gergely Nagy <me@gergo.csillger.hu>
2025-01-28 08:50:22 +01:00
Gergely Nagy
b66a60ab30
docs: Another for the See Also list
Some checks are pending
documentation / documentation (push) Waiting to run
documentation / notification (push) Blocked by required conditions
lint / linting (push) Waiting to run
Signed-off-by: Gergely Nagy <me@gergo.csillger.hu>
2025-01-27 08:53:54 +01:00
Gergely Nagy
8877bc2112
docs: Explain the name
Some checks failed
documentation / documentation (push) Has been cancelled
lint / linting (push) Has been cancelled
documentation / notification (push) Has been cancelled
Signed-off-by: Gergely Nagy <me@gergo.csillger.hu>
2025-01-25 18:12:00 +01:00
Gergely Nagy
f886a49dc2
.gitattributes: Try to mark markdown files detectable
Signed-off-by: Gergely Nagy <me@gergo.csillger.hu>
2025-01-25 12:40:00 +01:00
Gergely Nagy
6099ba6f64
ci: Don't build if there are no code changes
Some checks failed
documentation / documentation (push) Waiting to run
documentation / notification (push) Blocked by required conditions
lint / linting (push) Waiting to run
build / build (push) Has been cancelled
build / clippy (push) Has been cancelled
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>
2025-01-25 11:54:35 +01:00
Gergely Nagy
e8c9bc0056
docs: Sort the sections properly
How? -> Configuration -> Deploying

Signed-off-by: Gergely Nagy <me@gergo.csillger.hu>
2025-01-25 11:44:15 +01:00
Gergely Nagy
54952ee58c
Change the homepage URL to iocaine.mh-p.o
Some checks are pending
build / build (push) Waiting to run
documentation / documentation (push) Waiting to run
documentation / notification (push) Blocked by required conditions
lint / linting (push) Waiting to run
lint / clippy (push) Waiting to run
Signed-off-by: Gergely Nagy <me@gergo.csillger.hu>
2025-01-25 02:33:11 +01:00
Gergely Nagy
e3306e7998
Slight environment variable adjustment
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>
2025-01-25 02:16:06 +01:00
Gergely Nagy
c0c3210af8
docs: Another tool added to the See Also list!
Signed-off-by: Gergely Nagy <me@gergo.csillger.hu>
2025-01-25 02:12:19 +01:00
Gergely Nagy
0fa091e74c
docs: Fix a title
Oops.

Signed-off-by: Gergely Nagy <me@gergo.csillger.hu>
2025-01-25 01:48:44 +01:00
Gergely Nagy
8b961c9e8f
docs: Color adjustments
Signed-off-by: Gergely Nagy <me@gergo.csillger.hu>
2025-01-25 01:47:34 +01:00
Gergely Nagy
1c9e46b763
...run the documentation workflow if it changes
Signed-off-by: Gergely Nagy <me@gergo.csillger.hu>
2025-01-25 01:36:15 +01:00
Gergely Nagy
bd075147b8
Fix the documentation workflow
Signed-off-by: Gergely Nagy <me@gergo.csillger.hu>
2025-01-25 01:34:20 +01:00
Gergely Nagy
f5d4985f39
Move documentation to a dedicated site
Signed-off-by: Gergely Nagy <me@gergo.csillger.hu>
2025-01-25 01:31:38 +01:00
Gergely Nagy
b214131d8b
app: Implement graceful shutdown
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>
2025-01-19 22:04:55 +01:00
Gergely Nagy
85e6f4f66f Typo fix
Signed-off-by: Gergely Nagy <me@gergo.csillger.hu>
2025-01-19 21:39:52 +01:00
Gergely Nagy
764cf9afd0
Add an "initial_seed" option
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>
2025-01-19 19:16:04 +01:00
Gergely Nagy
663bcf8dba
More see also!
Signed-off-by: Gergely Nagy <me@gergo.csillger.hu>
2025-01-17 23:16:38 +01:00
Gergely Nagy
3176989f2f
README.md: Add another "See also" software
Signed-off-by: Gergely Nagy <me@gergo.csillger.hu>
2025-01-17 18:43:35 +01:00
Gergely Nagy
f83f54981f
README: Mention a few similar software
Signed-off-by: Gergely Nagy <me@gergo.csillger.hu>
2025-01-17 02:01:52 +01:00
Gergely Nagy
10cd6b9837
Typo fixes
Signed-off-by: Gergely Nagy <me@gergo.csillger.hu>
2025-01-17 01:29:52 +01:00
Gergely Nagy
fe7cf44f26
Another round of documentation updates
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>
2025-01-17 01:28:17 +01:00
Gergely Nagy
7b2e472e35
Major documentation update
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>
2025-01-16 23:44:57 +01:00
Gergely Nagy
65cc8365d6
ci: build & publish the container image too
Signed-off-by: Gergely Nagy <me@gergo.csillger.hu>
2025-01-16 19:31:44 +01:00
Gergely Nagy
b1a4d5bff8
nix: Add a container-image
Signed-off-by: Gergely Nagy <me@gergo.csillger.hu>
2025-01-16 19:28:53 +01:00
Gergely Nagy
598338094c
Fix the tokio-console feature
Don't initialize `tracing_subscriber` if the `tokio-console` feature is
enabled - they conflict.

Signed-off-by: Gergely Nagy <me@gergo.csillger.hu>
2025-01-16 14:20:38 +01:00
Gergely Nagy
0fa4f666f5
nix: Add a NixOS module
Signed-off-by: Gergely Nagy <me@gergo.csillger.hu>
2025-01-16 12:27:10 +01:00
Gergely Nagy
a01cb16ae0
cli: Default to "config.toml" as config file
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>
2025-01-16 12:24:16 +01:00
Gergely Nagy
9658f95ac3
poison: Remove a superfluous <p></p>
Signed-off-by: Gergely Nagy <me@gergo.csillger.hu>
2025-01-16 12:23:25 +01:00
Gergely Nagy
f28642532d
Initial import
Signed-off-by: Gergely Nagy <me@gergo.csillger.hu>
2025-01-16 10:44:56 +01:00