Admin Panel
The Dune admin panel is a browser-based interface for managing content, media, users, and site configuration without editing files directly.
Stability note: The admin panel UI and its internal API endpoints (
/admin/api/…) are functional but should be considered beta. Breaking changes to panel internals may occur in minor releases. The panel is intended for human editors, not programmatic integrations — use the REST API for machine-to-machine access.
Accessing the panel
By default the panel is at /admin. Dune does not create a default admin account: create the first admin yourself (see below), then log in with it. A site that has the admin plugin loaded but no enabled admin user logs bootstrap.no_admin_user at startup, with the command to run.
Before
@dune/plugin-admin3.3.0, first startup created a defaultadminaccount and wrote its password to a file. That no longer happens. Sites that already have an admin are unaffected.
Creating the first admin
Create the first admin from the command line:
dune users:create admin@example.com --role admin --username admin --password-prompt
or from the environment, for container and server deployments:
DUNE_ADMIN_EMAIL=admin@example.com
DUNE_ADMIN_PASSWORD=... # at least the minimum strength; never logged
DUNE_ADMIN_USERNAME=admin # optional, default "admin"
If both DUNE_ADMIN_EMAIL and DUNE_ADMIN_PASSWORD are set and the site has no enabled admin, Dune creates one when it boots. This lives in core, so it works with any admin implementation. Rules:
- It only acts when no enabled admin exists. It never overrides or resets an existing account; to change a password use
dune users:passwd. - Both variables must be set, or neither. A weak password, an invalid email, a username that is taken, or an email that belongs to a non-admin account stops boot with a message saying which.
- The password stays in the process environment. Remove
DUNE_ADMIN_PASSWORDfrom your deployment config after the first boot.
The "no admin user" notice
When the admin plugin is loaded and no enabled user has the admin role, startup logs an info line:
bootstrap.no_admin_user The admin panel is on but no admin user exists, so nobody can log in. Create one with `dune users:create you@example.com --role admin --password-prompt` (or set DUNE_ADMIN_EMAIL and DUNE_ADMIN_PASSWORD for a container deploy).
It also fires when users exist but none is an enabled admin. A common cause is an account made with dune users:create ... --password-prompt but without --role admin: it can log in, and then every admin page answers 403. Create an admin with --role admin, or give the account the role.
The notice stays quiet when no admin plugin is loaded (a headless site may not want one), when an enabled admin exists, and when the configuration hands out admin-tier roles itself (role_grants, OAuth role claims), where the first admin arrives with the first login.
Change the URL prefix with path in the admin plugin's config (config: under its entry in plugins:):
# config/site.yaml
plugins:
- src: jsr:@dune/plugin-admin@^5
config:
path: /cms # panel available at /cms
The admin plugin's settings are listed in the admin plugin's configuration below; core has no admin: section.
The admin panel is a plugin, @dune/plugin-admin, and core runs it only when config/site.yaml lists it under plugins: (dune new writes the entry, and dune migrate:config adds it to an existing site):
# config/site.yaml
plugins:
- src: jsr:@dune/plugin-admin@^5
Headless / API-only deployments: do not list it. With no admin plugin there are no admin routes, no admin user pool and no related overhead, and core says once at boot that nothing provides the admin. (
admin.enabledno longer exists; a config that still sets it is refused.) Advanced users can replace the admin with their own plugin that provideseditor.session; see Writing your own admin.
Admin plugin configuration
The admin's settings are its plugin config: config: under its entry in plugins: (config/site.yaml). Core reads none of them. A path that is not a clean prefix, or an auth_provider other than local, stops the site at boot.
| Key | Default | Meaning |
|---|---|---|
path |
/admin |
URL prefix of the panel |
session_lifetime |
86400 |
Session lifetime in seconds |
max_upload_mb |
100 |
Upload limit for the media library and content attachments |
git_commit |
false |
Commit to git after every page save |
webhooks |
none | Outbound webhooks on content events |
auth_provider |
local | Only type: local is supported; see Auth providers |
audit |
on | Audit log: enabled, log_file |
machine_translation |
none | Machine translation provider |
runtime_dir (sessions, revisions, audit log), max_revisions and data_dir (users, submissions) are core settings in system.yaml.
Roles and permissions
Three roles control what each user can do:
| Role | Can do |
|---|---|
admin |
Everything: content, media, users, config, form submissions |
editor |
Content CRUD, media management, read config and submissions. Cannot manage users or change config. |
author |
Create and edit pages, upload media, read submissions. Cannot delete pages, media, or access config. |
Users are stored in data/users/ (under data_dir in system.yaml) and should be committed to version control. Passwords are stored as PBKDF2 hashes — never in plaintext.
There is no default account; see Creating the first admin. To change a password later, use the admin panel or dune users:passwd.
What the panel provides
| Feature | Description |
|---|---|
| Inline editing | Edit page titles and body content directly in the public site view — hover an editable region and click ✎ Edit while logged in. Requires the @dune/plugin-inline-edit plugin. See Inline editing. |
| Content editor | Create, edit, and delete pages. Supports Markdown, MDX, and frontmatter editing. Blueprint-driven custom fields are auto-generated from blueprints/{template}.yaml. |
| Draft preview | Save a draft and get a shareable preview URL that renders through the active theme. Reviewers don't need admin access. See Draft preview. |
| Workflow | Move pages through draft → in_review → published → archived states. |
| Scheduled actions | Set a date/time for automatic publish or unpublish. |
| Revision history | Browse and restore previous versions of any page. Up to system.max_revisions (default 50) saved per page. The current revision count is shown in the editor toolbar. |
| Comments & annotations | Leave threaded comments on pages with @mention support and a resolve workflow for editorial sign-off. See Comments. |
| Webhooks | Fire outbound HTTP POST requests when pages are created, updated, deleted, or workflow status changes. See Webhooks. |
| Flex Objects | Create, edit, and delete records for schema-driven custom data types (products, team members, events, etc.). Schemas defined in flex-objects/{type}.yaml. See Flex Objects. |
| Configuration editor | Edit config/site.yaml and config/system.yaml through a form UI without touching files directly (admin role only). |
| Themes | Browse installed and registry themes, preview any theme before switching, and install new themes from the marketplace. See /admin/themes. |
| Media library | Upload, browse, and delete media files co-located with content pages. |
| Form submissions | View submissions collected from blueprint-driven forms. See Forms. |
| User management | Create, edit, enable/disable admin users (admin role only). |
Configuration editor
The configuration editor (admin role only) lets you edit config/site.yaml and config/system.yaml through a form UI at /admin/config. Fields are rendered based on the schema for each config file — no need to know the YAML syntax.
Changes are written back to the config files and take effect on next request (for system config) or after a content rebuild (for site config). The editor shows all recognised fields with their current values and inline help text.
Themes
The Themes page (/admin/themes) lets you switch the active theme, preview alternatives before committing, and edit that theme's own settings. Select a theme from the dropdown and click Preview to see an iframe rendering of your site in that theme; click Apply this theme to make the switch. Below the switcher, Theme settings shows a schema-driven form for the active theme's own configuration (colors, layout options, etc., as defined by the theme).
From the same page, Browse Marketplace takes you to the full theme browser — your installed themes and a curated registry of community themes. You can install a theme directly from the registry — no restart required. See Theme Preview & Marketplace for details.
Revision history
Every save to a page creates a revision snapshot. The page editor toolbar shows a History button with the current revision count. Clicking it opens a timeline of all saved versions, with timestamps and author information.
From the history view you can restore any previous version — this creates a new revision rather than overwriting the current one, so you can always undo a restore by reverting again.
Revisions are stored in system.runtime_dir (default .dune/admin/) and are not committed to version control. The maximum number of revisions kept per page is controlled by system.max_revisions (default 50); older revisions are pruned automatically.
Draft staging
Staging lets editors save work-in-progress content and share a live preview with reviewers — before the page goes public.
Saving a draft from the page editor stores a staging file in runtime_dir/staging/. Each draft gets a random opaque token. The preview URL is:
https://example.com/__preview?path={encoded-source-path}&token={token}
The token is stable across saves, so sharing the link once is enough — it stays valid as the editor continues working. When the draft is published, the staging file is removed.
Staging files are ephemeral (live in runtime_dir, not committed to git). They are lost if you wipe runtime_dir or deploy to a fresh server. To keep drafts across deploys, back up runtime_dir or mount it on persistent storage.
Git auto-commit
When git_commit: true is set in the admin plugin's config, every page save and staging publish triggers an automatic git add + git commit:
# config/site.yaml
plugins:
- src: jsr:@dune/plugin-admin@^5
config:
git_commit: true
The commit message includes the file path and editor username:
Admin: update content/blog/my-post/default.md (by jane)
Commit failures are logged as warnings and never block the save. Git must be available in the server's PATH.
Sessions
Sessions are cookie-based and stored in system.runtime_dir (default .dune/admin/sessions/). They expire after admin.session_lifetime seconds (default 24 hours). Sessions are ephemeral — they are lost on restart or deploy.
The session cookie is HttpOnly, SameSite=Strict, and Secure (in production). In development (DUNE_ENV=dev), the Secure flag is omitted to allow HTTP.
Security considerations
- Admin routes are isolated under the admin plugin's
pathand require authentication on every request - Sessions use PBKDF2-hashed passwords with per-user salts
- The
adminrole is required to create otheradmin-role accounts — editors and authors cannot escalate their own privileges - Form submission data lives in
data_dir(git-tracked); session and revision data lives insystem.runtime_dir(gitignored) — keep these locations separate - If you expose the panel publicly, put it behind HTTPS and consider restricting access by IP at the infrastructure level for higher-security sites