📝 Doc cron, mail queue, CSRF and flash messages

Add the scheduled tasks guide, environment variable overrides, the
[mail] and [cron] references, CSRF protection without tokens, flash
messages after redirects and the username policies of pagetop-user.
Update the framework comparison with Poem and Topcoat.
This commit is contained in:
Manuel Cillero 2026-11-02 14:46:28 +01:00
parent 1a41a456d4
commit 4e007feec8
23 changed files with 946 additions and 125 deletions

View file

@ -94,11 +94,11 @@ When writing a chapter:
- Use ```` ```rust ```` only for examples that can run with no server (with `assert!`),
```` ```rust,no_run ```` for the rest, and ```` ```rust,ignore ```` only for loose fragments
that are not valid on their own.
- Examples can use `pagetop`, `pagetop-admin`, `pagetop-bootsier`, `pagetop-htmx`,
`pagetop-seaorm` (with SQLite), `pagetop-user`, `pagetop-build`, `serde`, `thiserror` and
`tower-http` (with the `compression-gzip`, `cors`, `limit` and `timeout` features); the
translations in `tools/doccheck/src/locale/` (`LOCALES_APP`), and a static files bundle named
`app`. If a chapter needs anything else, add it to `tools/doccheck`.
- Examples can use `pagetop`, `pagetop-admin`, `pagetop-bootsier`, `pagetop-cron`,
`pagetop-htmx`, `pagetop-mail`, `pagetop-seaorm` (with SQLite), `pagetop-user`, `pagetop-build`,
`serde`, `thiserror`, `tokio` and `tower-http` (with the `compression-gzip`, `cors`, `limit` and
`timeout` features); the translations in `tools/doccheck/src/locale/` (`LOCALES_APP`), and a
static files bundle named `app`. If a chapter needs anything else, add it to `tools/doccheck`.
- Examples and tests that start an application read `tools/doccheck/config/`: those with a database
get a new in-memory SQLite one on every run.
- Tests that share state (a static store, a database) run in the same process: write one test per
@ -111,7 +111,8 @@ The first run compiles PageTop and takes a few minutes; the next ones only compi
Settings are loaded in cascade from the `config/` directory (or the one in the `CONFIG_DIR`
environment variable): `common.toml`, then `{run_mode}.toml` according to `PAGETOP_RUN_MODE`
(`default` by default), `local.{run_mode}.toml` and `local.toml`. The local files are not
versioned. There are no environment variables that override individual keys.
versioned. Finally, environment variables named `PAGETOP_<SECTION>__<KEY>` override individual
keys (e.g. `PAGETOP_SERVER__BIND_PORT=80`).
## Warning