Admin UI

Accent Author is the in-binary admin UI, unlocked by a Core+, Standard, or Pro license. It mounts under /_admin/ and lets you sign in with a bearer token, browse and edit pages, manage media, move pages through a publishing workflow, inspect content models, and read the site-wide validation report. The shell is HTMX-native, responsive enough to use on a phone, and reads through the same content surface as the public site – nothing is rewritten until an operator signs in and actually edits, moves, deletes, or uploads.

Enabling the admin

Three gates must all be true for the shell to mount:

  1. The binary must be built with the admin cargo feature. Admin ships in the Standard and Pro binaries – there is no separate stripped build that omits it. The admin feature also pulls in the cli-api and git-aware features and the blake3 dependency.

  2. A Core+, Standard, or Pro license must be loaded. The admin UI is a licensed feature, gated the same way in dev and production serve – the public site stays free to serve, but mounting the authenticated editor requires a key. Without one, /_admin/* returns 404 and the server logs a Core+ upsell at startup. A Core+ key unlocks the admin UI (and the cheapest way to do so) but does not unlock accent serve --production; that still needs Standard or Pro. The key is loaded from the ACCENTCMS_LICENSE environment variable or the license.key field in config.yaml.

  3. admin.enabled in config.yaml must be true. The default is false, so operators opt in explicitly. The flag is checked on every request via middleware: when the admin is disabled, /_admin/* routes return 404.

admin:
  enabled: true
  token: "your-secret-admin-token-min-32-bytes"
  brand_name: "Acme docs"               # optional, shown on the login card and top bar
  brand_logo: "/assets/acme.svg"        # optional brand logo URL
  audit_log_path: "./.admin/audit.log"  # optional JSONL audit trail

The token can also be supplied via the ACCENT_ADMIN_TOKEN environment variable, which takes precedence over admin.token whenever it holds a value. A variable or admin.token that is empty or only whitespace counts as unset. Use the env var path when you do not want the secret to live next to config.yaml in source control.

A Brief Tour

Once signed in you land on a dashboard of recent edits and a validation summary. From there a left rail leads to the pages list and tree for browsing and creating content, the page editor for editing with live preview and conflict detection, the media library for uploading and managing assets, a read-only view of the loaded document models, the site-wide validation report, and a settings screen for token rotation and license details. Edits flow through a fixed publishing workflow, and every mutation is appended to an audit log.

In This Chapter

  • Authentication – bearer-token login, the session cookie, token rotation, and the minimum-token-length warning.
  • The Shipped Screens – every screen the shell ships: dashboard, pages list and tree, page new, editor, media library and detail, models, validation report, and settings.
  • Page Editing – the three editor modes, inline field validation, live preview, save with conflict detection, and the frozen-content guard for versioned sites.
  • Workflow and Roles – the fixed four-state workflow machine, the publish gate, per-model review requirements, and the read-only Publisher role.
  • Media and Page Management – browsing and uploading media, rename with reference rewriting, delete with used-by checks, and creating, moving, and deleting pages.
  • Configuration – every admin.* key, the audit log format, conflict resolution, and mobile usage.
  • Migration and Hotfix – opt-in/opt-out, upgrading from a pre-admin binary, and the hotfix overlay for patching baked-in vendor assets.
  • Troubleshooting – common failure modes and how to resolve them.

In this section

  • Authentication

    Sign in with a bearer token, hold a session through an HttpOnly cookie, and rotate the secret without rewriting config.yaml.

  • The Shipped Screens

    A tour of every screen the admin shell ships -- dashboard, pages list and tree, page new, editor, media library and detail, models, validation report, and settings.

  • Page Editing

    Three editor modes, inline field validation, live preview, save with mtime-based conflict detection, and a server-enforced guard for frozen versioned content.

  • Workflow and Roles

    A fixed four-state publishing machine with contextual transition buttons, a validation gate on publish, per-model review requirements, and a read-only Publisher role.

  • Media and Page Management

    Browse and upload media, rename assets with automatic reference rewriting, delete with used-by checks, and create, move, and delete pages with collision and dependency guards.

  • Configuration

    Every admin.* configuration key, the JSONL audit log format, how concurrent-edit conflicts are resolved, and how the shell behaves on mobile.

  • Migration and Hotfix

    Opt in or out of the admin across releases, upgrade safely from a pre-admin binary, and patch baked-in vendor assets through a hotfix overlay without rebuilding.

  • Troubleshooting

    Common admin failure modes -- short tokens, 404 routes, login mismatches, and the Core+ license requirement -- and how to resolve each.