Commit Graph
6 Commits
Author SHA1 Message Date
tajniak81andClaude Opus 5.5 ec2c1661b0 Add Word and Notion import and PDF export
Import (Import on a space's page list, or POST /spaces/{id}/import):
- Word (.docx, up to 25 MB): Title and heading styles, bulleted and
  numbered lists with nesting, quotes, code styles, bold, italic,
  underline, strikethrough, links (including HYPERLINK fields) and
  images, which are stored as attachments of the new page. Tables come in
  as one paragraph per row, as in HTML import.
- Notion export (.zip, Markdown & CSV or HTML, up to 100 MB and 2000
  pages, split exports included): rebuilds the page tree, points links
  between the pages (relative and notion.so ones) at the new pages, and
  stores images and files as attachments. A database becomes a page that
  lists its rows, with the row pages under it. The response lists the
  pages made at the parent's level.
- Every file is read before any page is made, so a bad file leaves
  nothing behind. Archives are capped by bytes actually unpacked, not by
  the sizes they declare.

PDF export (page menu, or ?format=pdf): A4 with the Go fonts (Latin,
Polish, Greek, Cyrillic), a bookmark per heading and page numbers.
Images on the page are drawn in (JPEG as is; PNG, GIF and WebP redrawn);
images on other sites are not fetched. Diagrams become a link to their
file and Mermaid charts show their source. Emoji are left out, since the
fonts have none.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 09:55:00 +01:00
tajniak81andClaude Opus 5.5 631b929433 Add OAuth and OIDC sign-in, two-step codes, audit log, API tokens and webhooks
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>
2026-11-01 09:31:45 +01:00
tajniak81andClaude Opus 5.5 011833fcef Add Markdown and HTML import and export
docwell-server converts between page documents and Markdown or HTML (a
new convert package), so every client and the API get the same results.
Pages export as a download from the page menu; spaces import one page
per .md, .txt or .html file, taking a leading level-1 heading as the
title. Import keeps only what the editor schema knows, which drops
scripts, styles, event handlers and javascript: links; tables become
one paragraph per row until the editor has tables.

The UI package gains DwMenu, a small accessible action menu.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 17:04:39 +01:00
tajniak81andClaude Opus 5.5 25e7ca19a5 Add full-text search with Bleve and the Ctrl+K palette
docwell-server keeps a Bleve index of page titles and text in
DOCWELL_DATA_DIR. Instead of hooking every write, an indexer polls
PocketBase for pages whose "updated" moved (titles, saved content, trash
and restore all touch it) and sweeps out purged pages every ten minutes.
The index can be thrown away at any time: it rebuilds from the database,
and superadmins can trigger a rebuild.

Searches are limited to the spaces the caller can open, match the last
word as a prefix and forgive one wrong letter. Snippets come back as
plain text with match offsets, so clients never render server HTML.

In the web app, Ctrl+K or the sidebar's search box opens a palette that
shows recent pages until something is typed.

The server containers get a /data volume for the index.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 16:57:55 +01:00
tajniak81andClaude Opus 5.5 ba394b8fac Finish Phase 0: lint, codegen, contributor docs and the two remaining spikes
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>
2026-10-31 16:11:07 +01:00
tajniak81andClaude Opus 5.5 5e1dcf4291 Add real-time collaboration with page history
Pages are now shared Yjs documents. docwell-server relays the y-websocket
protocol at /collab (token sent as the first message), flushes updates to
page_yupdates every second, and compacts them into page_ydoc with yrs
compiled to WebAssembly under wazero (ADR-3) after 30 s idle or when the
last editor leaves. Compaction refreshes content_json/content_text and
records page_versions; versions can be listed, previewed and restored.

The editor connects through a small y-protocols provider with carets and
presence. Pages saved before this change are seeded from content_json.
The yrs module lives in Server/ycrdt-wasm and is built by go generate,
CI and the Dockerfiles rather than committed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 11:52:55 +01:00