docwell-db no longer needs a Docwell image: the stack runs
tajniak81/pocketbase-docker-root as it is, and docwell-server does what
the migrations and pb_hooks used to do inside PocketBase.
On start, docwell-server now:
- waits for PocketBase and imports Docwell's collections from an
embedded snapshot (internal/pbschema). Existing collections and
fields are matched by name, so their data is kept; the admin-managed
users options (OAuth2 providers, magic link) are left untouched.
- writes the DOCWELL_APP_NAME, DOCWELL_WEB_URL, DOCWELL_MAIL_FROM,
DOCWELL_SMTP_* and DOCWELL_S3_* settings into PocketBase, as the
boot hook did.
It also replaces the hook's two routes: token checks use PocketBase's
auth-refresh (the organization name is read as the superuser), and
Docwell's own emails go out over SMTP from the server. PocketBase never
returns the SMTP password, so the server keeps a copy in the
superuser-only instance_settings collection; a password saved before
this change has to be entered once more in the admin panel.
Database/ keeps pb_migrations as the source of the schema;
export-schema.sh regenerates the snapshot from them. Database/Dockerfile
and pb_hooks are removed, the release no longer builds docwell-db, the
AIO image runs PocketBase without migrations or hooks, and the compose
files default DB_IMAGE to the stock image and pass the settings to the
server instead of the database.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign-in:
- Google, GitHub, Microsoft and any OpenID Connect provider, set up in the
admin panel (secrets are write-only). PocketBase talks to the provider,
and docwell-server keeps the state and PKCE verifier. Accounts a
provider creates follow the sign-up switch and the domain list; refused
ones are removed again.
- Two-step sign-in with an authenticator app (TOTP), set up under "Your
account", with ten single-use recovery codes. After any first factor
(password, email code, provider) the session is held behind a
five-minute challenge: five tries, each code works once. Turning it off
needs a code. Managers can reset it for someone who lost their phone.
Both the web app and the admin panel ask for the code.
Integrations:
- Personal API tokens ("dw_…") that act as their owner, read-only or
read-write, with optional expiry. Only a hash is stored, and the token is
shown once. Tokens cannot manage tokens or two-step sign-in. Admins see
and can revoke their organization's tokens.
- Workspace webhooks for page, comment and space events. Deliveries are
HMAC-SHA256 signed and retried (10 s, 1 min, 5 min), with a 30-day log
and a test button. Loopback and link-local addresses are refused
(DOCWELL_WEBHOOKS_ALLOW_LOCAL is for development).
Audit log: sign-ins (including failures and second steps, filed under the
account's organization) and every successful change request, by route and
path ids, never bodies. Superadmins see everything and org admins their
organization. It is searchable and exportable as CSV in the admin panel's
new Security page, and kept for DOCWELL_AUDIT_RETENTION_DAYS (365).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- 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>
Repository basics:
- CONTRIBUTING.md and CODE_OF_CONDUCT.md (Contributor Covenant 2.1)
- SPDX AGPL-3.0-or-later headers on all hand-written sources, checked in CI
- golangci-lint (shared .golangci.yml), ESLint and Prettier, all run in CI
API codegen from api/openapi.yaml (npm run generate, drift fails CI):
- Go types via oapi-codegen in Server/internal/api
- a contract test that the router and the spec list the same routes
- Dart models via Phone-App/tool/generate_api.dart; the app uses them
Spike: shared Tiptap editor in a Flutter WebView (ADR-4)
- @docwell/editor-bridge builds the editor into one HTML page with a
versioned JSON protocol; Phone-App hosts it with webview_flutter and a
native toolbar. Integration test passes on an Android API 35 emulator.
- flutter_inappwebview dropped: its Android plugin fails on AGP 9.
Spike: Wails v3 desktop (ADR-11)
- system tray, docwell:// deep links (page and space only) with
single-instance hand-off, and the built-in updater with a required
ed25519 signing key. Verified on Windows.
- regenerated build assets register the scheme and drop template
placeholders.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Spaces and pages:
- Spaces inside workspaces, open or private, with admin/editor/commenter/viewer
roles that cascade from the workspace role (rules in internal/access)
- Page tree per space with fractional position keys, move with cycle checks,
trash that hides whole subtrees, restore and permanent delete
- OpenAPI, TypeScript client, and web app sidebar tree with drag-and-drop,
page, space, trash and space settings views (EN + PL)
Design system:
- Tokens, type scale, radii and shadows from the design kit in
@docwell/ui/theme.css; Inter, Source Serif 4 and JetBrains Mono bundled
- Vue ports of Button, TextField, Badge, Callout, Icon, Breadcrumbs,
SlashMenu and PageTreeItem, plus Logo; favicons and web manifest
- Web app and admin panel restyled on the new tokens, in light and dark
Also: fix the Vite dev server crashing on /config.json, and stop tracking
the local Design/ and docs/ folders.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Same model as DriverVault, with organizations above workspaces:
- users get a role (user, admin, superadmin) and at most one
organization; existing instance admins become superadmins
- rights cascade: superadmins own everything, org admins own their
organization's workspaces, others get their workspace role
(owner > admin > member > guest) while they stay in the org
- nobody grants a role above their own, acts on someone ranked above
them, or changes their own role; rules live in internal/access as
pure, tested functions
- self-service organizations: an org-less user creates one and becomes
its admin; the last admin can delete it and is demoted
- endpoints for users, orgs, workspaces and members; token cache is
dropped when a user's rights change
- admin panel: Users and Organizations pages scoped to the caller
- web app: organization page, workspace list, workspace settings with
member management (EN/PL)
- fix: organization name missing after login/refresh, and stale tokens
redirecting public pages to sign-in
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Phase 0 foundation for Docwell, an open-source knowledge base:
- Database: PocketBase v0.40.6 with initial schema migrations; users is
the built-in auth collection, plus a hook for token checks and
env-driven app URL/SMTP settings
- Server: Go API (health, version, auth endpoints forwarded to
PocketBase, admin user list) with an embedded Vue admin panel
- Web-App: Go static server and Vue/Tailwind app with Tiptap editor,
sign-in, sign-up, password reset and email verification (EN/PL)
- Desktop-App: Wails v3 host reusing the web app
- Phone-App: Flutter app with sign-in
- Shared packages (editor, ui, api-client), OpenAPI spec, Docker
compose (separate services and all-in-one), GitHub Actions CI
- Docs: feature inventory and architecture/build plan
Licensed under AGPL-3.0-or-later.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>