Skip to content

Setup wizard: a new array from the mounted disks, or the config you have - #32

Merged
firsttris merged 1 commit into
masterfrom
claude/setup-wizard
Oct 9, 2026
Merged

firsttris merged 1 commit into
masterfrom
claude/setup-wizard

Conversation

@firsttris

Copy link
Copy Markdown
Owner

The first snapraid.conf is the biggest hurdle for new users. Without a configuration file, the dashboard now offers both ways:

  • Add existing configuration: opens Manage Configurations, as before. A snapraid.conf copied into the data folder still works without any further step.
  • Set up a new array: the new wizard at /setup.

The wizard

  1. Existing or new: pick one of the two ways above.
  2. Disks:
    • Lists the mounted filesystems with size and used space, from df.
    • Leaves out virtual filesystems, system directories, the app's own folders and bind-mounted files (/etc/hosts in Docker).
    • The user picks Data, Parity or Not used per disk. Data disks get d1, d2, … (editable).
    • A disk that already holds a parity file is preselected as parity. Add a folder covers paths not detected.
  3. Checks:
    • Blocking: at least one data and one parity disk (up to six parity), valid and unique names, absolute and separate paths, no disk inside another.
    • Warnings: a parity disk smaller than the data on the largest data disk (the sync would fail), smaller than the largest disk, or not empty.
  4. Review: shows the generated snapraid.conf, then writes it into the data folder. Run the first sync right away is on by default.

The generator lives in shared/array-setup.ts, so the preview is exactly what the backend writes. It produces:

  • parity/2-parity/… files at the top of each parity disk;
  • content files in the data folder plus one on each of the first data disks, one per parity level, so SnapRAID gets one more copy than parity levels, on different disks;
  • the data disks and the usual excludes.

First start

  • The backend creates a placeholder entry Default → snapraid.conf. The welcome now also appears while that file doesn't exist, not only when there are no entries at all. Before, a fresh install showed a dashboard full of errors.
  • Creating an array removes that placeholder if its file never existed. Existing files are never overwritten (409).

API

  • GET /api/setup/mounts
  • POST /api/setup/create with {name, fileName, setup}: 400 with problems if the setup is incomplete or a path is not a directory, 201 with the stored path.

Tests

  • Backend: 143 passed with Deno 2.5. New tests:
    • df filtering on a typical container's mounts (spaces in paths, duplicates, /etc/hosts, /app);
    • the generated config, including content files for two parity levels;
    • setup problems;
    • disk names.
  • Frontend: Biome, typecheck, Vitest 31. New tests: roles and names, capacity warnings, file names.
  • E2E: 17/17 locally. New tests:
    • after a first start with the placeholder: wizard → disks picked → config written → first sync → All good, placeholder replaced;
    • a setup without parity is refused, and a too small parity disk is flagged.
    • Detection itself is mocked there, because the sandbox disks share one filesystem.
  • Docs: disks.md (Set up a new array), installation.md (First start), architecture.md (API), development.md, README. mkdocs build --strict passes.

This PR and #31 both add translation keys, a row in the E2E table of development.md, and a route to routeTree.gen.ts. Whichever is merged second needs a rebase; I'll do it.

🤖 Generated with Claude Code

https://claude.ai/code/session_01JuXnquCPdbG5sBbDyin7yF


Generated by Claude Code

Without a configuration file, the dashboard offers both ways: add an
existing snapraid.conf, or set up a new array. The wizard lists the
mounted filesystems (df, without system and virtual ones), the user
picks data and parity disks, it checks names, paths and parity sizes,
shows the snapraid.conf it writes (content files on different disks,
one more copy than parity levels), creates it in the data folder and
starts the first sync. The first start's placeholder entry is replaced.

With unit and end-to-end tests and documentation.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JuXnquCPdbG5sBbDyin7yF
@firsttris
firsttris merged commit b24904b into master Oct 9, 2026
4 checks passed
@firsttris
firsttris deleted the claude/setup-wizard branch October 16, 2026 09:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants