Build out the admin panel

- Overview: users, organizations, workspaces, spaces, pages, files and
  storage (org admins see their organization), plus pages open right now,
  the search index size, and version, uptime and database health.
- Users: invite people by email (with resend, revoke and a copyable link
  when mail fails) and send a password-reset email.
- Authentication: sign-up on or off, the email-domain allow-list, and
  sign-in links by email.
- Branding: instance name, accent colour and logo. The web app shows them
  on the sign-in pages and applies the accent colour everywhere.
- Email and Storage: SMTP and S3 settings with test buttons.
- Maintenance: create, download and delete database backups, and a view
  of the background jobs with their last run, duration and errors.

On the server, a small jobs registry records each search-indexing pass,
and "search.rebuild" replaces the separate reindex endpoint. A new
instance package serves the dashboard numbers, health and backups.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
tajniak81andClaude Opus 5.5 committed 2026-10-31 17:34:48 +01:00
1 parent 92cd81fd96
commit ffc6cc4fbc
31 files changed
+2326 -134

No files matched your search

@@ -0,0 +1,77 @@
<!-- SPDX-License-Identifier: AGPL-3.0-or-later -->
<script setup lang="ts">
import { DwButton, DwCallout } from "@docwell/ui";
import { ref, watch } from "vue";
import { useInstanceSettings } from "../settings";
// Who may create an account, and how people sign in.
const { settings, error, saved, busy, save } = useInstanceSettings();
const signupEnabled = ref(true);
const domains = ref("");
const magicLink = ref(false);
watch(settings, (s) => {
if (!s) return;
signupEnabled.value = s.signup.enabled;
domains.value = s.signup.domains.join("\n");
magicLink.value = s.auth.magicLink;
});
function submit() {
save({
signup: { enabled: signupEnabled.value, domains: domains.value.split(/[\s,;]+/).filter(Boolean) },
auth: { magicLink: magicLink.value },
});
}
</script>
<template>
<h1 class="text-2xl font-semibold tracking-tight">Authentication</h1>
<p class="mt-1 text-ink-muted">Who can create an account, and how people sign in.</p>
<DwCallout v-if="error" tone="danger" size="ui" class="mt-4">{{ error }}</DwCallout>
<DwCallout v-if="saved" tone="success" size="ui" class="mt-4">Saved.</DwCallout>
<form v-if="settings" class="mt-6 max-w-xl space-y-6" @submit.prevent="submit">
<section class="dw-card space-y-4">
<h2 class="text-ui-lg">Sign-up</h2>
<label class="flex items-start gap-3">
<input v-model="signupEnabled" type="checkbox" class="mt-1 accent-primary" data-testid="signup-enabled" />
<span>
<span class="font-medium">Anyone can create an account</span>
<span class="block text-ui-sm text-ink-muted">
Off: only invited people can join. The very first account can always sign up.
</span>
</span>
</label>
<label class="flex flex-col gap-1.5">
<span class="text-ui-sm font-semibold">Allowed email domains</span>
<textarea
v-model="domains"
rows="3"
class="dw-input font-mono"
placeholder="example.com"
data-testid="signup-domains"
/>
<span class="text-ui-sm text-ink-muted"
>One per line. Empty allows every domain. Invites ignore this list.</span
>
</label>
</section>
<section class="dw-card space-y-4">
<h2 class="text-ui-lg">Sign-in methods</h2>
<p class="text-ui-md">Email and password is always on.</p>
<label class="flex items-start gap-3">
<input v-model="magicLink" type="checkbox" class="mt-1 accent-primary" data-testid="magic-link" />
<span>
<span class="font-medium">Sign-in links by email</span>
<span class="block text-ui-sm text-ink-muted">
People can ask for a link and a one-time code instead of typing their password. Needs working email.
</span>
</span>
</label>
</section>
<DwButton type="submit" variant="primary" :disabled="busy">Save</DwButton>
</form>
</template>