From e34b8a458d930f16306e75884ee92f81d8e0f359 Mon Sep 17 00:00:00 2001 From: zumbrunn Date: Tue, 3 Nov 2026 23:07:10 +0100 Subject: [PATCH] docs(getting-started): create the first admin in installation, quickstart, migration and deployment Refs duneorg/dune#69 Co-Authored-By: Claude Sonnet 5.5 --- 01.getting-started/01.installation/default.md | 12 ++++++++++++ 01.getting-started/02.quickstart/default.md | 2 ++ 01.getting-started/04.migration/default.md | 2 +- 05.deployment/02.traditional-server/default.md | 2 ++ 4 files changed, 17 insertions(+), 1 deletion(-) diff --git a/01.getting-started/01.installation/default.md b/01.getting-started/01.installation/default.md index cc5fa1f..cbd04c5 100644 --- a/01.getting-started/01.installation/default.md +++ b/01.getting-started/01.installation/default.md @@ -98,6 +98,18 @@ The dev server watches for changes — edit `content/01.home/default.md` and you **Using a different port** — pass `--port`: `deno task dev --port 4000`. Useful if `3000` is already taken by another project; the server prints the URL it actually bound once it starts, so check that if you're not sure what port ended up in use. +## Create your first admin + +You can read and edit content as files without an account, but the admin panel at `/admin` needs a user. Dune does not create a default one, so create it yourself (in a second terminal while the dev server runs, or before starting it): + +```bash +dune users:create you@example.com --role admin --password-prompt +``` + +You're asked for a password twice, with no echo (at least 12 characters). Then log in at `http://localhost:3000/admin/login` with the username (by default the part of the email before the `@`; set it with `--username`). The account is stored in `data/users/`; commit it with the rest of the site. If `dune` isn't installed globally, run it through the CLI your site already uses: `deno run -A jsr:@dune/core/cli users:create …`. + +See [Administration](administration) for scripted and environment-based setup, and for resetting a forgotten password with `dune users:passwd`. + ## What just happened? 1. Dune scanned the `content/` directory and built a **content index** — a lightweight map of every page, its route, and its frontmatter diff --git a/01.getting-started/02.quickstart/default.md b/01.getting-started/02.quickstart/default.md index 5755087..031796a 100644 --- a/01.getting-started/02.quickstart/default.md +++ b/01.getting-started/02.quickstart/default.md @@ -22,6 +22,8 @@ deno task dev The server starts at `http://localhost:3000` with hot-reload — every content or theme change is picked up automatically. +Want to edit in the browser instead of in files? Create your first admin with `dune users:create you@example.com --role admin --password-prompt`, then log in at `/admin`. See [Installation](getting-started/installation#create-your-first-admin). + ## Create a blog section Create a folder for your blog and add a listing page: diff --git a/01.getting-started/04.migration/default.md b/01.getting-started/04.migration/default.md index 5cb76bb..321d4f3 100644 --- a/01.getting-started/04.migration/default.md +++ b/01.getting-started/04.migration/default.md @@ -107,7 +107,7 @@ WordPress content is HTML. Dune's markdown renderer passes raw HTML through unch ### Not imported - Comments (Dune has its own comment system — migrate manually if needed) -- Users (create admin users via `dune new` or the admin panel) +- Users (create your first admin with `dune users:create --role admin --password-prompt`; see [Administration](administration#creating-the-first-admin)) - Attachments / media (download your `wp-content/uploads/` separately and place files in the relevant `content/` page folders or a shared `static/` directory) - Custom post types beyond `post` and `page` - Plugin data (ACF fields, WooCommerce products, etc.) diff --git a/05.deployment/02.traditional-server/default.md b/05.deployment/02.traditional-server/default.md index ebc6616..7acfaf3 100644 --- a/05.deployment/02.traditional-server/default.md +++ b/05.deployment/02.traditional-server/default.md @@ -48,6 +48,8 @@ The production defaults are already sensible: `debug: false`, and the filesystem ### 3. Build and serve +User accounts live in `data/users/` and are normally committed with the site, so an admin you created locally arrives with the clone. If the site has no enabled admin yet (a fresh repo, or you keep `data/users/` out of git), create one on the server with `dune users:create --role admin --password-prompt`, or set `DUNE_ADMIN_EMAIL` and `DUNE_ADMIN_PASSWORD` for the first boot. See [Creating the first admin](administration#creating-the-first-admin) for the rules, and remove the password variable afterwards. + ```bash # Build the content index DUNE_ENV=production dune build