Skip to content

RustCMS v0.12.0

Choose a tag to compare

@irisvn irisvn released this 04 Nov 07:12
· 1 commit to main since this release

RustCMS v0.12.0. Install: https://irisvn.github.io/RustCMS/ (guide, install scripts).

Built from irisvn/RustCMS-Core v0.12.0.

— 2026-11-04

Added

  • API mode (ADR 0036): [app] mode = "api" (RUSTCMS_APP__MODE, serve --api-only) serves the application API only. Nothing under
    auth.admin_path answers but a JSON 404 (before routing, no session
    loaded): no panel, admin API, panel sign-in routes or AdminRoutes
    (streams, sockets). Permissions, job kinds, schedules and commands are
    declared as in full. queue.enabled and schedule.enabled left out are
    false in API mode. AppState::mode(), AppBuilder::mode(),
    AppBuilder::panel_path(), queue::Jobs::kinds(); serve in API mode
    warns about SQLite, a missing Redis and a local disk
    (app::api_mode_warnings).
  • Media hooks: AdminProvider::media_hook(impl MediaHook) runs application
    code in the transaction of every change to a media record (MediaEvent:
    Uploaded, Updated with the previous record, Trashed, Restored,
    Deleted); an error rolls the change back. Registry::media_hook,
    Registry::media_hooks.
  • just bench-api (bench/api, scripts/bench-api.sh): a load test of the
    application API with oha on PostgreSQL.

Changed

  • The media and exports/imports cleanups are framework schedules
    (rustcms.media-prune.<disk> every minute, rustcms.exports-prune.<disk> every 10
    minutes, timeout 30 min; one schedule per storage disk, the exports and
    imports passes each bounded and attempted independently) instead of
    tokio::spawn loops in
    AdminProvider::boot with a Redis lease: run only by serve with the
    scheduler, once per slot across instances, never by commands or tests.
    Deployments without the scheduler run media:prune and
    schedule:run rustcms.exports-prune.<disk> from cron.

  • Each instance sweeps its own staging directory (storage::sweep_staging:
    abandoned uploads, export and import files older than an hour): serve in
    any mode and queue:work at start and every 10 minutes, queue:work --once
    and media:prune once. media::prune, exports::prune and
    imports::prune no longer sweep.

  • A JWT's sign-in and user are read in one joined statement. Two opt-in
    settings (default 0, unchanged behaviour) let an instance reuse reads:
    auth.permission_generation_cache_ms (the RBAC generation) and
    auth.jwt.session_cache_ms (a JWT's sign-in and user), e.g. 1000 on API
    instances (ADR 0012 amendment). Changes made through an instance apply
    there on the next request; on other instances within that time. Sessions
    and API tokens are never cached.

  • A personal access token is checked with one statement (token and owner
    joined) and last_used_at is written only when the value read is more than
    a minute old: a request with a token used within the minute sends no
    UPDATE (4 statements before the handler became 2). Refusals are unchanged
    (wrong secret, revoked, expired, inactive or deleted owner).

Fixed

  • The S3 disk's sweep also removes export and import files a crash left in
    .s3-staging (it removed only *.upload), so exported data no longer stays
    on the instance's disk.