First-run setup wizard

On a fresh install with no users, the app redirects every request to /setup. The wizard guides you through admin-account creation, site identity, and (optionally) mail settings — all in one shot, no shell access required.

What it does

  1. Detects fresh install — checks if the users table is empty.
  2. Collects admin credentials — email, display name, password (≥10 chars).
  3. Collects site identity — site name (e.g., "Acme Files"), public base URL (e.g., https://files.acme.com).
  4. (Optional) Collects mail settings — SMTP host/port/auth/from. You can skip and configure later.
  5. Persists everything, marks setup complete, redirects to /dash logged in as the new admin.

Re-running the wizard

The wizard is only accessible while no users exist. Once an admin is created, /setup returns 404. To re-run (e.g., on a brand-new install), the data volume needs to be empty.

Don't expose /setup to the internet without TLS. The wizard takes a password and persists it; HTTP would leak it. The route is registered without auth (because there's no admin yet) — TLS is your only protection during this window.

Headless / scripted setup

For automated provisioning (Ansible, Terraform, etc.), use the CLI instead of the web wizard:

docker exec speedyfiles python -m app.cli create-user \
  --email admin@example.com --name 'Site Admin' \
  --role admin --password 'a-strong-password-here'

Site settings can be seeded via SQL or the REST API after the first user exists.