Commit Graph

5 Commits

Author SHA1 Message Date
Wez Furlong f7e68070d1 config: introduce ConfigEpoch and policy file monitoring
This commit adds a background task that periodically evaluates
a glob expression that defaults to the recommended configuration
location and filename suffixes, and a set of additional paths
to observe.

Whenever the hash of that combined set of files changes it causes the
ConfigEpoch to increment and broadcast to subscribers that the
configuration has changed in some fashion.

The QueueConfig struct has a new refresh_strategy which can select
between the earlier Ttl based refresh for the queue config, or
the new Epoch refresh.

When the epoch changes, the config refresh task will cause each of
the scheduled queues that is using the Epoch strategy to re-evaluate
the get_queue_config event to update their configuration.

The queues helper sets the refresh strategy to Epoch.

A new HTTP endpoint has been added: it can force a bump in the
current epoch, effectively causing all epoch subscribers to
wake up and perform a refresh.

These changes avoid doing O(number-of-scheduled-queues) get_queue_config
callouts every refresh_interval; instead, the work is performed only
when an appropriate change is detected or triggered.
2024-09-02 10:42:14 -07:00
Wez Furlong a55f726471 docs: utopia openapi doc description updates
The auto-generator changed how it splits the brief/full description
up when rendering it into the openapi spec.
2024-05-17 07:44:39 -07:00
Wez Furlong c40f86e039 Add suppress-logging option to admin bounces
closes: https://github.com/KumoCorp/kumomta/issues/75
2023-11-23 08:36:07 -07:00
Wez Furlong 9282110479 docs: update openapi snapshots
Meant to include this in the previous commit!

refs: https://github.com/KumoCorp/kumomta/issues/96
2023-11-22 12:54:17 -07:00
Wez Furlong 0b87c020b4 add openapi.json metadata for http api
Adds `/api-docs/openapi.json` and `/rapidoc` endpoints to both
kumod and tsa-daemon.

The former exposes the subset of the API that is expressable
in the openapi schema as a json file that can be imported into
other tools.

The latter is a single-page web app that consumes the former
to provide an interactive API explorer.
We're using rapidoc for this, because I happen to think it looks
nicest and easiest to use, and we can integrate it into the docs
fairly nicely.

Which leads in nicely to say: I've integrated a read-only version
of rapidoc into the docs, and it even detects and adjusts to the
selected light/dark mode.

The `docs/update-openapi.sh` extracts the openapi.json data from
kumod and tsa-daemon and outputs to the correct place in the docs
directory structure to enable this.

refs: https://github.com/KumoCorp/kumomta/issues/96
2023-11-21 15:30:13 -07:00